Sari la conținut

JUST4METIN.COM CAUTA STAFF ACTIV - PM Bogdan

Robot

[Release]Check System

Postări Recomandate

What is check system?

It's a simple system that allow you to trade an hight amount of yang.

 

Server Side for who change variables from int to long or long long

--***
--**Coded by Luzzo
--***

quest collect_check begin
	state start begin
		function money_operation(operation)
			if operation == 1 then
				say("How many yang do you want to deposit?")
				local money = tonumber(input())
				if money == nil then
					syschat("You have entered a not valid value")
					return
				end
				if money > 0 and money < 1999999999 and pc.get_gold() >= money then
					pc.changegold(-money)
					item.set_socket(0, item.get_socket(0)+money)
					syschat("You have deposited "..money.." yang.")
				else
					syschat("You have entered a not valid value")
				end
			elseif operation == 2 then
				say("How many yang do you want to take?")
				local money = tonumber(input())
				if money == nil then
					syschat("You have entered a not valid value")
					return
				end
				if money > 0 and item.get_socket(0) >= money and pc.get_gold()+money <= 1999999999 then
					pc.changegold(money)
					item.set_socket(0, item.get_socket(0)-money)
					syschat("You have taken "..money.." yang.")
				else
					syschat("You have entered a not valid value")
				end
			elseif operation == 3 then
				say("You will lose all money on this check")
				say_reward("Are you sure?")
				local conf_deleting = select("Yes, Delete","No,i will think")
				if conf_deleting == 1 then
					item.remove()
				end
			end
		end
					
		when 50512.use begin
			say_title("Check Manager")
			say("Hi "..pc.get_name().." how can i help you?")
			local selection = {"Deposit Money","Take Money","Delete Check","Exit"}
			local choice = select_table(selection)
			if choice != table.getn(selection) then
				say_title("Check Manager")
				say("Mode:"..selection[choice])
				collect_check.money_operation(choice)
			else
				return
			end
		end
	end
end
					
		

Server Side for no modified variables.(Common function source is int)

--***
--**Coded by Luzzo
--***

quest collect_check begin
	state start begin
		function money_operation(operation)
			if operation == 1 then
				say("How many yang do you want to deposit?")
				local money = tonumber(input())
				if money == nil then
					syschat("You have entered a not valid value")
					return
				end
				if money > 0 and money < 999999999 and pc.get_gold() >= money and item.get_socket(0)+money <=  999999999 then
					pc.changegold(-money)
					item.set_socket(0, item.get_socket(0)+money)
					syschat("You have deposited "..money.." yang.")
				else
					syschat("You have entered a not valid value")
				end
			elseif operation == 2 then
				say("How many yang do you want to take?")
				local money = tonumber(input())
				if money == nil then
					syschat("You have entered a not valid value")
					return
				end
				if money > 0 and item.get_socket(0) >= money and pc.get_gold()+money <= 1999999999 then
					pc.changegold(money)
					item.set_socket(0, item.get_socket(0)-money)
					syschat("You have taken "..money.." yang.")
				else
					syschat("You have entered a not valid value")
				end
			elseif operation == 3 then
				say("You will lose all money on this check")
				say_reward("Are you sure?")
				local conf_deleting = select("Yes, Delete","No,i will think")
				if conf_deleting == 1 then
					item.remove()
				end
			end
		end
					
		when 50512.use begin
			say_title("Check Manager")
			say("Hi "..pc.get_name().." how can i help you?")
			local selection = {"Deposit Money","Take Money","Delete Check","Exit"}
			local choice = select_table(selection)
			if choice != table.getn(selection) then
				say_title("Check Manager")
				say("Mode:"..selection[choice])
				collect_check.money_operation(choice)
			else
				return
			end
		end
	end
end
					
		

Cient Side

 

1)unpack root and open uitooltip.py

2)Find

		### Hair Preview Image ###
		if self.__IsHair(itemVnum):	
			self.__AppendHairIcon(itemVnum)

Is in AddItemData method

 

3) Before paste this

		if itemVnum == 50512:
			if metinSlot[0] != 0:
				self.AppendDescription("Yang Account: %s." %localeInfo.NumberToMoneyString(metinSlot[0]) , 26, self.CONDITION_COLOR)
			else:
				self.AppendDescription("Empty Check" , 26, self.CONDITION_COLOR)
				

I use 50512 item just to script the system you can use another value with a better icon =D

 

 

Screen

 

13a8ee9b0f.jpg

 

 

b1335941e4.jpg

 

d1ac4ff4be.jpg

 

 

Changelog

 

Added to different version

Partajează acest post


Link spre post
Distribuie pe alte site-uri

Creează un cont sau autentifică-te pentru a adăuga comentariu

Trebuie să fi un membru pentru a putea lăsa un comentariu.

Creează un cont

Înregistrează-te pentru un nou cont în comunitatea nostră. Este simplu!

Înregistrează un nou cont

Autentificare

Ai deja un cont? Autentifică-te aici.

Autentifică-te acum

×