06.02.2012, 23:09
guys i got a problem, i execute my command /openg then it start a timer of 5 secs that will close it, but heres what happens: i type it /openg, gate opens but timer or gate doesnґt work/close, and 6 secs later server just disappear, and nothing is shown on server log.
heres code:
heres code:
pawn Код:
new LSPDGate;
new LSPDTimer[MAX_PLAYERS];
OnFilterScripInit()
{
LSPDGate = CreateObject(980,1542.00000000,-1627.40002441,15.10000038,0.00000000,0.00000000,87.99993896); //object(airportgate)LSPDGATE
}
CMD:openg(playerid, params[])
{
if(pInfo[playerid][FactionID] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1539.3813,-1625.6138,13.3828))
{
new str[128], name[25];
GetPlayerName(playerid, name, sizeof(name));
MoveObject(LSPDGate, 1542.00000000,-1627.39941406,9.50000000, 3);
format(str, sizeof(str), "%s , you opened a magical gate!", name);
SendClientMessage(playerid, 0xEF994300, str);
LSPDTimer[playerid] = SetTimerEx("AutoCloseLSPD",5000,false,"i",playerid);
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_PURPLE, "You are not from lspd");
}
return 1;
}
forward AutoCloseLSPD(playerid);
public AutoCloseLSPD(playerid)
{
MoveObject(LSPDGate, 1542.00000000,-1627.40002441,15.10000038, 3.0, 0.00000000,0.00000000,87.99993896);
KillTimer(LSPDTimer[playerid]);
}