#1

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;
}

Reply
#2

new gPlayerClass[MAX_PLAYERS];
Reply
#3

still same errors
Reply
#4

anyone?
Reply
#5

bump....
Reply
#6

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
Reply
#7

You have to define gPlayerClass

gPlayerClass[playerid] = classid );

^^ Then try adding that.
Reply
#8

Код:
#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_..
Reply
#9

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.

Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)