[killerid]; error?
#1

pawn Код:
new armyscore = 0;
new terrscore = 0;
new indm[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
    if(indm[playerid]==1)
    {
    if(Team[killerid] == army)     // this is line 189, Where the error is...
    {
        if(Team[playerid] == terr)   // so if he kills a member of the terr team then his score is raised
        {
                armyscore++;
                SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
            }
            else if(Team[playerid] == army) // but if he kills a player fo his own team his score is reduced and he is killed
            {
                GameTextForPlayer(killerid, "Friendly Fire Will Not Be Tolerated", 3000, 4);
                GivePlayerMoney(killerid, -100);
                SetPlayerHealth(killerid, 0.0);
                SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
            }
    }
    if(Team[killerid] == terr)
    {
        if(Team[playerid] == army)
        {
                terrscore++;
                SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
            }
            else if(Team[playerid] == terr)
            {
                GameTextForPlayer(killerid, "Friendly Fire Will Not Be Tolerated", 3000, 4);
                GivePlayerMoney(killerid, -100);
                SetPlayerHealth(killerid, 0.0);
                SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
            }
    }
    }
    return 1;
}
pawn Код:
C:\Users\Stunt Paradise\Desktop\samp03asvr_R3_win32\gamemodes\heist.pwn(189) : error 017: undefined symbol "Team"
C:\Users\Stunt Paradise\Desktop\samp03asvr_R3_win32\gamemodes\heist.pwn(189) : warning 215: expression has no effect
C:\Users\Stunt Paradise\Desktop\samp03asvr_R3_win32\gamemodes\heist.pwn(189) : error 001: expected token: ";", but found "]"
C:\Users\Stunt Paradise\Desktop\samp03asvr_R3_win32\gamemodes\heist.pwn(189) : error 029: invalid expression, assumed zero
C:\Users\Stunt Paradise\Desktop\samp03asvr_R3_win32\gamemodes\heist.pwn(189) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

Its weird that Team is undefined yet only 1 error comes up when it is used 3 times.
Reply
#3

do you have
Код:
new Team[MAX_PLAYERS];
?

Quote:
Originally Posted by retart441
Its weird that Team is undefined yet only 1 error comes up when it is used 3 times.
That's because there's too many errors on that one line, therefore it's not gona show the same errors over and over again, I know because it's happened to me.
Reply
#4

Quote:
Originally Posted by [B
Vortex ]
do you have
Код:
new Team[MAX_PLAYERS];
?

Quote:
Originally Posted by retart441
Its weird that Team is undefined yet only 1 error comes up when it is used 3 times.
That's because there's too many errors on that one line, therefore it's not gona show the same errors over and over again, I know because it's happened to me.
No but when i add it i get these errors

pawn Код:
C:\Users\Stunt Paradise\Desktop\samp03asvr_R3_win32\gamemodes\heist.pwn(340) : error 017: undefined symbol "MAX_SERVER_PLAYERS"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


10 Errors.
pawn Код:
for(new i = 0; i < MAX_SERVER_PLAYERS; i++) //change MAX_SERVER_PLAYERS to the maximum player slots you have on ur server
    {
        if(indm[i]==1)
        {
            TextDrawShowForPlayer(i, scoretext);
        }
    }
}
Do i need to define it? Or can i put the max numbers from server.cfg?
Reply
#5

Код:
new MAX_SERVER_PLAYERS[MAX_PLAYERS];
That Right?
Reply
#6

Just change it to MAX_PLAYERS
Reply
#7

and u can write:
new Team[MAX_PLAYERS]
for(new i;i<MAX_PLAYERS; i++)
Reply
#8

Quote:
Originally Posted by dice7
Just change it to MAX_PLAYERS
I will use TextdrawShowForAll instead of all that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)