damnet007 Posted November 21, 2005 Share Posted November 21, 2005 alias rpg.give { var %a = $iif($4 == $null,$2,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4))) if %a != -1 && %a != $2 { if $5 && $5 isnum && $5 > 0 { mta.say $1 $mta.name($1,$2) gave $chr(36) $+ $5 to $mta.name($1,%a) !writeini -n "rpg.ini" $mta.name($1,%a) cash $calc($rpg.cash($1,%a) + $5) !writeini -n "rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) - $5) } else mta.say $1 Syntax: !give } else mta.msg $1 $2 Cannot give urself/invalid person money Wondering if some1 could plz tell me how to make it so that people cant give cash to others if they have too little cash, as its currently leaving people with minus cash, eg cash: -100. thanx Link to comment
lil Toady Posted November 22, 2005 Share Posted November 22, 2005 (edited) alias rpg.give { var %a = $iif($4 == $null,$2,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4))) if %a != -1 && %a != $2 { if (($5) && ($5 isnum) && ($5 > 0)) { if ($readini(rpg.ini,$mta.name($1,$2),cash) >= $5) { mta.say $1 $mta.name($1,$2) gave $chr(36) $+ $5 to $mta.name($1,%a) !writeini -n "rpg.ini" $mta.name($1,%a) cash $calc($rpg.cash($1,%a) + $5) !writeini -n "rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) - $5) } else mta.msg $1 $2 Error - You have not enough cash! } else mta.say $1 Syntax: !give } else mta.msg $1 $2 Cannot give urself/invalid person money } Edited November 22, 2005 by Guest Link to comment
damnet007 Posted November 22, 2005 Author Share Posted November 22, 2005 thanx but i just tried yours and it still hasnt sorted it any ideas? Link to comment
lil Toady Posted November 23, 2005 Share Posted November 23, 2005 try puting in commands on *:SIGNAL:mta.command:{ if ($3 == !give) { var %a = $iif($4 == $null,$2,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4))) if %a != -1 && %a != $2 { if (($5) && ($5 isnum) && ($5 > 0)) { if ($readini(rpg.ini,$mta.name($1,$2),cash) >= $5) { mta.say $1 $mta.name($1,$2) gave $chr(36) $+ $5 to $mta.name($1,%a) !writeini -n "rpg.ini" $mta.name($1,%a) cash $calc($rpg.cash($1,%a) + $5) !writeini -n "rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) - $5) } else mta.msg $1 $2 Error - You have not enough cash! } else mta.say $1 Syntax: !give } else mta.msg $1 $2 Cannot give urself/invalid person money } } Link to comment
damnet007 Posted November 23, 2005 Author Share Posted November 23, 2005 thanx m8 problem sorted Link to comment
Vital Posted November 26, 2005 Share Posted November 26, 2005 hey umm can some1 help me with this one i am having problems it keeps saying invalid money or not enough???? how can i fix this? alias rpg.give { var %a = $iif($4 == $null,$2,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4))) if %a != -1 && %a != $2 { if $5 && $5 isnum && $5 > 0 { mta.say $1 $mta.name($1,$2) gave $chr(36) $+ $5 to $mta.name($1,%a) !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,%a) cash $calc($rpg.cash($1,%a) + $5) !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) cash $calc($rpg.cash($1,$2) - $5) } else mta.say $1 Syntax: !give } else mta.msg $1 $2 Cannot give urself/invalid person money } thxs Link to comment
Recommended Posts