Police Barriers? - 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: Police Barriers? (
/showthread.php?tid=247481)
Police Barriers? -
patfay - 09.04.2011
Okay, well I need barriers for the SFPD.. I have the cords and everything but I cant seem to get it..
What it does is if I type /gate near the object, it will open (stand up) and close after a little bit..
pawn Код:
if(GateOpen2 == 0) {
format(string, sizeof(string), "* %s uses their remote to open the gates.", GetName(playerid));
NearByMessage(playerid, NICESKY, string);
MoveDynamicObject(sfpdbarrier, -1572.20983887,658.81811523,6.77031469, 1);
GateOpen2 = 1;
SetTimer("CloseSFPDGate2", 5000, false);
}
else {
SendClientMessage(playerid, WHITE, "The gate is already open, wait for it to close.");
}
}
}
Timer
pawn Код:
public CloseSFPDGate2()
{
MoveDynamicObject(sfdbarrier, -1572.21887207,658.75366211,6.77031469, 1);
GateOpen2 = 0;
return 1;
}
Re: Police Barriers? -
draken7444 - 09.04.2011
Quote:
SetTimer("CloseSFPDGate2", 5000, false);
|
The 5000 is miliseconds So change that to the closing time
Re: Police Barriers? -
BizzyD - 09.04.2011
Look at this:
SetObjectPos
SetObjectRot
They should help you.