Hey, folgendes Problem:
Wenn jemand disconnected wird der Server geschlossen
Warum?
HIer OnPlayerDIsconnect
Function OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForPlayer(playerid, Respekt[playerid]);
DeleteTicket(playerid);
PlayerInfo[playerid][pAdjustable] = 1;
isFight[playerid] = 0;
GW_OnPlayerDisconnect(playerid);
{
TextDrawHideForPlayer(playerid, Respekt[playerid]);
DeleteTicket(playerid);
PlayerInfo[playerid][pAdjustable] = 1;
isFight[playerid] = 0;
GW_OnPlayerDisconnect(playerid);
SaveWeapons(playerid);
if(IsPlayerNPC(playerid))
{
/*ConnectNPC("NeuerBot", "NeuerBot");
ConnectNPC("Zugfahrer", "Zugfahrer");
ConnectNPC("spawnnigga", "spawnnigga");*/
}
if(BlindFold[playerid] == 1)
{
BlindFold[playerid] = 0;
}
if(PlayerInfo[playerid][pMauled] == 1)
{
PlayerInfo[playerid][pMauled] = 0;
}
if(PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24 && BlitzerErstellt[playerid] == 1)
{
RemoveBlitzer(playerid);
}
if(PlayerTied[playerid] == 1)
{
PlayerInfo[playerid][pGangJailed] = 1;
PlayerTied[playerid] = 0;
}
if(IsTowTrucker[playerid] == 1)
{
IsTowTrucker[playerid] = 0;
TowTruckers--;
}
new sendername[MAX_PLAYER_NAME];
new string[200];
GetPlayerName(playerid,sendername,sizeof(sendername));
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;
Pylonenbit[playerid]=0;
// Barrierenbit[playerid]=0;
InCargo[playerid] = 0; InLevi[playerid] = 0; InEnfo[playerid] = 0;
if(reason == 1)
{
if(PlayerCuffed[playerid] >= 1)
{
OfflineFlucht[playerid] = 1;
format(string,sizeof(string),"Warnung %s ist Gefesselt Offline gegangen!(evtl. 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
}
}
gActivePlayers[playerid]--;
if(gActivePlayers[playerid] <= 9) {
noooc = 1;
}
numplayers--;
PlayerInfo[playerid][pAdjustable] = 1;
PlayerUpdate(playerid);
{
/*ConnectNPC("NeuerBot", "NeuerBot");
ConnectNPC("Zugfahrer", "Zugfahrer");
ConnectNPC("spawnnigga", "spawnnigga");*/
}
if(BlindFold[playerid] == 1)
{
BlindFold[playerid] = 0;
}
if(PlayerInfo[playerid][pMauled] == 1)
{
PlayerInfo[playerid][pMauled] = 0;
}
if(PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24 && BlitzerErstellt[playerid] == 1)
{
RemoveBlitzer(playerid);
}
if(PlayerTied[playerid] == 1)
{
PlayerInfo[playerid][pGangJailed] = 1;
PlayerTied[playerid] = 0;
}
if(IsTowTrucker[playerid] == 1)
{
IsTowTrucker[playerid] = 0;
TowTruckers--;
}
new sendername[MAX_PLAYER_NAME];
new string[200];
GetPlayerName(playerid,sendername,sizeof(sendername));
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;
Pylonenbit[playerid]=0;
// Barrierenbit[playerid]=0;
InCargo[playerid] = 0; InLevi[playerid] = 0; InEnfo[playerid] = 0;
if(reason == 1)
{
if(PlayerCuffed[playerid] >= 1)
{
OfflineFlucht[playerid] = 1;
format(string,sizeof(string),"Warnung %s ist Gefesselt Offline gegangen!(evtl. 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
}
}
gActivePlayers[playerid]--;
if(gActivePlayers[playerid] <= 9) {
noooc = 1;
}
numplayers--;
PlayerInfo[playerid][pAdjustable] = 1;
PlayerUpdate(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);
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 DRP 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(IsPlayerInFrac(playerid, 4))
{
if(JobDuty[playerid] == 1)
{
Medics -= 1;
}
}
else if(PlayerInfo[playerid][pLeader] == 24 || PlayerInfo[playerid][pMember] == 24)
{
if(JobDuty[playerid] == 1) { Mechanics -= 1; }
}
if (PlayerInfo[playerid][pRoadblock] != 0)
{
RemoveRoadblock(playerid);
}
{
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 DRP 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(IsPlayerInFrac(playerid, 4))
{
if(JobDuty[playerid] == 1)
{
Medics -= 1;
}
}
else if(PlayerInfo[playerid][pLeader] == 24 || PlayerInfo[playerid][pMember] == 24)
{
if(JobDuty[playerid] == 1) { Mechanics -= 1; }
}
if (PlayerInfo[playerid][pRoadblock] != 0)
{
RemoveRoadblock(playerid);
}
return 1;
}
}