[POMOC] G and Spawn

Započeo Danisha, April 10, 2013, 20:13:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:RAVENS
Detaljan opis problema:E ovako jel se moze smanjiti radius kada igrac ide G da udje u kola da moze npr samo kada je blizu auta a ne sa radiusa npr. 15
Dio skripte:////
Neke slike/video za lakse dobivanje pomoci(neobavezno): ////


Skripta koju koristim:RAVENS
Detaljan opis problema:A ovde kod mene na serveru je kada igrac ulazi na server da ga baci tamo gde i izasao sa servera ali tu se desi svasta npr igrac ulazi na server i njega baci u selence kako propada i u selo ga stvori sve sam pregledo ali nemam neke ideje kako da to sredio ime dole sve
Dio skripte:
public OnPlayerSpawn(playerid)
{
Mrtav[playerid] = 1;
    SetRealMoney(playerid, ScriptMoney[playerid]);
TextDrawShowForPlayer(playerid, Textdraw69a);
TextDrawShowForPlayer(playerid, Textdraw69b);
TextDrawShowForPlayer(playerid, Textdraw69c);
TextDrawShowForPlayer(playerid, Textdraw69d);
TextDrawShowForPlayer(playerid,Sat);
TextDrawShowForPlayer(playerid, Shadows);
TextDrawShowForPlayer(playerid, Shadows1);
Delete3DTextLabel(AfkLabel[playerid]);
Delete3DTextLabel(DutyLabel[playerid]);
TextDrawHideForPlayer(playerid, DutyTD);
PlayerInfo[playerid][pHealth] = 200.0;
new pName[MAX_PLAYER_NAME];
if(IsPlayerNPC(playerid)) return 1;
STDPlayer[playerid] = 0;


//SetPlayerAttachedObject(playerid,1,19064,2,0.1099,0.019,0.0,0.0,90.0,90.0,1.1,1.1,1.1);
if(IsSpecing[playerid] == 1)
    {
        SafeSetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);// Remember earlier we stored the positions in these variables, now we're gonna get them from the variables.
        SetPlayerInterior(playerid,Inter[playerid]);//Setting the player's interior to when they typed '/spec'
        SetPlayerVirtualWorld(playerid,vWorld[playerid]);//Setting the player's virtual world to when they typed '/spec'
        IsSpecing[playerid] = 0;//Just saying you're free to use '/spec' again YAY :D
        IsBeingSpeced[specid[playerid]] = 0;//Just saying that the player who was being spectated, is not free from your stalking >:D
    }

if(gPlayerLogged[playerid] == 0)
{
    SCM(playerid, COLOR_LIGHTRED, "** Ovaj server zahteva Login pre spawna (Kikovan) **");
        Kick(playerid);
}
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
      Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Admin Na Duznosti \n NE Napadaj",0xFF000099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
