SA-MP Forums Archive
Help Timer of gate crashing server - 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: Help Timer of gate crashing server (/showthread.php?tid=316455)



Help Timer of gate crashing server - ttloko2 - 06.02.2012

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:

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]);
}



Re: Help Timer of gate crashing server - Ballu Miaa - 07.02.2012

pawn Код:
OnGameModeInIt()
{
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",8 * 1000,false,"i",playerid);
   return 1;
   }
   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]);
  return 1;
}