public OnPlayerDisconnect(playerid, reason)
{
new string[150];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid,sendername,sizeof(sendername));
b_PlayerDisconnect(playerid);
OnPlayerCarUpdate(playerid);
MoneySpam[playerid] = 0;
DestroyObject(Sperre[playerid][0]);
DestroyObject(Sperre[playerid][1]);
DestroyObject(Sperre[playerid][2]);
DestroyObject(Sperre[playerid][3]);
DestroyObject(Sperre[playerid][4]);
Sperrebit[playerid]=0;
InCargo[playerid] = 0; InLevi[playerid] = 0;
DestroyPickup(TotenKopf[playerid][0]);
if(reason == 1)
{
if(PlayerCuffed[playerid] >= 1)
{
OfflineFlucht[playerid] = 1;
format(string,sizeof(string),"Warnung %s ist Gefesselt Offline gegangen!(Offline-Flucht))",sendername);
ABroadCast(COLOR_YELLOW,string,1);
//mepmöp
}
}
if(reason == 0)
{
if(PlayerCuffed[playerid] >= 1)
{
//OfflineFlucht[playerid] = 2;
format(string,sizeof(string),"Warnung %s hatte gefesselt einen Exe-Crash! Er wird nicht ins Auto-Jail kommen.",sendername);
ABroadCast(COLOR_YELLOW,string,1);
//mepmöp
}
}
/*switch(reason)
{
case 0://time
{
}
case 1://discon
{
if(PlayerCuffed[playerid] >= 1)
{
OfflineFlucht[playerid] = 1;
format(string,sizeof(string),"Warnung %s ist Gefesselt Offline gegangen!(Offline-Flucht))",sendername);
ABroadCast(COLOR_YELLOW,string,1);
//mepmöp
}
}
case 2://kick
{
}
}*/
gActivePlayers[playerid]--;
numplayers--;
PlayerInfo[playerid][pAdjustable] = 1;
OnPlayerUpdate(playerid);
GetPlayerName(playerid,sendername,sizeof(sendername));
format(string,sizeof(string),"%s war nun %d Minuten online! (ID: %d | IP: %s)",sendername,PlayerInfo[playerid][pMinutesSinceLogin],playerid,pIP[playerid]);
Log("Online.txt",string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(TaxiAccepted[i] < 999)
{
if(TaxiAccepted[i] == playerid)
{
TaxiAccepted[i] = 999;
GameTextForPlayer(i, "~w~Kunde~n~~r~Hat das Spiel Verlassen", 5000, 1);
TaxiCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
else if(BusAccepted[i] < 999)
{
if(BusAccepted[i] == playerid)
{
BusAccepted[i] = 999;
GameTextForPlayer(i, "~w~Kunde~n~~r~Hat Spiel Verlassen", 5000, 1);
BusCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
}
}
if(GettingCK[playerid] < 999)
{
if(IsPlayerConnected(GettingCK[playerid]))
{
SendClientMessage(GettingCK[playerid], COLOR_YELLOW, "Dein Abschuss hat den Server verlassen, versuch es später nochmal.");
OnCK[GettingCK[playerid]] = 999;
}
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
if(IsPlayerConnected(TransportDriver[playerid]))
{
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
TransportTime[TransportDriver[playerid]] = 0;
TransportCost[TransportDriver[playerid]] = 0;
format(string, sizeof(string), "~w~Kunde ist ausgestiegen~n~~g~Verdienst: $%d",TransportCost[playerid]);
GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
}
}
if(GotHit[playerid] > 0)
{
if(GetChased[playerid] < 999)
{
if(IsPlayerConnected(GetChased[playerid]))
{
SendClientMessage(GetChased[playerid], COLOR_YELLOW, "Er hat den Server verlassen.");
GoChase[GetChased[playerid]] = 999;
}
}
}
if(PlayerPaintballing[playerid] != 0)
{
PaintballPlayers --;
}
if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
{
KartingPlayers --;
}
if(PlayersChannel[playerid] < 999)
{
IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
}
if(HireCar[playerid] != 299)
{
gLastDriver[HireCar[playerid]] = 300;
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
if (gLastCar[playerid] > 0)
{
gLastDriver[gLastCar[playerid]] = 300;
if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
{
gCarLock[gLastCar[playerid]] = 0;
UnLockCar(gLastCar[playerid]);
}
}
if(PlayerBoxing[playerid] > 0)
{
if(Boxer1 == playerid)
{
if(IsPlayerConnected(Boxer2))
{
PlayerBoxing[Boxer2] = 0;
SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
SetPlayerInterior(Boxer2, 5);
GameTextForPlayer(Boxer2, "~r~Kampf unterbrochen", 5000, 1);
}
}
else if(Boxer2 == playerid)
{
if(IsPlayerConnected(Boxer1))
{
PlayerBoxing[Boxer1] = 0;
SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
SetPlayerInterior(Boxer1, 5);
GameTextForPlayer(Boxer1, "~r~Kampf unterbrochen", 5000, 1);
}
}
InRing = 0;
RoundStarted = 0;
Boxer1 = 255;
Boxer2 = 255;
TBoxer = 255;
}
if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
if(PlayerInfo[playerid][pJob] == 11)
{
if(JobDuty[playerid] == 1) { Medics -= 1; }
}
else if(PlayerInfo[playerid][pJob] == 7)
{
if(JobDuty[playerid] == 1) { Mechanics -= 1; }
}
if (PlayerInfo[playerid][pRoadblock] != 0)
{
RemoveRoadblock(playerid);
}
b_PlayerDisconnect(playerid);
return 1;
}