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



Help - GOSIMP - 09.07.2010

I made a new TDM script and i get this error while compiling

Quote:

C:\Users\Adrian\Desktop\SAMP SERVER\gamemodes\TDM 0.1.pwn(59) : error 017: undefined symbol "gPlayerClass"
C:\Users\Adrian\Desktop\SAMP SERVER\gamemodes\TDM 0.1.pwn(59) : warning 215: expression has no effect
C:\Users\Adrian\Desktop\SAMP SERVER\gamemodes\TDM 0.1.pwn(59) : error 001: expected token: ";", but found "]"
C:\Users\Adrian\Desktop\SAMP SERVER\gamemodes\TDM 0.1.pwn(59) : error 029: invalid expression, assumed zero
C:\Users\Adrian\Desktop\SAMP SERVER\gamemodes\TDM 0.1.pwn(59) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Somebody Please fix this Thank you

Quote:

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
gPlayerClass[playerid] = classid; // PROBLEM IS HERE <<<<<<<<< LINE 59

switch (classid) {

case 0: //Case 0 the character we added before the first one.

{
gTeam[playerid] = TEAM_POLICE;
GameTextForPlayer(playerid, "~b~Police", 1000, 6); r (Green).

}
case 1: //Case 1 the character we added before the second.

{
gTeam[playerid] = TEAM_ROBBER;
GameTextForPlayer(playerid, "~r~Robber", 1000, 6);
}
}
//Spawn positions the players will see to spawn.
SetPlayerPos(playerid, 489.8416,-72.4437,999.2266);
SetPlayerFacingAngle( playerid, 2.3616 );
SetPlayerCameraPos(playerid, 491.6849,-72.3607,999.2117);
SetPlayerCameraLookAt(playerid, 489.8416,-72.4437,999.2266);
SetPlayerInterior(playerid ,11);
return 1;
}




Re: Help - Kar - 09.07.2010

new gPlayerClass[MAX_PLAYERS];


Re: Help - GOSIMP - 09.07.2010

still same errors


Re: Help - GOSIMP - 09.07.2010

anyone?


Re: Help - GOSIMP - 09.07.2010

bump....


Re: Help - cessil - 09.07.2010

put new gPlayerClass[MAX_PLAYERS]; at the top of your script, then try compiling gPlayerClass will be defined so you won't get that error.
If you do then you've done something wrong and should learn some more pawn before dismissing other peoples help


Re: Help - Dennis - 09.07.2010

You have to define gPlayerClass

gPlayerClass[playerid] = classid );

^^ Then try adding that.


Re: Help - DarkClone - 09.07.2010

Код:
#include <a_samp>

new gPlayerClass[MAX_PLAYERS];
new gTeam[MAX_PLAYERS];

// Team defines
#define TEAM_POLICE
#define TEAM_ROBBER


public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    gPlayerClass[playerid] = classid; // PROBLEM IS HERE <<<<<<<<< LINE 59
    switch (classid) {
    case 0: //Case 0 the character we added before the first one.
    {
    gTeam[playerid] = TEAM_POLICE
    GameTextForPlayer(playerid, "~b~Police", 1000, 6);
    }
    case 1: //Case 1 the character we added before the second.
    {
    gTeam[playerid] = TEAM_ROBBER
    GameTextForPlayer(playerid, "~r~Robber", 1000, 6);
    }
    }
    //Spawn positions the players will see to spawn.
    SetPlayerPos(playerid, 489.8416,-72.4437,999.2266);
    SetPlayerFacingAngle( playerid, 2.3616 );
    SetPlayerCameraPos(playerid, 491.6849,-72.3607,999.2117);
    SetPlayerCameraLookAt(playerid, 489.8416,-72.4437,999.2266);
    SetPlayerInterior(playerid ,11);
    return 1;
}
I think this works..i didn't get any errors

You needed to define the teams, gPlayerclass gTeam and remove the ; at the = TEAM_..


Re: Help - GOSIMP - 09.07.2010

now i get 3 new errors

Quote:

C:\Users\Adrian\Desktop\SAMP SERVER\gamemodes\TDM 0.2.pwn(37) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Adrian\Desktop\SAMP SERVER\gamemodes\TDM 0.2.pwn(67) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Adrian\Desktop\SAMP SERVER\gamemodes\TDM 0.2.pwn(71) : error 017: undefined symbol "TEAM_ROBBER"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.




Re: Help - aNdReSk - 09.07.2010

where it says

gTeam[playerid] = TEAM_POLICE


it's missing a ;


same where it says

gTeam[playerid] = TEAM_ROBBER



btw shouldnt the defines have a number? like

// Team defines
#define TEAM_POLICE 1
#define TEAM_ROBBER 2