TextDrawShowForPlayer(playerid, DutyTD);
}
else if(PlayerInfo[playerid][pTesterDuty] == 1)
{
    Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("Tester Na Duznosti \n NE Napadaj",0x00AA0099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
else if(PlayerInfo[playerid][pGmDuty] == 1)
{
    Delete3DTextLabel(DutyLabel[playerid]);
DutyLabel[playerid] = Create3DTextLabel("GameMaster Na Duznosti \n NE Napadaj",0x00AA0099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
TextDrawShowForPlayer(playerid, DutyTD);
}
else if(PlayerInfo[playerid][pLevel] == 1)
{
Delete3DTextLabel(NovajlijaLabel[playerid]);
NovajlijaLabel[playerid] = Create3DTextLabel("[Novajlija - Level 1]",0x2B60DE99,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(NovajlijaLabel[playerid], playerid, 0,0,0);
}
if(!gPlayerAnimLibsPreloaded[playerid])
{
    PreloadAnimLib(playerid,"BOMBER");
    PreloadAnimLib(playerid,"RAPPING");
    PreloadAnimLib(playerid,"SHOP");
    PreloadAnimLib(playerid,"BEACH");
    PreloadAnimLib(playerid,"SMOKING");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"ON_LOOKERS");
    PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"PED");
PreloadAnimLib(playerid,"MISC");
PreloadAnimLib(playerid,"BLOWJOBZ");
PreloadAnimLib(playerid,"RIFLE");
PreloadAnimLib(playerid,"UZI");
PreloadAnimLib(playerid,"SHOTGUN");
PreloadAnimLib(playerid,"COLT45");
PreloadAnimLib(playerid,"SILENCED");
PreloadAnimLib(playerid,"GYMNASIUM");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"BSKTBALL");
PreloadAnimLib(playerid,"GANGS");
PreloadAnimLib(playerid,"FIGHT_D");
PreloadAnimLib(playerid,"PAULNMAC");
gPlayerAnimLibsPreloaded[playerid] = 1;
}
if(PlayerInfo[playerid][pRegularCount] == 0 && PlayerInfo[playerid][pRegularRank] == 0)
{
    PlayerInfo[playerid][pRegularRank] = 1;
    GetPlayerName(playerid, pName, sizeof(pName));
}
if(PlayerInfo[playerid][pRegularCount] == 18000 && PlayerInfo[playerid][pRegularRank] == 1)
{
    PlayerInfo[playerid][pRegularRank] = 2;
    GetPlayerName(playerid, pName, sizeof(pName));
}
if(PlayerInfo[playerid][pRegularCount] == 36000 && PlayerInfo[playerid][pRegularRank] == 2)
{
    PlayerInfo[playerid][pRegularRank] = 3;
    GetPlayerName(playerid, pName, sizeof(pName));
}
if(PlayerInfo[playerid][pChar] > 0)
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
}
else
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
if(PlayerInfo[playerid][pWeaponReset] == 1)
{
SafeResetPlayerWeapons(playerid);
DisarmInv(playerid);
PlayerInfo[playerid][pWeaponReset] = 0;
}
else
{
SetPlayerWeapons(playerid);
}
SetPlayerSpawn(playerid);
SetPlayerToTeamColor(playerid);
PlayerFixRadio(playerid);
IsCopBanovan(playerid);
KillTimer(stopactimer[playerid]);
stopactimer[playerid] = SetTimerEx("resumeanticheat", 5000, false, "i", playerid);
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): ////

nadji deo pod SetPlayerSpawn gde ti seta poslednje koordinate

if(TutTime[playerid] == 0 && PlayerInfo[playerid][pTut] == 1 && RegistrationStep[playerid] == 0 && AfterTutorial[playerid] == 0 && FirstSpawn[playerid] == 1)
    {
        new plname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, plname, sizeof(plname));
      SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
        SafeSetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
    SafeSetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1);
format(string, sizeof(string), "Dobrodosli u Los Santos, %s... Vracate se gde ste bili",plname);
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "~w~Dobrodosli, ~b~%s. ~n~~y~Vracate se gde ste bili!", plname);
    GameTextForPlayer(playerid, string, 5000, 1);
    return 1;
}


A jel zna ko za ovo G sto se ulazi u kola

vidis ove varijable  pPos_x, ppos_y, i z, e tu je problem, ne sacuva mu lepo to , stavi mu pod onplayerdisconect da mu sacuva

Pa kako da to sredim da mi se to ne desava


public OnPlayerDisconnect(playerid, reason)
{
new textreason[64];
new plname[24];
GetPlayerName(playerid, plname, sizeof(plname));
new playersip[24];
GetPlayerIp(playerid, playersip, sizeof(playersip));
new string2[128];
SetRealMoney(playerid, ScriptMoney[playerid]);
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
SafeResetPlayerWeapons(playerid);
}
if(IsPlayerInAnyVehicle(playerid))
{
new Float:health;
GetVehicleHealth(GetPlayerVehicleID(playerid), health);
if(health < 450)
{
VehicleHealth[GetPlayerVehicleID(playerid)] = 450;
SetVehicleHealth(GetPlayerVehicleID(playerid), 450.0);
}
}
if(Searching[playerid] == 1)
{
RemovePlayerMapIcon(playerid, 500 + playerid);
Searching[playerid] = 0;
}
if(Ronned[playerid] >= 1)
{
    KillTimer(RonnTimer[playerid]);
}

