[Need help with] Automatic Gate
#1

Does anybody why it gives these Errors?

ERRORS:
Code:
(329) : error 017: undefined symbol "playerid"
(337) : error 017: undefined symbol "playerid"
Code:
pawn Code:
public CheckGate()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerToPoint(10.0, i, 1543.379150, -1627.431763, 16.002745) && OpenGate[i] == 0)
{
if(gTeam[playerid] == 4) //>>>>ERROR 1<<<<
{
MoveObject(P_gate, 1543.041870, -1621.382202, 15.827747,5.00);
OpenGate[i] = 1;
}
}
else if(!PlayerToPoint(10.0, i, 1543.379150, -1627.431763, 16.002745) && OpenGate[i] == 1)
{
if(gTeam[playerid] == 4)//>>>>ERROR 1<<<<
{
MoveObject(P_gate, 1543.041870, -1621.382202, 15.827747,5.00);
OpenGate[i] = 0;
}
}
}
}
Does anybody know??
Reply
#2

try this
pawn Code:
public CheckGate()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerToPoint(10.0, i, 1543.379150, -1627.431763, 16.002745) && OpenGate == 0)
{
if(gTeam[i] == 4) //>>>>ERROR 1<<<<
{
MoveObject(P_gate, 1543.041870, -1621.382202, 15.827747,5.00);
OpenGate = 1;
}
}
else if(!PlayerToPoint(10.0, i, 1543.379150, -1627.431763, 16.002745) && OpenGate == 1)
{
if(gTeam[i] == 4)//>>>>ERROR 1<<<<
{
MoveObject(P_gate, 1543.041870, -1621.382202, 15.827747,5.00);
OpenGate = 0;
}
}
}
}
Reply
#3

It gives no errors anymore!

Thank you!

Next Problem:


__________________________________________________ ____________________________________

__________________________________________________ ____________________________________

__________________________________________________ ____________________________________


Does not open.........
Reply
#4

Why he doesn't open??
Reply
#5

Hello

Does anybody know why he does not open?

Please help me.
Reply
#6

Make sure CheckGate() is being called at regular intervals.
Reply
#7

Are you from the Netherlands,

I don't know what "regular intervals" are...

(regelmatige tussenpozen... dunno)

Reply
#8


Hello, is because you have 2 objects, but the script review
Reply
#9

No, it's just one object.

Why it does not open
Can anyone make it good?
pawn Code:
P_gate = CreateObject(971, 1543.379150, -1627.431763, 16.002745, 0.0000, 0.0000, 268.2811); /*GATE*/
pawn Code:
1543.379150, -1627.431763, 16.002745 /*GATE Closed*/
1543.041870, -1621.382202, 15.827747 /*GATE Open*/
Please help me?
Reply
#10

Use a timer;

pawn Code:
SetTimer("CheckGate", 1000, true);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)