07.02.2012, 14:44
I have a problem with a automatic gate I created, although it works, sometimes it spams even though I created something to stop it, anyway is there a better way to make this?
I cant find any way to do it, setting the time longer doesn't help either, sometimes it still spams.
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,10,1549.59997559,-1630.00000000,12.60000038))
{
if(PlayerInfo[playerid][pFaction] == 2 && PlayerInfo[playerid][pSpam] == 0)
{
PlayerInfo[playerid][pSpam] = 1; // To stop spam (.. && PlayerInfo[playerid][pSpam] == 0))
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s uses their remote to open the gates.", name);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveObject(Gate, 1549.59997559,-1630.00000000,12.60000038, 10);
SetTimer("LSPDGateClose",5000,1); // closes the gate after the time set
SetTimer("SpamStop",5000,1); // Sets a timer to avoid spam
}
}