paddy1180 Posted July 6, 2006 Share Posted July 6, 2006 i know i have been posting loads of topics latly but i am trying to learn how to script and i made this basic code on *:SIGNAL:mta.command:{ if ($3 == !cars){ if ($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars)!= $null){ mta.msg $1 $2 You have no cars ! } else mta.msg You own car/s } } i dont know whats wrong with this but it dosnt work i want it to tell people how many cars they own Link to comment
lil Toady Posted July 6, 2006 Share Posted July 6, 2006 on *:SIGNAL:lil_Toady'sHelp:{ if you have the number of cars in the ini, so on *:SIGNAL:mta.command:{ if ($3 == !cars) { if ($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars)) You own $readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars) cars else mta.msg $1 $2 You have no cars ! } } elseif you have a list of cars separated with coma, then { on *:SIGNAL:mta.command:{ if ($3 == !cars) { if ($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars)) You own $numtok($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars),1,44) cars else mta.msg $1 $2 You have no cars ! } } } elseif a list of cars separated with space, then { on *:SIGNAL:mta.command:{ if ($3 == !cars) { if ($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars)) You own $numtok($readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars),1,32) cars else mta.msg $1 $2 You have no cars ! } } } else ask again and tell me more info } Link to comment
paddy1180 Posted July 6, 2006 Author Share Posted July 6, 2006 None of them work.. the rpg.ini looks like this [{XN}Paddy]cars=2 Link to comment
lil Toady Posted July 6, 2006 Share Posted July 6, 2006 oh.. i made a 2 mistakes in all of em, change $script.dir to $rpg.dir (i think you used that) or whatever you use in your script and i forgot mta.msg just take this: on *:SIGNAL:mta.command:{ if ($3 == !cars) { if ($readini($rpg.dir $+ RPG.ini,$mta.name($1,$2),cars) >= 1) mta.msg $1 $2 You own $readini($script.dir $+ RPG.ini,$mta.name($1,$2),cars) cars else mta.msg $1 $2 You have no cars ! } } Link to comment
paddy1180 Posted July 6, 2006 Author Share Posted July 6, 2006 ty VERY VERY much it worked Fine Link to comment
Recommended Posts