if(playerid == beingvoted && reason != 2)
{
    KillTimer(votetimer1);
    KillTimer(votetimer2);
    format(string2,sizeof(string2),"[Glasanje]: %s (%d) se izlogovao, glasanje je zavrseno!",plname,playerid);
    SendClientMessageToAll(TEAM_GROVE_COLOR,string2);
        votetimer1 = SetTimer("ResetVotation",300000,false);
}

if(Tazer[playerid] == 1) { SafeGivePlayerWeapon(playerid, 24, PreTazerAmmo[playerid]); }
Delete3DTextLabel(DutyLabel[playerid]);
TextDrawHideForPlayer(playerid, DutyTD);
Delete3DTextLabel(NovajlijaLabel[playerid]);
Delete3DTextLabel(AfkLabel[playerid]);
gActivePlayers[playerid]--;
numplayers--;
RemovePlayerMapIcon(playerid, 37 + playerid);
TextDrawDestroy(Textdraw1[playerid]);
TextDrawDestroy(Textdraw39[playerid]);
TextDrawDestroy(Textdraw40[playerid]);
TextDrawDestroy(Textdraw41[playerid]);
TextDrawDestroy(Textdraw42[playerid]);
TextDrawDestroy(Textdraw49[playerid]);
TextDrawDestroy(Textdraw51[playerid]);
TextDrawDestroy(Textdraw52[playerid]);
TextDrawDestroy(Textdraw54[playerid]);
TextDrawDestroy(Textdraw90[playerid]);
TextDrawDestroy(Textdraw91[playerid]);
TextDrawDestroy(Textdraw92[playerid]);
TextDrawDestroy(Textdraw93[playerid]);
TextDrawDestroy(Textdraw94[playerid]);
TextDrawDestroy(Textdraw95[playerid]);
TextDrawDestroy(Textdraw96[playerid]);
TextDrawDestroy(Textdraw97[playerid]);
TextDrawDestroy(Textdraw98[playerid]);
TextDrawDestroy(Textdraw99[playerid]);
TextDrawDestroy(TDZlato[playerid]);

for(new td = 0; td < 17; td++)
{
TextDrawHideForPlayer(playerid, UvodTD[td]);
}
TextDrawHideForPlayer(playerid, Textdraw75);
TextDrawHideForPlayer(playerid, Textdraw80);
TextDrawHideForPlayer(playerid, lbt);
TextDrawHideForPlayer(playerid, lbb);
KillTimer(TrainTimer[playerid]);
KillTimer(MoneyTimer[playerid]);
KillTimer(ResetJumpTimer);
KillTimer(ResetSpeeding[playerid]);
KillTimer(stopactimer[playerid]);
KillTimer(forbcartimer[playerid]);
KillTimer(stopanticheat[playerid]);
KillTimer(VuciTimer[playerid]);
KillTimer(RobGymTimer[playerid]);
KillTimer(RobBankTimer[playerid]);
KillTimer(PljackaTrafikeTimer[playerid]);
KillTimer(RobCityHallTimer[playerid]);
KillTimer(RobDonutTimer[playerid]);
KillTimer(RobAlhambraTimer[playerid]);
KillTimer(RobBarTimer[playerid]);
KillTimer(RobBurgerTimer[playerid]);
KillTimer(RobCluckinTimer[playerid]);
KillTimer(RobPizzaTimer[playerid]);
if(IsPlayerInEVehicle[playerid] != 9999)
{
    new i = IsPlayerInEVehicle[playerid];
Seats[i] --;
}
new string[24];
new d,m,y,h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "%d/%d/%d at %d:%d:%d",d,m,y,h,mi,s);
strmid(PlayerInfo[playerid][pLastSeen], string, 0, strlen(string), 255);
if(reason == 0)
{
textreason = "Crashed";
strmid(PlayerInfo[playerid][pWhyLeft], "Crashed", 0, strlen("Crashed"), 255);
format(string2, sizeof(string2),"[INFO]: %s je izasao sa Servera. [%s]",plname, textreason);
    SendAdminMessage(COLOR_GREEN, string2);
}
else if(reason == 1)
{
textreason = "Leaving";
strmid(PlayerInfo[playerid][pWhyLeft], "Leaving", 0, strlen("Leaving"), 255);
format(string2, sizeof(string2),"[INFO]: %s je izasao sa Servera. [%s]",plname, textreason);
    SendAdminMessage(COLOR_GREEN, string2);
}
else if(reason == 2)
{
strmid(PlayerInfo[playerid][pWhyLeft], "Kikovan/Banovan", 0, strlen("Kikovan/Banovan"), 255);
}
SaveGuns(playerid);
OnPlayerUpdateEx(playerid);
if(OfficerCourseStep[playerid] != 255)
{
    SafeGivePlayerMoney(playerid, -2500);
}
if(OnOfficerTest[playerid] != 0)
{
    SafeGivePlayerMoney(playerid, -5000);
}
if(ServerRestarted == 0)
{
    UpdatePlayerPosition(playerid)
}
KillTimer(ChangeNameTimer);

