SA-MP Forums Archive
Some errors.. - 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: Some errors.. (/showthread.php?tid=170325)



Some errors.. - willsuckformoney - 22.08.2010

Код:
warning 219: local variable "GetPlayerWeedAmount" shadows a variable at a preceding level
error 001: expected token: ";", but found "("
warning 215: expression has no effect
error 012: invalid function call, not a valid address
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Those Lines are

pawn Код:
new amount = GetPlayerMoney(playerid), GetPlayerWeedAmount(playerid), GetPlayerHeroineAmount(playerid);
//^^ was 4912

//This is 4917
if((amount) >= GetPlayerMoney(playerid), GetPlayerWeedAmount(playerid), GetPlayerHeroineAmount(playerid))
Anyone know why I get these errors?


Re: Some errors.. - iggy1 - 22.08.2010

What are you trying to do here?
pawn Код:
if((amount) >= GetPlayerMoney(playerid), GetPlayerWeedAmount(playerid), GetPlayerHeroineAmount(playerid))



Re: Some errors.. - willsuckformoney - 22.08.2010

argh see if someone who wants to add something to a storage it detects if they are trying to put less or more than they have...


Re: Some errors.. - iggy1 - 22.08.2010

First off 'amount ' can only hold one value so

pawn Код:
new amount = GetPlayerMoney(playerid);//is all u can do wth an int
second 'if' should look like this,

pawn Код:
if(amount >= GetPlayerMoney(playerid) || amount >= GetPlayerWeedAmount(playerid))//or simalar
If amount isn't global the first check amount >= GetPlayerMoney(playerid) would be pointless as we know it holds the players money in this example.