Jump to content

Stop It From Going Negative?


Guest Avenge

Recommended Posts

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
}

how can i stop this from going negative?

Link to comment
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 => $rpg.cash($1,$2) {
     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
}

Link to comment

how can i stop this from going negative ?

          elseif ($3 == !smoke) {
             mta.msg $1 $2 You Have Smoked One Of Your Drugs!
               !writeini -n " $+ $rpg.dir $+ rpg.ini" $mta.name($1,$2) drug $calc($rpg.drug($1,$2) - 1)
               !.timer 1 0 mta.slap $1 $2
            }
        }

thxs

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...