foreach(Player, i)
{
    if(IsPlayerConnected(i))
    {
        if(TaxiAccepted[i] < 999)
        {
        if(TaxiAccepted[i] == playerid)
        {
            TaxiAccepted[i] = 999;
            GameTextForPlayer(i, "~w~Pozivalac Taxija~n~~r~je napustio igru", 5000, 1);
            TaxiCallTime[i] = 0;
            DisablePlayerCheckpoint(i);
        }
        }
        else if(BusAccepted[i] < 999)
        {
        if(BusAccepted[i] == playerid)
        {
            BusAccepted[i] = 999;
            GameTextForPlayer(i, "~w~Pozivalac Autobusa~n~~r~je napustio igru", 5000, 1);
            BusCallTime[i] = 0;
            DisablePlayerCheckpoint(i);
        }
        }
    }
}
if(PlayerInfo[playerid][Admin] >= 1)
{
admins --;
if(AFK[playerid] == 1)
{
    afkadmins --;
}
}
KillTimer(DildoTimerReset);
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
    if(IsPlayerConnected(TransportDriver[playerid]))
{
    new string5[64];
    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
    TransportTime[TransportDriver[playerid]] = 0;
    TransportCost[TransportDriver[playerid]] = 0;
    format(string5, sizeof(string5), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
    GameTextForPlayer(TransportDriver[playerid], string5, 5000, 1);
}
}
if(GotHit[playerid] > 0)
{
    if(GetChased[playerid] < 999)
    {
        if(IsPlayerConnected(GetChased[playerid]))
        {
        SCM(GetChased[playerid], COLOR_YELLOW, "Vasa meta je otisla sa servera.");
            GoChase[GetChased[playerid]] = 999;
}
    }
}
if(PlayersChannel[playerid] < 999)
{
IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
}
if(HireCar[playerid] != 9999)
{
//gLastDriver[HireCar[playerid]] = 300;
//gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
if(reason != 0)
{
SetVehicleToRespawn(HireCar[playerid]);
}
}
if(GangCar[playerid] != 512)
{
//gLastDriver[GangCar[playerid]] = 520;
//gCarLock[GangCar[playerid]] = 0;
UnLockCar(GangCar[playerid]);
}
if(gLastCar[playerid] > 0)
{
//gLastDriver[gLastCar[playerid]] = 300;
if(PlayerInfo[playerid][pHouseKey] != gLastCar[playerid]-1)
{
//gCarLock[gLastCar[playerid]] = 0;
UnLockCar(gLastCar[playerid]);
}
}
if(PlayerBoxing[playerid] > 0)
{
    if(Bokser1 == playerid)
    {
        if(IsPlayerConnected(Bokser2))
        {
        PlayerBoxing[Bokser2] = 0;
        SafeSetPlayerPos(Bokser2, 765.8433,3.2924,1000.7186);
        SafeSetPlayerInterior(Bokser2, 5);
        GameTextForPlayer(Bokser2, "~r~Mec je prekinut", 5000, 1);
}
    }
    else if(Bokser2 == playerid)
    {
        if(IsPlayerConnected(Bokser1))
        {
        PlayerBoxing[Bokser1] = 0;
        SafeSetPlayerPos(Bokser1, 765.8433,3.2924,1000.7186);
        SafeSetPlayerInterior(Bokser1, 5);
        GameTextForPlayer(Bokser1, "~r~Mec je prekinut", 5000, 1);
}
    }
    InRing = 0;
      RoundStarted = 0;
Bokser1 = 255;
Bokser2 = 255;
TBokser = 255;
}
    if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
    else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
