Help plaese - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help plaese (
/showthread.php?tid=172307)
Help plaese -
bartje01 - 29.08.2010
Hey guys. Ive got something weird.
This is from my /deposit command:
pawn Код:
if(dialogid == 101){
new ammount = strval(inputtext);
if(response){
if(GetPlayerMoney(playerid >= ammount))
{
bank[playerid] += ammount;
GivePlayerMoney(playerid, -ammount);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Je hebt niet genoeg geld!");
}
}
}
But when I have 150 money I can just deposit 10000. money. My money will just go down to red.
Please help
Re: Help plaese -
Backwardsman97 - 29.08.2010
Try it now.
pawn Код:
if(dialogid == 101)
{
new ammount = strval(inputtext);
if(response)
{
if(GetPlayerMoney(playerid) >= ammount)
{
bank[playerid] += ammount;
GivePlayerMoney(playerid, -ammount);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"Je hebt niet genoeg geld!");
return 1;
}
}
}
Re: Help plaese -
bartje01 - 29.08.2010
Yea thanks. Lol I see what I've done wrong. I didn't stop the command with return 1; xD
Re: Help plaese -
Backwardsman97 - 30.08.2010
No, that wasn't it. The return 1's didn't really do anything except make it not check past that for more code. The problem was this line.
pawn Код:
if(GetPlayerMoney(playerid >= ammount))
pawn Код:
if(GetPlayerMoney(playerid) >= ammount))
See?