• Welcome to Vice City Multiplayer.
 

Bank working weird in WSV 0.3

Started by evil_night13, October 15, 2008, 01:14:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

evil_night13

Hi,

iam using WSV 0.3, now the bank is acting totally weird, if a user goes to bank and type !deposit -999999999, the amount gets deposited to his account, he is able to withdraw by !withdraw -99999999 !

at the same time , we amount been trying to be deposited !withdraw 50000, the user get " $ withdrawn", nothing his withdrawn!

can anyone help me , i need to solve these bugs?

Punjabi

Hey try this.........Thanks to Tamas and plz search topics bcoz users had already posted this type of commands.... :P

elseif (withdraw* iswm $3) {
      WSV.cmdlevelcheck $1-
      if (El-Banco-Corrupto-Grande isin $WSV.loco($2)) {
        if ($4 <= $WSV.bank($2)) || ($4 == all) {
          if ($4 == all) var %money = $hget(WSV.Bank,$WSV.getname($2))
          if ($4 <= $WSV.money($2)) var %money = $4
          hinc WSV.money $WSV.name($2) $4
          hdec WSV.bank $WSV.name($2) $4
          WSV.setcash $2 $hget(WSV.money,$WSV.getname($2))
          WSV.msg $2 You have been withdrawed $chr(91) $ $+ $4 $chr(93) from your bank account!
          WSV.msg $2 New Balance: $chr(91) $ $+ $WSV.bank($2) $chr(93)
        }
        else WSV.msg $2 You hasn't got $chr(91) $ $+ $4 $chr(93) in you're bank account!
      }
      else WSV.msg $2 You have to be at the bank!
    }
GOD BLESS ALL..<<Founder of PUN Clan.....Born to fight and Kill..>>

evil_night13

thnkx tamas , it works! really appreciate that!  ;D

sorry for  reposting!  ::)

Tamas


evil_night13

damn the bug is still there, just a caught a member doing that!  :P

P3p3  !deposit -100
P3p3  !deposit -1000000
P3p3  !deposit -100000000
P3p3  !buyprop 1
P3p3 has bought National Bank for $1000000


pls give a strong solution for this!  ::)

VRocker

you just need to add a check to see if $4 is more than 0 before processing the rest of the command.

Example: (Taken from the code posted earlier)

elseif (withdraw* iswm $3) {
  WSV.cmdlevelcheck $1-
  if (El-Banco-Corrupto-Grande isin $WSV.loco($2)) {
    if (( $4 > 0 ) && ($4 <= $WSV.bank($2))) || ($4 == all) {
      var %money = 0
      if ($4 == all) %money = $hget(WSV.Bank,$WSV.getname($2))
      else %money = $4
      hinc WSV.money $WSV.name($2) %money
      hdec WSV.bank $WSV.name($2) %money
      WSV.setcash $2 $hget(WSV.money,$WSV.getname($2))
      WSV.msg $2 You have been withdrawed $chr(91) $ $+ %money $chr(93) from your bank account!
      WSV.msg $2 New Balance: $chr(91) $ $+ $WSV.bank($2) $chr(93)
    }
    else WSV.msg $2 You havn't got $chr(91) $ $+ $4 $chr(93) in you're bank account!
  }
  else WSV.msg $2 You have to be at the bank!
}


That should work fine


evil_night13


VRocker

Did you add the if ( $4 > 0 ) check to deposit too? Sounds like you havn't


evil_night13

#8
Quote from: VRocker on October 17, 2008, 01:50:36 PM
Did you add the if ( $4 > 0 ) check to deposit too? Sounds like you havn't

i saw that u have added that, so i used the code which u gave, do i need to add else where?

update: sorry man i forgot to change the deposit too, now both has the ($4 > 0) , so i hope i cant the bug no more :D , thnkx man!