else if(PlayerInfo[playerid][pJob] == 7)
{
    if(JobDuty[playerid] == 1) { Mechanics -= 1; }
}
else if(PlayerInfo[playerid][pJob] == 17)
{
if(JobDuty[playerid] == 1) { PizzaBoys -= 1; }
}
if(PlayerInfo[playerid][pRoadblock] != 0)
{
RemoveRoadblock(playerid);
}
BusrouteEast[playerid][0] = 0;
BusrouteWest[playerid][0] = 0;
IsInBus[playerid] = 0;
KillTimer(SacuvajNalog[playerid]);
KillTimer(ACTimer[playerid]);
if(IsBeingSpeced[playerid] == 1)//If the player being spectated, disconnects, then turn off the spec mode for the spectator.
    {
        TogglePlayerSpectating(spectatorid[playerid],0);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
    }
if(IDVucenogIgraca[playerid] != 9999)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string2, sizeof(string2), "* %s je napustio server, pusteni ste.", sendername);
SCM(IDVucenogIgraca[playerid], COLOR_WHITE, string2);
TogglePlayerControllable(IDVucenogIgraca[playerid], 1);
Vucen[playerid] = 9999;
}
}

public OnPlayerDisconnect(playerid, reason)
{
new textreason[64];
new plname[24];
GetPlayerName(playerid, plname, sizeof(plname));
new playersip[24];
GetPlayerIp(playerid, playersip, sizeof(playersip));
new string2[128];
SetRealMoney(playerid, ScriptMoney[playerid]);
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x,y,z);
        PlayerInfo[playerid][pPos_x] = x;
        PlayerInfo[playerid][pPos_y] = y;
        PlayerInfo[playerid][pPos_z] = z;
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
SafeResetPlayerWeapons(playerid);
}
if(IsPlayerInAnyVehicle(playerid))
{
new Float:health;
GetVehicleHealth(GetPlayerVehicleID(playerid), health);
if(health < 450)
{
VehicleHealth[GetPlayerVehicleID(playerid)] = 450;
SetVehicleHealth(GetPlayerVehicleID(playerid), 450.0);
}
}
if(Searching[playerid] == 1)
{
RemovePlayerMapIcon(playerid, 500 + playerid);
Searching[playerid] = 0;
}
if(Ronned[playerid] >= 1)
{
    KillTimer(RonnTimer[playerid]);
}

if(playerid == beingvoted && reason != 2)
{
    KillTimer(votetimer1);
    KillTimer(votetimer2);
    format(string2,sizeof(string2),"[Glasanje]: %s (%d) se izlogovao, glasanje je zavrseno!",plname,playerid);
    SendClientMessageToAll(TEAM_GROVE_COLOR,string2);
        votetimer1 = SetTimer("ResetVotation",300000,false);
}

if(Tazer[playerid] == 1) { SafeGivePlayerWeapon(playerid, 24, PreTazerAmmo[playerid]); }
Delete3DTextLabel(DutyLabel[playerid]);
TextDrawHideForPlayer(playerid, DutyTD);
Delete3DTextLabel(NovajlijaLabel[playerid]);
Delete3DTextLabel(AfkLabel[playerid]);
gActivePlayers[playerid]--;
numplayers--;
RemovePlayerMapIcon(playerid, 37 + playerid);
TextDrawDestroy(Textdraw1[playerid]);
TextDrawDestroy(Textdraw39[playerid]);
TextDrawDestroy(Textdraw40[playerid]);
TextDrawDestroy(Textdraw41[playerid]);
TextDrawDestroy(Textdraw42[playerid]);
TextDrawDestroy(Textdraw49[playerid]);
TextDrawDestroy(Textdraw51[playerid]);
TextDrawDestroy(Textdraw52[playerid]);
TextDrawDestroy(Textdraw54[playerid]);
TextDrawDestroy(Textdraw90[playerid]);
TextDrawDestroy(Textdraw91[playerid]);
TextDrawDestroy(Textdraw92[playerid]);
TextDrawDestroy(Textdraw93[playerid]);
TextDrawDestroy(Textdraw94[playerid]);
TextDrawDestroy(Textdraw95[playerid]);
TextDrawDestroy(Textdraw96[playerid]);
TextDrawDestroy(Textdraw97[playerid]);
TextDrawDestroy(Textdraw98[playerid]);
TextDrawDestroy(Textdraw99[playerid]);
TextDrawDestroy(TDZlato[playerid]);

