SA-MP Forums Archive
[Need help with] Automatic Gate - 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: [Need help with] Automatic Gate (/showthread.php?tid=93301)



[Need help with] Automatic Gate - CAR - 24.08.2009

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??


Re: [Need help with] Automatic Gate - James_Alex - 24.08.2009

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



Re: [Need help with] Automatic Gate - CAR - 24.08.2009

It gives no errors anymore!

Thank you!

Next Problem:


__________________________________________________ ____________________________________

__________________________________________________ ____________________________________

__________________________________________________ ____________________________________


Does not open.........


Re: [Need help with] Automatic Gate - CAR - 24.08.2009

Why he doesn't open??


Re: [Need help with] Automatic Gate - CAR - 24.08.2009

Hello

Does anybody know why he does not open?

Please help me.



Re: [Need help with] Automatic Gate - Marcus09 - 24.08.2009

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


Re: [Need help with] Automatic Gate - CAR - 24.08.2009

Are you from the Netherlands,

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

(regelmatige tussenpozen... dunno)




Re: [Need help with] Automatic Gate - Javi_Cogollero - 24.08.2009


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


Re: [Need help with] Automatic Gate - CAR - 25.08.2009

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?


Re: [Need help with] Automatic Gate - SpiderPork - 25.08.2009

Use a timer;

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