SA-MP Forums Archive
[killerid]; 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [killerid]; error? (/showthread.php?tid=106565)



[killerid]; error? - HydraX - 04.11.2009

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.



Re: [killerid]; error? - retart441 - 04.11.2009

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


Re: [killerid]; error? - _Vortex - 04.11.2009

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.


Re: [killerid]; error? - HydraX - 04.11.2009

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?


Re: [killerid]; error? - retart441 - 04.11.2009

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


Re: [killerid]; error? - dice7 - 04.11.2009

Just change it to MAX_PLAYERS


Re: [killerid]; error? - knopke - 04.11.2009

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


Re: [killerid]; error? - HydraX - 04.11.2009

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