OnPlayerDisconnect

Započeo uinatsvima_, Decembar 17, 2017, 13:47:44 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim: San Union v3.1
Detaljan opis problema: Kada izadjem sa servera, server se automatski ugasi
Dio skripte:OnPlayerDissconect
Neke slike/video za lakse dobivanje pomoci(neobavezno):
[pawn][13:40:21] [debug] AMX backtrace:
[13:40:21] [debug] #0 00000039 in INI_AddToBuffer (INI:file=53, name[]=@00000032 "", data[]=@0165dea0 "-0000001555589652") at :0
[13:40:21] [debug] #1 00014708 in ?? (... <13 arguments>) at D:\Download\San Union zadnja verzija by skorpija\San Union v3\SU\pawno\include\YSI\y_ini.inc:1076
[13:40:21] [debug] #2 00000039 in public OnPlayerDisconnect () at :0[/pawn]
A evo dio OnPlayerDisconnect
[pawn]public OnPlayerDisconnect(playerid, reason)
{
    if(zonatime[playerid] > 0)
    {
       new id = zonaid[playerid];
       GangZoneStopFlashForAll(ZonaID[id]);
       PlayerTextDrawHide(playerid, ZauzimanjeTD[playerid]);
       zonaid[playerid] -= 1;
       zonatime[playerid] -= 1;
       KillTimer(zonatimer[playerid]);
    }
    SetTimerEx("RekordTimer", 50, false, "d", playerid);
    TogGChat[playerid] = 0;
    //onlinepl--;
    DisablePlayerCheckpoint(playerid);
   PosaoGPS[playerid] = 0;
   new Float:x;
    new Float:y;
    new Float:z;
      GetPlayerPos(playerid,x,y,z);
   positionx[playerid] = x;
   positiony[playerid] = y;
   positionz[playerid] = z;
   positionint[playerid] = GetPlayerInterior(playerid);
   positionvw[playerid] = GetPlayerVirtualWorld(playerid);
   new string3[50];
   new d,m,yy,h,mi,s;
   getdate(yy,m,d);
   gettime(h,mi,s);
   format(string3, sizeof(string3), "%d/%d/%d at %d:%d:%d",d,m,yy,h,mi,s);
   strmid(PlayerInfo[playerid][pLastSeen], string3, 0, strlen(string3), 255);
   SavePlayer(playerid);
    if(playerid == -1) return 1;
    if(AdminVozilo[playerid] != -1) DestroyVehicle(AdminVozilo[playerid]), AdminVozilo[playerid] = -1;
    if(GetPVarType(playerid, "BoomboxObject"))
    {
    DestroyDynamicObject(GetPVarInt(playerid, "BoomboxObject"));
    if(GetPVarType(playerid, "bboxareaid"))
        {
    foreach(Player,i)
         {
     if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
        {
    StopAudioStreamForPlayer(i);
    SendClientMessage(i, COLOR_GREY, " Boombox kreator se diskonektovao sa servera.");
        }
        }
        }
         }
    if(UlogovanProvera[playerid] == 1)
    {
      if(PlayerInfo[playerid][pPosedovanjeAuta] != -1)
      {
         DestroyVehicle(VoziloInfo[PlayerInfo[playerid][pPosedovanjeAuta]][vID]);
         SacuvajVozilo(PlayerInfo[playerid][pPosedovanjeAuta]);
         VoziloInfo[PlayerInfo[playerid][pPosedovanjeAuta]][vID] = -1;
      }
      if(PlayerInfo[playerid][pPosedovanjeAuta2] != -1)
      {
         DestroyVehicle(VoziloInfo[PlayerInfo[playerid][pPosedovanjeAuta2]][vID]);
         SacuvajVozilo(PlayerInfo[playerid][pPosedovanjeAuta2]);
         VoziloInfo[PlayerInfo[playerid][pPosedovanjeAuta2]][vID] = -1;
      }
      if(PlayerInfo[playerid][pPosedovanjeMotora] != -1)
      {
         DestroyVehicle(MotorInfo[PlayerInfo[playerid][pPosedovanjeMotora]][mID]);
         SacuvajMotor(PlayerInfo[playerid][pPosedovanjeMotora]);
         MotorInfo[PlayerInfo[playerid][pPosedovanjeMotora]][mID] = -1;
      }
      if(PlayerInfo[playerid][pPosedovanjeAviona] != -1)
      {
         DestroyVehicle(AvionInfo[PlayerInfo[playerid][pPosedovanjeAviona]][avID]);
         SacuvajAvione(PlayerInfo[playerid][pPosedovanjeAviona]);
         AvionInfo[PlayerInfo[playerid][pPosedovanjeAviona]][avID] = -1;
      }
      if(PlayerInfo[playerid][pPosedovanjePlovila] != -1)
      {
         DestroyVehicle(PlovilaInfo[PlayerInfo[playerid][pPosedovanjePlovila]][plID]);
         SacuvajPlovila(PlayerInfo[playerid][pPosedovanjePlovila]);
         PlovilaInfo[PlayerInfo[playerid][pPosedovanjePlovila]][plID] = -1;
      }
   }
    //////////////////////////////////////////////////////
   PlayerInfo[playerid][pRadi] = 0;
   if(PlayerInfo[playerid][pWar] > 0)
   {
      PlayerInfo[playerid][pWar] = 0;
      TextDrawHideForPlayer(playerid, TDwar0);
      TextDrawHideForPlayer(playerid, TDwar1);
      TextDrawHideForPlayer(playerid, TDwar2);
      TextDrawHideForPlayer(playerid, TDwar3);
      TextDrawHideForPlayer(playerid, TDwar4);
      TextDrawHideForPlayer(playerid, TDwar5);
      TextDrawHideForPlayer(playerid, TDwar6);
   }
   #if REMEMBER_OLD_POSITION == true
   removePlayerFromRace(playerid, false);
   #else
   removePlayerFromRace(playerid);
   #endif
    /////////////////////////////////////////////////////
    if(Rentano[playerid] != 299) { RTC(Rentano[playerid]); Rentano[playerid] = 299; }
   //////////////////////////////////////////////
   KillTimer(IntroTimer[playerid]); KillTimer(IntroTimer2[playerid]);
    KillTimer(IntroTimer3[playerid]); KillTimer(IntroTimer4[playerid]);
    KillTimer(IntroTimer5[playerid]); KillTimer(LogRegTimer[playerid]);
    AttachObjectRemove(playerid);
   ///////////////////////////////////////////////
   if(Prepreka1Kreirana[playerid] == true) DestroyDynamicObject(Prepreka1[playerid]);
   if(Prepreka2Kreirana[playerid] == true) DestroyDynamicObject(Prepreka2[playerid]);
   if(Prepreka3Kreirana[playerid] == true) DestroyDynamicObject(Prepreka3[playerid]);
   if(Prepreka4Kreirana[playerid] == true) DestroyDynamicObject(Prepreka4[playerid]);
   if(KupovinaAuta[playerid] == true) autokatalog = 0;
   PlayerInfo[playerid][pBonus] = 0;
   //////////////////////////////////////////////
    if(StavljeneLisice[playerid] > 0 || Zavezan[playerid] > 0 || IgracTazovan[playerid] > 0)
   {
      PlayerInfo[playerid][pZatvor] = 2;
       SetPlayerPos(playerid, 107.2300,1920.6311,18.5208);
      SetPlayerWorldBounds(playerid, 337.5694,101.5826,1940.9759,1798.7453);
      SetPlayerInterior(playerid,0);
      SetPlayerColor(playerid, BELA2);
      KillTimer(VuciTimer[playerid]);
   }
   if(Vuceigraca[playerid] != -1)
   {
      KillTimer(VuciTimer[playerid]); Vucen[Vuceigraca[playerid]] = -1; Vuceigraca[playerid] = -1;
   }
   if(Vucen[playerid] != -1)
   {
      KillTimer(VuciTimer[Vucen[playerid]]); Vuceigraca[Vucen[playerid]] = -1; Vucen[playerid] = -1;
   }
   //////////////////////////////////////////
   if(Zavezan[playerid] >= 1) { g_NovacMinus(playerid, 20000); Zavezan[playerid] = 0; }
   ////////////////////////////////////////////
   if(TelefonRazgovor[playerid] != -1)
   {
      SCM(TelefonRazgovor[playerid], -1, "(BL) Telecom | "ZUTA"Igrac sa kojim ste pricali je izasao sa servera!");
      SetPlayerSpecialAction(TelefonRazgovor[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
      RemovePlayerAttachedObject(TelefonRazgovor[playerid], TELEFON_SLOT);
      SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
      RemovePlayerAttachedObject(playerid, TELEFON_SLOT);
      Poziv[playerid] = -1;
      Poziv[TelefonRazgovor[playerid]] = 0;
        TelefonRazgovor[TelefonRazgovor[playerid]] = -1;
      TelefonRazgovor[playerid] = -1;
   }
   ///////////////////////////////////////////
   new rstring[120];
   switch(reason)
   {
      case 0: format(rstring, sizeof(rstring), ""SIVA"(( %s je izasao sa servera... (crash) ))", GetName(playerid));
      case 1: format(rstring, sizeof(rstring), ""SIVA"(( %s je izasao sa servera... ))", GetName(playerid));
   }
   ProxDetector(30.0, playerid, rstring,PROX,PROX,PROX,PROX,PROX);
   //////////////////////////////////////////
   if(Posadjena[playerid] >= 1 || BranjeDroge[playerid] >= 1)
   {
      KillTimer(GroveDrogaTimer[playerid]); BranjeDroge[playerid] = 0; Posadjena[playerid] = 0;
       DestroyPlayerObject(playerid, SadjenjeDrogeGrove[0][playerid]); DestroyPlayerObject(playerid, SadjenjeDrogeGrove[1][playerid]);
      DestroyPlayerObject(playerid, SadjenjeDrogeGrove[2][playerid]); DestroyPlayerObject(playerid, SadjenjeDrogeGrove[3][playerid]);
   }
   if(taxicena[playerid] > 0)
   {
      KillTimer(taxit[playerid]);
      vozact[playerid] = -1;
      taxicena[playerid] = 0;
   }
   foreach(Player, i)
   {
      if(vozact == playerid)
      {
         KillTimer(taxit);
         vozact = -1;
         taxicena = 0;
      }
   }
   //gangzone
   if(InCP[playerid][Idlewood] == 1)
   {
       UnderAttack[Idlewood] = 0;
   }
   if(InCP[playerid][Hospital] == 1)
   {
       UnderAttack[Hospital] = 0;
   }
   if(InCP[playerid][Ammunation] == 1)
   {
       UnderAttack[Ammunation] = 0;
   }
   if(InCP[playerid][Stadium] == 1)
   {
       UnderAttack[Stadium] = 0;
   }
   //////////////////////////////////////////
   SavePlayer(playerid);
   //////////////////////////////////////////////
   UlogovanProvera[playerid] = 0;
    return 1;
}[/pawn]

slikaj mi liniju y_ini 1076 znaci odes u pawno pa include y_ini

Nova Kuca Community - Founder , Owner


da sad tu udi idi ctrl+g i liniju 1076

Nova Kuca Community - Founder , Owner


Probaj naci samo tu liniju rucno

Nova Kuca Community - Founder , Owner