gate not 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: gate not working (
/showthread.php?tid=406831)
gate not working -
Robert West - 11.01.2013
Код:
CMD:paytroll(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 8.0,-638.1337,644.5661,16.6300))
{
SetDynamicObjectRot(gate1, 0.000000, 0, 90);
GivePlayerCash(playerid, -500);
SendClientMessage(playerid, 0x00FF00AA, "Gate is opening (Auto-closed in 9 sec).");
SetTimerEx("GateClose", 9000, true,"i",playerid);
SetDynamicObjectRot(gate1, 0.000000, 0, -90);
}
}
Gate open correctly , but she doesn't close automatically

((sorry for bad english ))
Re: gate not working -
TvW - 11.01.2013
Please post your GateClose(playerid) function.
Btw, replace
pawn Код:
SetTimerEx("GateClose", 9000, true,"i",playerid);
With
pawn Код:
SetTimerEx("GateClose", 9000, false,"i",playerid);
So your timer doesn't repeat.
Re: gate not working -
Robert West - 11.01.2013
Nah still open
GateClose(playerid) dosn't have one XD
Re: gate not working -
TvW - 11.01.2013
Try this:
pawn Код:
CMD:paytroll(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 8.0,-638.1337,644.5661,16.6300))
{
SetDynamicObjectRot(gate1, 0.000000, 0, -90);
GivePlayerCash(playerid, -500);
SendClientMessage(playerid, 0x00FF00AA, "Gate is opening (Auto-closed in 9 sec).");
SetTimerEx("GateClose", 9000, true,"i",playerid);
}
}
forward GateClose(playerid);
public GateClose(playerid)
{
SetDynamicObjectRot(gate1, 0.000000, 0, 90);
return 1;
}
If the gate still isn't closing try to change the last part in this:
pawn Код:
forward GateClose(playerid);
public GateClose(playerid)
{
SetDynamicObjectRot(gate1, 0.000000, 0, -90);
return 1;
}