#1

Код:
if (strcmp("/olvpd1", cmdtext, true) == 0)

  {
  if(gTeam[playerid] == TEAM_COP)//ALL ERRORS
{
		MoveObject(lvpd1, 2237.414,2457.107,9.840, 5); //-- LV --
		SendClientMessage(playerid, COLOR_BLUE, "LVPD Gate Opened !");
}
		return 1;
  }
  }
ERRORS:
Код:
 : 
error 017: undefined symbol "gTeam"
warning 215: expression has no effect
 error 001: expected token: ";", but found "]"
 error 029: invalid expression, assumed zero
 fatal error 107: too many error messages on one line
Whats the matter?
Reply
#2

Are you sure that you defined "TEAM_COP" ?
Reply
#3

Quote:
Originally Posted by MarqueZ92
Are you sure that you defined "TEAM_COP" ?
Yes i have defined

Код:
#define TEAM_COP
Reply
#4

1. Apparently you have no gTeam variable, therefore you cannot use it
2. You have an extra bracket
3. Your indenting is horrible (which is most likely the cause of 2.)

pawn Код:
new gTeam[MAX_PLAYERS];
pawn Код:
if(strcmp("/olvpd1", cmdtext, true) == 0)
{
  if(gTeam[playerid] == TEAM_COP)//ALL ERRORS
  {
    MoveObject(lvpd1, 2237.414,2457.107,9.840, 5); //-- LV --
    SendClientMessage(playerid, COLOR_BLUE, "LVPD Gate Opened !");
  }
  return 1;
}
Reply
#5

Do you have
static gTeam[MAX_PLAYERS];
?
Reply
#6

Thanks Ledzep it worked!
I think that bracket was a typo

Don
Reply
#7

Quote:
Originally Posted by Don_Lake
Thanks Ledzep it worked!
I think that bracket was a typo

Don
Yeah, it happens lol.
Reply
#8

Tested ingame - it doesnt work even for cops

The cop skin is first one

COp team code
Код:
SetPlayerClass(playerid, classid)
{
 switch(classid) {
 case 0: {
 PlayerInfo[playerid][team] = TEAM_COP;
 }
I think something wrong here.
Reply
#9

You used gTeam to determine what team the player was on.

pawn Код:
gTeam[playerid] = TEAM_COP;
or change

pawn Код:
if(gTeam[playerid] == TEAM_COP)
to

pawn Код:
if(PlayerInfo[playerid][team] == TEAM_COP)
Reply
#10

Thanks now it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)