for(new td = 0; td < 17; td++)
{
TextDrawHideForPlayer(playerid, UvodTD[td]);
}
TextDrawHideForPlayer(playerid, Textdraw75);
TextDrawHideForPlayer(playerid, Textdraw80);
TextDrawHideForPlayer(playerid, lbt);
TextDrawHideForPlayer(playerid, lbb);
KillTimer(TrainTimer[playerid]);
KillTimer(MoneyTimer[playerid]);
KillTimer(ResetJumpTimer);
KillTimer(ResetSpeeding[playerid]);
KillTimer(stopactimer[playerid]);
KillTimer(forbcartimer[playerid]);
KillTimer(stopanticheat[playerid]);
KillTimer(VuciTimer[playerid]);
KillTimer(RobGymTimer[playerid]);
KillTimer(RobBankTimer[playerid]);
KillTimer(PljackaTrafikeTimer[playerid]);
KillTimer(RobCityHallTimer[playerid]);
KillTimer(RobDonutTimer[playerid]);
KillTimer(RobAlhambraTimer[playerid]);
KillTimer(RobBarTimer[playerid]);
KillTimer(RobBurgerTimer[playerid]);
KillTimer(RobCluckinTimer[playerid]);
KillTimer(RobPizzaTimer[playerid]);
if(IsPlayerInEVehicle[playerid] != 9999)
{
    new i = IsPlayerInEVehicle[playerid];
Seats[i] --;
}
new string[24];
new d,m,y,h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "%d/%d/%d at %d:%d:%d",d,m,y,h,mi,s);
strmid(PlayerInfo[playerid][pLastSeen], string, 0, strlen(string), 255);
if(reason == 0)
{
textreason = "Crashed";
strmid(PlayerInfo[playerid][pWhyLeft], "Crashed", 0, strlen("Crashed"), 255);
format(string2, sizeof(string2),"[INFO]: %s je izasao sa Servera. [%s]",plname, textreason);
    SendAdminMessage(COLOR_GREEN, string2);
}
else if(reason == 1)
{
textreason = "Leaving";
strmid(PlayerInfo[playerid][pWhyLeft], "Leaving", 0, strlen("Leaving"), 255);
format(string2, sizeof(string2),"[INFO]: %s je izasao sa Servera. [%s]",plname, textreason);
    SendAdminMessage(COLOR_GREEN, string2);
}
else if(reason == 2)
{
strmid(PlayerInfo[playerid][pWhyLeft], "Kikovan/Banovan", 0, strlen("Kikovan/Banovan"), 255);
}
SaveGuns(playerid);
OnPlayerUpdateEx(playerid);
if(OfficerCourseStep[playerid] != 255)
{
    SafeGivePlayerMoney(playerid, -2500);
}
if(OnOfficerTest[playerid] != 0)
{
    SafeGivePlayerMoney(playerid, -5000);
}
if(ServerRestarted == 0)
{
    UpdatePlayerPosition(playerid)
}
KillTimer(ChangeNameTimer);

