[Pomoc] Zasto ne unisti automobile igracu koji ode off?


Započeo Pule96, Jun 12, 2014, 21:28:13 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Mod koji koristim: EGbP
Detaljan opis: Kada igrac ode offline ne unisti mu vozila, nego ostanu na serveru da stvaraju lag.
Deo skripte:
Citatpublic OnPlayerDisconnect(playerid, reason)
{
    DestroyObject(Vreca[1][playerid]); DestroyObject(Vreca[2][playerid]); DestroyObject(Vreca[3][playerid]); DestroyObject(Vreca[4][playerid]); DestroyObject(Vreca[5][playerid]);
    DestroyObject(GetPVarInt(playerid, "drvo"));
   DestroyObject(GetPVarInt(playerid, "drvo1"));
   DestroyObject(GetPVarInt(playerid, "drvo2"));
   foreach(Player, i)
   {
      if(hPrihvatio == playerid)
         {
          hPrihvatio = -1;
            GameTextForPlayer(i, "~r~Pozivalac napustio igru", 5000, 1);
           b_DisablePlayerCheckpoint(i);
      }
      if(IgracPosmatraIgraca == playerid) cmd_uncon(i, "");
   }
   TextDrawDestroy(Text:TDEvent1[playerid]);
    TextDrawDestroy(Text:TDEvent2[playerid]);
    TextDrawDestroy(Text:TDEvent3[playerid]);
    TextDrawDestroy(Text:TDEvent4[playerid]);
    TextDrawDestroy(Text:TDEvent5[playerid]);
    TextDrawDestroy(Text:TDEvent6[playerid]);
   NovacTD(playerid, 0, "_");
   strmid(TeleportStaraZona[playerid], "", 0, strlen(""), 100);
   strmid(TeleportNovaZona[playerid], "", 0, strlen(""), 100);
   TeleportDozvoljen[playerid] = 0; IgracSpawnan[playerid] = 0; hIgracUlogovan[playerid] = 0; TeleportOtkriven[playerid] = 0;
   JoypadOtkriven[playerid] = 0; BezanjeOtkriveno[playerid] = 0; ideBrzinom[playerid] = -1;
   for(new i = 0; i < sizeof OruzjeOtkriveno; i++) OruzjeOtkriveno[playerid] = -1;
   TeleportUdaljenost[playerid] = 0; hDobioPay[playerid] = 0;
   PoslednjeVozilo[playerid] = INVALID_VEHICLE_ID;
   if(TaxiPozivalac == playerid) TaxiPozivalac = -1;
   if(BusPozivalac == playerid) BusPozivalac = -1;
   if(MehPozivalac == playerid) MehPozivalac = -1;
   if(MDPozivalac == playerid) MDPozivalac = -1;
   if(PlayerInfo[playerid][pKucaKljuc] != -1) SacuvajKucu(PlayerInfo[playerid][pKucaKljuc]);
    if(PlayerInfo[playerid][pStanKljuc] != -1) SacuvajStan(PlayerInfo[playerid][pStanKljuc]);
    if(PlayerInfo[playerid][pFirmaKljuc] != -1) SacuvajFirmu(PlayerInfo[playerid][pFirmaKljuc]);
    if(PlayerInfo[playerid][pSFirmaKljuc] != -1) SacuvajSFirmu(PlayerInfo[playerid][pSFirmaKljuc]);
    if(PlayerInfo[playerid][pVikendicaKljuc] != -1) SacuvajVikendicu(PlayerInfo[playerid][pVikendicaKljuc]);
    if(KomeProdaje[playerid] != -1) SCM(KomeProdaje[playerid], COLOR_LIGHTRED, "Prodaja neuspjesna |{FFFFFF} Igrac koji Vam je poslao ponudu je nazalost napustio server.");
   if(PonudioIgrac[playerid] != -1) SCM(PonudioIgrac[playerid], COLOR_LIGHTRED, "Prodaja neuspjesna |{FFFFFF} Igrac kome ste poslali ponudu je nazalost napustio server.");
   if(KomeProdaje[playerid] != -1)
   {
       StaProdaje[KomeProdaje[playerid]] = 0;
       CijenaProdaje[KomeProdaje[playerid]] = 0;
       PonudioIgrac[KomeProdaje[playerid]] = -1;
       KomeProdaje[KomeProdaje[playerid]] = -1;
   }
   if(IgracUWaru[playerid] == 1)
   {
      foreach(Player, i)
      {
         if(PlayerInfo[pClan] == PlayerInfo[playerid][pClan])
         {
            SCMF(i, CRVENA, "WAR | Igrac %s je napustio server!", GetName(playerid));
         }
      }
      ClanovaUWaru[PlayerInfo[playerid][pClan]]--;
   }
   if(Intervju[playerid] != -1)
   {
      foreach(Player, i)
      {
         if(IsPlayerConnected(i) && Intervju == 555)
         {
             IntAktivan = false;
            SCMF(playerid, COLOR_LIGHTBLUE, "* %s je napustio intervju.", GetName(playerid));
         }
      }
   }
   if(IznajmioVozilo[playerid] != -1)
   {
       SetVehicleToRespawn(RentVozilo[IznajmioVozilo[playerid]]);
       VoziloIznajmljeno[IznajmioVozilo[playerid]] = -1;
   }
    if(prc_Moving[playerid] == true)
   {
       KillTimer_B(prc_Timer[playerid]); // uniÅ¡tavanje tajmera
      prc_Degree[playerid] = 0;
      prc_Moving[playerid] = false;
   }
   new id = PlayerInfo[playerid][pDrogaID];
    Delete3DTextLabel(DrogaLabel[id]);
   DestroyPickup(DrogaPickup[id]);
   DestroyObject(DrogaObject[id]);
   PPDroga[id][DROGAzalivena] = 0;
      PPDroga[id][DROGAvrijeme] = 0;
      PPDroga[id][DROGAvlasnik] = 0;
      PPDroga[id][DROGAzasadjena] = 0;
      PPDroga[id][DROGAzavrsena] = 0;
      PPDroga[id][DROGApozX] = 0;
      PPDroga[id][DROGApozY] = 0;
   PPDroga[id][DROGApozZ] = 0;
   PlayerInfo[playerid][pDrogaID] = 0;
   foreach(Player, i)
      {
          if(Meta == playerid)
          {
              SCM(i, ZUTA, "* Vasa meta je napustila server.");
              Meta = -1;
         }
      }
   PlayerInfo[playerid][pUcena] = 0;
   if(RazgovaraSa[playerid] != -1)
   {
       GameTextForPlayer(RazgovaraSa[playerid], "~r~Veza se prekinula!", 3000, 5);
          if(PozivZa[playerid] != -1) KillTimer_B(naplatipoziv[playerid]);
       if(ZoveGa[playerid] != -1) KillTimer_B(naplatipoziv[RazgovaraSa[playerid]]);
        SetPlayerSpecialAction(RazgovaraSa[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
       RemovePlayerAttachedObject(RazgovaraSa[playerid], TELEFON_SLOT);
        ZoveGa[RazgovaraSa[playerid]] = -1;
        PozivZa[RazgovaraSa[playerid]] = -1;
        RazgovaraSa[RazgovaraSa[playerid]] = -1;
        ZoveGa[playerid] = -1;
        PozivZa[playerid] = -1;
        RazgovaraSa[playerid] = -1;
   }
   Speedo(playerid, 0);
    if(hGledaStats[playerid] > 0)
   {
        StatusTD(playerid, 0);
   }
   if(GetPVarType(playerid, "PlacedBB"))
    {
        DestroyDynamicObject(GetPVarInt(playerid, "PlacedBB"));
        DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "BBLabel"));
        if(GetPVarType(playerid, "BBArea"))
        {
            foreach(Player,i)
            {
                if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                {
                    StopAudioStreamForPlayer(i);
                }
            }
        }
    }
   if(VoziSeBusom[playerid] == 1) KillTimer_B(busvoznja[playerid]);
   if(VoziSeTaxijem[playerid] == 1) KillTimer_B(taxivoznja[playerid]);
    if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1);
   if(IsPlayerAttachedObjectSlotUsed(playerid, 2)) RemovePlayerAttachedObject(playerid, 2);
   if(IsPlayerAttachedObjectSlotUsed(playerid, 3)) RemovePlayerAttachedObject(playerid, 3);
   if(IsPlayerAttachedObjectSlotUsed(playerid, 4)) RemovePlayerAttachedObject(playerid, 4);
   if(IsPlayerAttachedObjectSlotUsed(playerid, 5)) RemovePlayerAttachedObject(playerid, 5);
   if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, 6);
   if(reason == 0 && hIgracUlogovan[playerid] == 1)
   {
       SacuvajIgraca(playerid);
        ServerInfo[sCrashes]++;
   }
   else if(reason == 2)
   SacuvajIgraca(playerid);
}
Slike:
http://zaslike.com/viewer.php?file=0gx67j2qmnhq8o60ivqy.png
http://zaslike.com/viewer.php?file=m1o5s22dcovpd39gdxqz.png