/exit geht nur manchmal
if(strcmp(cmd, "/exit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(HouseEntered[playerid] != 9999)
{
new i = HouseEntered[playerid];
if (IsPlayerInRangeOfPoint(playerid, 3,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
{
SafeSetPlayerInterior(playerid,0);
SafeSetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
SetPlayerVirtualWorld(playerid,0);
PlayerInfo[playerid][pVirWorld] = 0;
HouseEntered[playerid] = 9999;
if(HouseInfo[i][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
}
}
return 1;
}
}
if(BizzEntered[playerid] != 9999)
{
new i = BizzEntered[playerid];
if (IsPlayerInRangeOfPoint(playerid, 3,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
{
SafeSetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
OnPlayerExitFood(playerid);
SafeSetPlayerPos(playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]);
SetPlayerVirtualWorld(playerid, 0);
BizzEntered[playerid] = 9999;
}
}
new carid = GetPlayerVehicleID(playerid);
if (IsABus(carid))
{
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0) BusrouteEnd(playerid, carid);
}
if (IsASweeper(carid))
{
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
}
if(IsAHarvest(carid))
{
if (carid != 0)
{
SetVehicleToRespawn(carid);
}
if(FarmerPickup[playerid][0] >= 1 && FarmerPickup[playerid][0] <= 22)
{
FarmerPickup[playerid][0]--;
}
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
FarmerVar[playerid] = 0;
DisablePlayerCheckpoint(playerid);
}
if(IsADrugHarvest(carid))
{
if(DrugFarmerPickup[playerid][0] >= 1 && DrugFarmerPickup[playerid][0] <= 37)
{
DrugFarmerPickup[playerid][0]--;
}
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
DrugFarmerVar[playerid] = 0;
DisablePlayerCheckpoint(playerid);
}
if(IsASmuggleCar(carid))
{
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
SmugglerWork[playerid] = 0;
DisablePlayerCheckpoint(playerid);
}
if(Decoding[playerid] == 1)
{
Decoding[playerid] = 0;
KillTimer(DecoderTimer);
HideDecoder(playerid);
SendClientMessage(playerid, COLOR_NICERED, "You left the car, decoder stopped!");
decodecode = 0;
Decoder = 0;
}
if(IsAnOwnableCar(carid) && CarInfo[carid][cOwned] == 0)
{
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
}
if(IsPlayerInAnyVehicle(playerid) && !engineOn[GetPlayerVehicleID(playerid)] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
}
if(GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130 || GetPlayerVehicleID(playerid) >= 135 && GetPlayerVehicleID(playerid) <= 154)
{
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
}
else if (IsPlayerInRangeOfPoint(playerid, 3,387.7978,173.8582,1008.3828))
{
SafeSetPlayerInterior(playerid,0);
SafeSetPlayerPos(playerid,1481.0206,-1771.1138,18.7958);
PlayerInfo[playerid][pLocal] = 255;
}
else if (IsPlayerInRangeOfPoint(playerid, 6,-1404.5299,-259.0602,1043.6563))
{
SafeSetPlayerInterior(playerid,0);
SafeSetPlayerPos(playerid,2695.6235,-1704.6960,11.8438);
}
else if (IsPlayerInRangeOfPoint(playerid, 8,-1443.0554,-581.1879,1055.0472))
{
SafeSetPlayerInterior(playerid,0);
SafeSetPlayerPos(playerid,-2111.5686,-443.9720,38.7344);
}
else if (IsPlayerInRangeOfPoint(playerid, 8,-1464.7732,1557.5533,1052.5313))
{
SafeSetPlayerInterior(playerid,0);
SafeSetPlayerPos(playerid,-2080.3079,-406.0309,38.7344);
}
else if(NoFuel[playerid] == 1)
{
TogglePlayerControllable(playerid, 1);
SafeRemovePlayerFromVehicle(playerid);
NoFuel[playerid] = 0;
}
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /exit",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}