foreach(Player, i)
{
    if(IsPlayerConnected(i))
    {
        if(TaxiAccepted[i] < 999)
        {
        if(TaxiAccepted[i] == playerid)
        {
            TaxiAccepted[i] = 999;
            GameTextForPlayer(i, "~w~Pozivalac Taxija~n~~r~je napustio igru", 5000, 1);
            TaxiCallTime[i] = 0;
            DisablePlayerCheckpoint(i);
        }
        }
        else if(BusAccepted[i] < 999)
        {
        if(BusAccepted[i] == playerid)
        {
            BusAccepted[i] = 999;
            GameTextForPlayer(i, "~w~Pozivalac Autobusa~n~~r~je napustio igru", 5000, 1);
            BusCallTime[i] = 0;
            DisablePlayerCheckpoint(i);
        }
        }
    }
}
if(PlayerInfo[playerid][Admin] >= 1)
{
admins --;
if(AFK[playerid] == 1)
{
    afkadmins --;
}
}
KillTimer(DildoTimerReset);
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
    if(IsPlayerConnected(TransportDriver[playerid]))
{
    new string5[64];
    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
    TransportTime[TransportDriver[playerid]] = 0;
    TransportCost[TransportDriver[playerid]] = 0;
    format(string5, sizeof(string5), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
    GameTextForPlayer(TransportDriver[playerid], string5, 5000, 1);
}
}
if(GotHit[playerid] > 0)
{
    if(GetChased[playerid] < 999)
    {
        if(IsPlayerConnected(GetChased[playerid]))
        {
        SCM(GetChased[playerid], COLOR_YELLOW, "Vasa meta je otisla sa servera.");
            GoChase[GetChased[playerid]] = 999;
}
    }
}
if(PlayersChannel[playerid] < 999)
{
IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
}
if(HireCar[playerid] != 9999)
{
//gLastDriver[HireCar[playerid]] = 300;
//gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
if(reason != 0)
{
SetVehicleToRespawn(HireCar[playerid]);
}
}
if(GangCar[playerid] != 512)
{
//gLastDriver[GangCar[playerid]] = 520;
//gCarLock[GangCar[playerid]] = 0;
UnLockCar(GangCar[playerid]);
}
if(gLastCar[playerid] > 0)
{
//gLastDriver[gLastCar[playerid]] = 300;
if(PlayerInfo[playerid][pHouseKey] != gLastCar[playerid]-1)
{
//gCarLock[gLastCar[playerid]] = 0;
UnLockCar(gLastCar[playerid]);
}
}
if(PlayerBoxing[playerid] > 0)
{
    if(Bokser1 == playerid)
    {
        if(IsPlayerConnected(Bokser2))
        {
        PlayerBoxing[Bokser2] = 0;
        SafeSetPlayerPos(Bokser2, 765.8433,3.2924,1000.7186);
        SafeSetPlayerInterior(Bokser2, 5);
        GameTextForPlayer(Bokser2, "~r~Mec je prekinut", 5000, 1);
}
    }
    else if(Bokser2 == playerid)
    {
        if(IsPlayerConnected(Bokser1))
        {
        PlayerBoxing[Bokser1] = 0;
        SafeSetPlayerPos(Bokser1, 765.8433,3.2924,1000.7186);
        SafeSetPlayerInterior(Bokser1, 5);
        GameTextForPlayer(Bokser1, "~r~Mec je prekinut", 5000, 1);
}
    }
    InRing = 0;
      RoundStarted = 0;
Bokser1 = 255;
Bokser2 = 255;
TBokser = 255;
}
    if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
    else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
else if(PlayerInfo[playerid][pJob] == 7)
{
    if(JobDuty[playerid] == 1) { Mechanics -= 1; }
}
else if(PlayerInfo[playerid][pJob] == 17)
{
if(JobDuty[playerid] == 1) { PizzaBoys -= 1; }
}
if(PlayerInfo[playerid][pRoadblock] != 0)
{
RemoveRoadblock(playerid);
}
BusrouteEast[playerid][0] = 0;
BusrouteWest[playerid][0] = 0;
IsInBus[playerid] = 0;
KillTimer(SacuvajNalog[playerid]);
KillTimer(ACTimer[playerid]);
if(IsBeingSpeced[playerid] == 1)//If the player being spectated, disconnects, then turn off the spec mode for the spectator.
    {
        TogglePlayerSpectating(spectatorid[playerid],0);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
    }
if(IDVucenogIgraca[playerid] != 9999)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string2, sizeof(string2), "* %s je napustio server, pusteni ste.", sendername);
SCM(IDVucenogIgraca[playerid], COLOR_WHITE, string2);
TogglePlayerControllable(IDVucenogIgraca[playerid], 1);
Vucen[playerid] = 9999;
}
}
eto tako