SA-MP Forums Archive
2 errors - 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: 2 errors (/showthread.php?tid=262667)



2 errors - flashsnake - 18.06.2011

When I add this
pawn Код:
{ // ERROR LINE 153
    SetPlayerTeamFromClass(playerid, classid);
    return 1; // ERROR LINE 155
}
Under
pawn Код:
public OnPlayerRequestClass(playerid, classid)
I get errors like
pawn Код:
C:\Documents and Settings\-----\PA51.pwn(153) : error 055: start of function body without function header
C:\Documents and Settings\dell\-----\PA51.pwn(155) : error 010: invalid function or declaration



Re: 2 errors - flashsnake - 19.06.2011

Bump


Re: 2 errors - Wesley221 - 19.06.2011

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 0: gTeam[playerid] = Class1;
        case 1: gTeam[playerid] = Class2;
    }
}
Do not put this inside any callback ( { } 's)
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
    case 0: // Change everything to your needs
    {
        SetPlayerTeamFromClass(playerid, classid);
        SetPlayerInterior(playerid,17);
        SetPlayerPos(playerid,486.0409, -9.4562, 1000.6719);
        SetPlayerFacingAngle(playerid, 137.9666);
        SetPlayerCameraPos(playerid, 483.809051, -13.435981, 1000.679687);
        SetPlayerCameraLookAt(playerid, 486.0409, -9.4562, 1000.6719);
        GameTextForPlayer(playerid, "Class 1", 1000, 3);
    }
    case 1:
    {
        SetPlayerTeamFromClass(playerid, classid);
        SetPlayerInterior(playerid,17);
        SetPlayerPos(playerid,486.0409, -9.4562, 1000.6719);
        SetPlayerFacingAngle(playerid, 137.9666);
        SetPlayerCameraPos(playerid, 483.809051, -13.435981, 1000.679687);
        SetPlayerCameraLookAt(playerid, 486.0409, -9.4562, 1000.6719);
        GameTextForPlayer(playerid, "Class 2", 1000, 3);
    }
    }
    return 1;
}