Help this error - 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: Help this error (
/showthread.php?tid=397475)
Help this error -
RenovanZ - 05.12.2012
Hi, I got this error on my script:
Код:
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(53539) : error 012: invalid function call, not a valid address
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(53539) : warning 215: expression has no effect
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(53539) : error 001: expected token: ";", but found ")"
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(53539) : error 029: invalid expression, assumed zero
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(53539) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
and the line is
pawn Код:
if(gPlayerLogged(i) && PlayerInfo[i][BizID] != 0)
I don't know how to fix it, help please
Re: Help this error -
LarzI - 05.12.2012
Ignore this reply - I'm retarded for not seeing the error.
Read to Dwane's reply
Re: Help this error -
Konstantinos - 05.12.2012
Are you using
gPlayerLogged as a function or variable?
pawn Код:
// function:
gPlayerLogged(playerid)
{
// code;
}
// which is..
if(gPlayerLogged(i) && PlayerInfo[i][BizID] != 0)
// --
// variable:
new
gPlayerLogged[ MAX_PLAYERS ]
;
// which is..
if(gPlayerLogged[i] && PlayerInfo[i][BizID] != 0)
Re: Help this error -
RenovanZ - 05.12.2012
Wrong.
Re: Help this error -
Konstantinos - 05.12.2012
Quote:
Originally Posted by LarzI
Show us the line above the error line.
|
He did on his first post.
Quote:
Originally Posted by Kiyozi_Mu
This code that latest i added to my script:
pawn Код:
foreach(Player, i) { if(gPlayerLogged(i) && PlayerInfo[i][BizID] != 0) { PlayerInfo[i][BizID] = 0; format(string, sizeof(string), " Administrator %s has sold your business.", playername); SendClientMessage(i, COLOR_WHITE, string); } }
|
Read my post and tell me if it is variable, because if it is, you have to use
[i] instead of
(i).
Re: Help this error -
RenovanZ - 05.12.2012
Quote:
Originally Posted by Dwane
Are you using gPlayerLogged as a function or variable?
pawn Код:
// function: gPlayerLogged(playerid) { // code; }
// which is.. if(gPlayerLogged(i) && PlayerInfo[i][BizID] != 0)
// --
// variable: new gPlayerLogged[ MAX_PLAYERS ] ; // which is.. if(gPlayerLogged[i] && PlayerInfo[i][BizID] != 0)
|
I use it as variable, then how is the PlayerInfo[i][BizID] != 0) ?
Re: Help this error -
Konstantinos - 05.12.2012
Alright, because it's defined as a variable, you should change it to
pawn Код:
if(gPlayerLogged[i] && PlayerInfo[i][BizID] != 0)
I didn't understand your question about the
PlayerInfo[i][BizID] != 0).
Re: Help this error -
LarzI - 05.12.2012
Quote:
Originally Posted by Dwane
He did on his first post.
|
Actually no, he didn't show the line ABOVE the error-line, but it doesn't matter as the error is obviously because he used parentheses instead of square brackets.
Re: Help this error -
RenovanZ - 05.12.2012
Quote:
Originally Posted by Dwane
He did on his first post.Read my post and tell me if it is variable, because if it is, you have to use [i] instead of (i).
|
Thanks! I'm not seeing it
Re: Help this error -
park4bmx - 05.12.2012
If
gPlayeralogged is a variable the where is the check ? You cannot use it as a function!
pawn Код:
if(gPlayerLogged[i] == 1&& PlayerInfo[i][BizID] != 0)
If its a stock you
can
pawn Код:
stock IsgPlayerLogged(playerid)
{
if(some_variable) == 1 return 1;
return 0;
}
Then you check it with the "()" method !