SA-MP Forums Archive
Teams, 4 errors 1 warning - 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: Teams, 4 errors 1 warning (/showthread.php?tid=262617)



Teams, 4 errors 1 warning - flashsnake - 18.06.2011

Hi, I am trying to make teams, I looked up another script and copyed to mine, now this happens:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    gPlayerClass[playerid] = classid; //  THIS IS ERROR LINE 69; THIS IS ERROR LINE 69; THIS IS ERROR LINE 69;

    switch (classid) {

        case 0:

            {
                gTeam[playerid] = TEAM_ARMY;
                GameTextForPlayer(playerid, "~p~Army", 1000, 6);
                ApplyAnimation(playerid,"PED","strip_G",4.1,1,1,1,1,1);

            }

        case 1:

            {
                gTeam[playerid] = TEAM_TERRORISTS;
                GameTextForPlayer(playerid, "~b~Terrorists", 1000, 6);
                ApplyAnimation(playerid,"PED","strip_G",4.1,1,1,1,1,1);
            }
    }
    SetPlayerPos(playerid, 2524.2695,-1696.2926,18.2204);
    SetPlayerFacingAngle( playerid, 2.3616 );
    SetPlayerCameraPos(playerid, 2523.7749,-1692.6855,18.9011);
    SetPlayerCameraLookAt(playerid, 2524.2695,-1696.2926,18.2204);
    return 1;
}
And errors:


pawn Код:
C:\Documents and Settings\---------------------\PA51.pwn(69) : error 017: undefined symbol "gPlayerClass"
C:\Documents and Settings\---------------------PA51.pwn(69) : warning 215: expression has no effect
C:\Documents and Settings\---------------------\PA51.pwn(69) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\---------------------\PA51.pwn(69) : error 029: invalid expression, assumed zero
C:\Documents and Settings\---------------------\PA51.pwn(69) : 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: Teams, 4 errors 1 warning - flashsnake - 18.06.2011

Oh now when I removed " [ ] " and replaced with " ( ) " I got only 1 error and warning,

pawn Код:
C:\Documents and Settings\-------------------\PA51.pwn(69) : error 017: undefined symbol "gPlayerClass"
C:\Documents and Settings\\-------------------\PA51.pwn(69) : warning 215: expression has no effect



Re: Teams, 4 errors 1 warning - flashsnake - 18.06.2011

FIXED!! FIGURED IT OUT MYSELF!?!?!?


Re: Teams, 4 errors 1 warning - Sil3nc3 - 18.06.2011

you just had to define gPlayerClass I believe