samt2497 Posted March 16, 2010 Posted March 16, 2010 i writting a code and i have a problem with a command for send money to another player the code is it function dardinero ( thePlayer, commandName, destplayer, monto ) local dinerojugador = getPlayerMoney(thePlayer) local recibidor = getPlayerFromName ( destplayer ) if dinerojugador > monto then takePlayerMoney ( thePlayer, tonumber(monto) ) givePlayerMoney ( recibidor, tonumber(monto) ) end end addCommandHandler ( "dar", dardinero ) but it not work if anyone can help me very much thanks Ingame Nick [BOSS]Samt2497
lil Toady Posted March 17, 2010 Posted March 17, 2010 if dinerojugador > monto then comparing number to a string there, need to tonumber() the 'monto'. And are the take/givePlayerMoney functions defined? Use debugscript to see your errors Do not PM me, im not going to read it anyway.
50p Posted March 17, 2010 Posted March 17, 2010 if dinerojugador > monto then comparing number to a string there, need to tonumber() the 'monto'. And are the take/givePlayerMoney functions defined? Use debugscript to see your errors What do you mean defined? They are native MTA functions... - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now