SA-MP Forums Archive
getplayermoney < "variable" - 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)
+--- Thread: getplayermoney < "variable" (/showthread.php?tid=502840)



getplayermoney < "variable" - Extraordinariness - 26.03.2014

pawn Код:
CMD:deposit(playerid, params[])
{
    new money;
    if(sscanf(params, "d", money)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /deposit [money]");
    if(GetPlayerMoney(playerid) < money)); {
    SendClientMessage(playerid, 0xFF0000FF, "ERROR: You have not enough money on your pocket to put in your bank!");
    }
    PlayerInfo[playerid][pBankmoney] += money;
    GivePlayerMoney(playerid, -money);
    return 1;
}
Errors:
Код:
C:\Documents and Settings\eros\Desktop\SAMP Server\filterscripts\afs.pwn(1225) : error 029: invalid expression, assumed zero
C:\Documents and Settings\eros\Desktop\SAMP Server\filterscripts\afs.pwn(1225) : warning 215: expression has no effect
NOTE: Not whole script yet.


Re: getplayermoney < "variable" - Vince - 26.03.2014

If-statements are never followed by a semicolon. You also have an extra closing bracket.


Re: getplayermoney < "variable" - Extraordinariness - 26.03.2014

Thanks for replying. Now new code:
pawn Код:
if(GetPlayerMoney(playerid) < money)) SendClientMessage(playerid, 0xFF0000FF, "ERROR: You have not enough money on your pocket to put in your bank!");
New error:
Код:
C:\Documents and Settings\eros\Desktop\SAMP Server\filterscripts\afs.pwn(1225) : error 029: invalid expression, assumed zero



Re: getplayermoney < "variable" - newbienoob - 26.03.2014

Quote:
Originally Posted by Vince
Посмотреть сообщение
You also have an extra closing bracket.
4char


Re: getplayermoney < "variable" - Extraordinariness - 26.03.2014

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
4char
I have removed it already.


Re: getplayermoney < "variable" - newbienoob - 26.03.2014

no you didnt. there are 2 opening brackets ( ( ) and 3 closing brackets ( ) )
if(GetPlayerMoney(playerid) < money))


Re: getplayermoney < "variable" - Extraordinariness - 26.03.2014

oh okay. didn't notice that looool. I thought this " { " bracket.

thanks