Automatic Gate Not Working. Compiles. - 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: Automatic Gate Not Working. Compiles. (
/showthread.php?tid=130576)
Automatic Gate Not Working. Compiles. -
cozza123456 - 27.02.2010
Hi, My Script compiles, its an automatic gate, but the gate doesnt appear when i start go to it.
Above Main.
Код:
new base;
forward CheckGate();
Under OnFilterScriptInit
Код:
base = CreateObject(969, -1534.5819091797, 482.19046020508, 6.2807078361511, 0.000000, 0.000000, 0.000000); //object (electricgate) (1)
SetTimer("CheckGate",500,true);
At Bottom Of Script
Код:
public CheckGate()
{
new base_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,15.0,-1534.5819091797, 482.19046020508, 6.2807078361511))base_status = 1;
}
if(base_status)MoveObject(base,-1526.4539794922, 481.65655517578, 6.2885203361511,5.0);
else MoveObject(base, -1534.5819091797, 482.19046020508, 6.2807078361511,5.0);
}
My Gate doesn't even spawn nevermind automatically open.
Re: Automatic Gate Not Working. Compiles. -
Jeffry - 27.02.2010
Maybe:
pawn Код:
public CheckGate()
{
new base_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,15.0,-1534.5819091797, 482.19046020508, 6.2807078361511)) base_status = 1;
}
if(base_status==1) MoveObject(base,-1526.4539794922, 481.65655517578, 6.2885203361511,5.0);
else MoveObject(base, -1534.5819091797, 482.19046020508, 6.2807078361511,5.0);
}
Untested.
Btw. I had the same problem that the electric gate was not spawned. Just try to place another one, on another place.
Re: Automatic Gate Not Working. Compiles. -
cozza123456 - 27.02.2010
Well, I cant see the reason why, is this a 0.3 bug?
Re: Automatic Gate Not Working. Compiles. -
`Robo - 27.02.2010
https://sampwiki.blast.hk/wiki/Automatic_Gates
Re: Automatic Gate Not Working. Compiles. -
cozza123456 - 28.02.2010
That is exactly where my script came from, i assume it works but my gate doesnt spawn in the first place.
Re: Automatic Gate Not Working. Compiles. -
aircombat - 28.02.2010
try to use the application in my attachement :
V
V
V
V
V
________
Fat woman live