Help this error
#1

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
Reply
#2

Ignore this reply - I'm retarded for not seeing the error.

Read to Dwane's reply
Reply
#3

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)
Reply
#4

Wrong.
Reply
#5

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).
Reply
#6

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) ?
Reply
#7

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).
Reply
#8

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.
Reply
#9

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
Reply
#10

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 !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)