Author Topic: Bank working weird in WSV 0.3  (Read 4974 times)

0 Members and 1 Guest are viewing this topic.

Offline evil_night13

  • Wiseguy
  • **
  • Posts: 61
  • i are a normal person like you
    • View Profile
    • web hosting
Bank working weird in WSV 0.3
« on: October 15, 2008, 03:14:55 pm »
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?

Offline Punjabi

  • Made Man
  • ***
  • Posts: 147
  • Config Editor
    • View Profile
    • PUN Clan
Re: Bank working weird in WSV 0.3
« Reply #1 on: October 15, 2008, 03:22:39 pm »
Hey try this.........Thanks to Tamas and plz search topics bcoz users had already posted this type of commands.... :P

Code: [Select]
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..>>

Offline evil_night13

  • Wiseguy
  • **
  • Posts: 61
  • i are a normal person like you
    • View Profile
    • web hosting
Re: Bank working weird in WSV 0.3
« Reply #2 on: October 15, 2008, 04:05:08 pm »
thnkx tamas , it works! really appreciate that!  ;D

sorry for  reposting!  ::)

Offline Tamas

  • Made Man
  • ***
  • Posts: 127
    • View Profile
    • http://www.tamasnet.eu/
Re: Bank working weird in WSV 0.3
« Reply #3 on: October 15, 2008, 04:18:15 pm »
Np  :)

Offline evil_night13

  • Wiseguy
  • **
  • Posts: 61
  • i are a normal person like you
    • View Profile
    • web hosting
Re: Bank working weird in WSV 0.3
« Reply #4 on: October 15, 2008, 09:30:29 pm »
damn the bug is still there, just a caught a member doing that!  :P

Code: [Select]
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!  ::)

Offline VRocker

  • LU Developer
  • Wiseguy
  • *
  • Posts: 63
    • View Profile
    • Liberty Unleashed - GTA3 Multiplayer Mod
Re: Bank working weird in WSV 0.3
« Reply #5 on: October 17, 2008, 02:19:52 pm »
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)

Code: [Select]
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


Offline evil_night13

  • Wiseguy
  • **
  • Posts: 61
  • i are a normal person like you
    • View Profile
    • web hosting
Re: Bank working weird in WSV 0.3
« Reply #6 on: October 17, 2008, 03:00:47 pm »
nah still the bug is there!  :(

Offline VRocker

  • LU Developer
  • Wiseguy
  • *
  • Posts: 63
    • View Profile
    • Liberty Unleashed - GTA3 Multiplayer Mod
Re: Bank working weird in WSV 0.3
« Reply #7 on: October 17, 2008, 03:50:36 pm »
Did you add the if ( $4 > 0 ) check to deposit too? Sounds like you havn't


Offline evil_night13

  • Wiseguy
  • **
  • Posts: 61
  • i are a normal person like you
    • View Profile
    • web hosting
Re: Bank working weird in WSV 0.3
« Reply #8 on: October 17, 2008, 03:53:10 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!
« Last Edit: October 17, 2008, 04:21:17 pm by evil_night13 »