Automatic Gate isn't working - 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)
+--- Thread: Automatic Gate isn't working (
/showthread.php?tid=283451)
Automatic Gate isn't working -
nmader - 15.09.2011
Hey, today I added a gate and I followed every little thing, now, it compiled to an .amx file and I launched the game and the gate didn't move...
If you would like to see a certain section of the script I added, just lemme know!
Re: Automatic Gate isn't working -
[HiC]TheKiller - 15.09.2011
If the gate isn't there then post the whole script. If the gate isn't moving then post the part where it checks if the player is near a gate, most probably where IsPlayerInRangeOfPoint is.
Re: Automatic Gate isn't working -
=WoR=G4M3Ov3r - 15.09.2011
Um, did you make it as a filterscript, or did you add it into your Gamemode script ?
Re: Automatic Gate isn't working -
nmader - 15.09.2011
Quote:
Originally Posted by G4M3Ov3r
Um, did you make it as a filterscript, or did you add it into your Gamemode script ?
|
Gamemode script.
Re: Automatic Gate isn't working -
RelaxCafe - 15.09.2011
Now explain how/when you want the gate to move.. Because the gate may have moved as soon as you loaded up the game..
Re: Automatic Gate isn't working -
|_ⒾⓇⓄN_ⒹⓄG_| - 15.09.2011
post the code lol
Re: Automatic Gate isn't working -
nmader - 15.09.2011
Quote:
Originally Posted by RelaxCafe
Now explain how/when you want the gate to move.. Because the gate may have moved as soon as you loaded up the game..
|
When I get so close to the gate.
Re: Automatic Gate isn't working -
=WoR=Varth - 15.09.2011
Code of the gate please.
Re: Automatic Gate isn't working -
spd_sahil - 15.09.2011
https://sampwiki.blast.hk/wiki/Automatic_Gates Read this <<<<< Helpfull..
if ur bored then..
pawn Код:
OnGameModeInit()
{
SetTimer("CheckGate1",10,true)
}
forward CheckGate1();
public CheckGate1()
{
new mygate_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, {YOUR GATES CO-ORDINATES}))mygate_status=1;
}
if(mygate_status)MoveObject(open2,{ CO_ORDINATEs Change the x OR y depending on where u want the gate to move} ,3.0);
else MoveObject(open2,{GATES CO-ORDINATES},3.0);
}
Re: Automatic Gate isn't working -
Universal - 15.09.2011
Quote:
Originally Posted by spd_sahil
https://sampwiki.blast.hk/wiki/Automatic_Gates Read this <<<<< Helpfull..
if ur bored then..
pawn Код:
OnGameModeInit() { SetTimer("CheckGate1",10,true) } forward CheckGate1(); public CheckGate1() { new mygate_status; for(new i;i<MAX_PLAYERS;i++) { if(!IsPlayerConnected(i)) continue; if(IsPlayerInRangeOfPoint(i,10.0, {YOUR GATES CO-ORDINATES}))mygate_status=1; } if(mygate_status)MoveObject(open2,{ CO_ORDINATEs Change the x OR y depending on where u want the gate to move} ,3.0); else MoveObject(open2,{GATES CO-ORDINATES},3.0); }
|
You called a timer, which will call a callback called "CheckGate", but you named the callback "CheckGate1"