Automatic Gates To Team
#1

hey all today i have a stupid problem im trying to do gates to one team and i use this

public CheckGate()
{
for(new i = 0; i < GetMaxPlayers(); i++)
if (gTeam[playerid] == TEAM_COP)
{
if(PlayerToPoint(10.0, playerid, 1937.5629882813, 2152.091796875, 11.5703125) && OpenGate[i] == 0)
{
MoveObject(c_gate, 1937.5629882813, 2152.091796875, -11.5703125, 1);
OpenGate[i] = 1;
}
else if(!PlayerToPoint(10.0, playerid, 1937.5629882813, 2152.091796875, 11.5703125) && OpenGate[i] == 1)
{
MoveObject(c_gate, 1937.5629882813, 2152.091796875, 11.5703125, 1);
OpenGate[i] = 0;
}
}
}


but when i put copiling its says this errors
C:\Users\D4RK_T34M\Desktop\Gates.pwn(2046) : error 017: undefined symbol "playerid"
C:\Users\D4RK_T34M\Desktop\Gates.pwn(204 : error 017: undefined symbol "playerid"
C:\Users\D4RK_T34M\Desktop|Gates.pwn(2053) : error 017: undefined symbol "playerid"

dont worry about the lines bcs i have more things
Reply
#2

Use 'i' instead of 'playerid'.
Reply
#3

erm it work but now dont open for the team (never opened)
Reply
#4

pawn Код:
public CheckGate()
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  if (gTeam[i] == TEAM_COP)
  {
    if(PlayerToPoint(10.0, i, 1937.5629882813, 2152.091796875, 11.5703125) && OpenGate == 0)
    {
      MoveObject(c_gate, 1937.5629882813, 2152.091796875, -11.5703125, 1);
      OpenGate = 1;
    }
    else if(!PlayerToPoint(10.0, i, 1937.5629882813, 2152.091796875, 11.5703125) && OpenGate == 1)
    {
      MoveObject(c_gate, 1937.5629882813, 2152.091796875, 11.5703125, 1);
      OpenGate = 0;
    }
  }
}
Reply
#5

i copied from here https://sampwiki.blast.hk/wiki/Automatic_Gates
Reply
#6

Quote:
Originally Posted by Don Correlli
Use 'i' instead of 'playerid'.
unnecessary "i" after all possible and "o" and "u" and "oiu"

it is necessary to use for


Sorry for my bad english
Reply
#7

so i need to do this??: for(new o = 0; o < GetMaxPlayers(); i++)
Reply
#8

Quote:
Originally Posted by DizeL-ZR
Quote:
Originally Posted by Don Correlli
Use 'i' instead of 'playerid'.
unnecessary "i" after all possible and "o" and "u" and "oiu"

it is necessary to use for

Sorry for my bad english
Check his first post before you post anything else.

Quote:
Originally Posted by Voute_Foder
so i need to do this??: for(new o = 0; o < GetMaxPlayers(); i++)
No, you defined 'i' as players loop, so use 'i' instead of 'playerid'.
Reply
#9

ok but i have the automatic gate in one FS and the Teams in one GM and i to go to team i only have this:
Having one Fs with the gates and one GM with teams create problems?

AddPlayerClassEx(2, 98, 2167.8, 1682.5, 10.8, 179.1425, 0, 0, 0, 0, 0, 0);
#define TEAM_COP 2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)