Need help fast! - 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 fast! (
/showthread.php?tid=164054)
Need help fast! -
bogzy - 29.07.2010
How would I make it so that when a gate closes, the other one opens?
Re: Need help fast! -
mastasquizy - 29.07.2010
pawn Код:
public OnObjectMoved()
{
//code here
}
Re: Need help fast! -
WillyP - 29.07.2010
godamn it he beat me xD
Re: Need help fast! -
bogzy - 29.07.2010
How would I make this on a 20 second timer? Like 20 seconds, then the gate closes and the other one opens. And backwards..
Re: Need help fast! -
mastasquizy - 29.07.2010
Quote:
Originally Posted by Lolrofl
godamn it he beat me xD
|
LOL too slow xPPP
Now back on topic: You would move the 1st gate somewhere else in your script, then do this:
pawn Код:
public OnObjectMoved(playerid,objectid)
{
if(objectid==gate1 || objectid==gate2)
{
SetTimerEx("move",20000,1,"i",objectid);
}
return 1;
}
forward move(objectid);
public move(objectid)
{
if(objectid==gate1)
{
MoveObject(gate2,blah blah blah);
}
else if(objectid=gate2)
{
MoveObject(gate1, blah blah blah);
}
return 1;
}
It will do that until you kill the timer.
Re: Need help fast! -
bogzy - 29.07.2010
Thanks! It works!