Automatic Gates To Team -
SlashPT - 04.10.2009
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
Re: Automatic Gates To Team -
Correlli - 04.10.2009
Use 'i' instead of 'playerid'.
Re: Automatic Gates To Team -
SlashPT - 04.10.2009
erm it work but now dont open for the team (never opened)
Re: Automatic Gates To Team -
[CK]Steel - 04.10.2009
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;
}
}
}
Re: Automatic Gates To Team -
SlashPT - 04.10.2009
i copied from here
https://sampwiki.blast.hk/wiki/Automatic_Gates
Re: Automatic Gates To Team -
DizeL-ZR- - 04.10.2009
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
Re: Automatic Gates To Team -
SlashPT - 04.10.2009
so i need to do this??: for(new o = 0; o < GetMaxPlayers(); i++)
Re: Automatic Gates To Team -
Correlli - 04.10.2009
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'.
Re: Automatic Gates To Team -
SlashPT - 04.10.2009
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