Jump to content

Need checking


damnet007

Recommended Posts

Posted

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

Posted (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 by Guest

Do not PM me, im not going to read it anyway.

Posted

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
 }
}

Do not PM me, im not going to read it anyway.

Posted

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

68.230.33.48:2005.png

Vital's RPG Server Is No More!

  • Recently Browsing   0 members

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