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



Gates - dafel2 - 12.07.2009

Код:
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?


Re: Gates - MarqueZ92 - 12.07.2009

Are you sure that you defined "TEAM_COP" ?


Re: Gates - dafel2 - 12.07.2009

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

Код:
#define TEAM_COP



Re: Gates - ledzep - 12.07.2009

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



Re: Gates - SiJ - 12.07.2009

Do you have
static gTeam[MAX_PLAYERS];
?


Re: Gates - dafel2 - 12.07.2009

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

Don


Re: Gates - ledzep - 12.07.2009

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

Don
Yeah, it happens lol.


Re: Gates - dafel2 - 12.07.2009

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.


Re: Gates - ledzep - 12.07.2009

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)



Re: Gates - dafel2 - 12.07.2009

Thanks now it works