25.02.2015, 09:42
The /exit command doesn't seem to work, This is the code - I dont get any errors but While I do it In game, The command doesnt execute.
Код:
if(strcmp(cmd, "/exit", true) == 0) { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); for(new i = 0; i < sizeof(BizzInfo); i++) { if(IsPlayerInRangeOfPoint( playerid, 5.0, BizzInfo[PlayerInfo[playerid][InBusiness]][bExitX], BizzInfo[PlayerInfo[playerid][InBusiness]][bExitY], BizzInfo[PlayerInfo[playerid][InBusiness]][bExitZ])) { if(GetPlayerVirtualWorld( playerid ) > 0) { if(PlayerInfo[playerid][InBusiness] != 0) { if(PlayerInfo[playerid][pMask] == 1) { format(string, sizeof(string), "* Stranger has left the business."); } else { format(string, sizeof(string), "* %s has left the business.", sendername); } if(BizzInfo[PlayerInfo[playerid][InBusiness]][bType] == 3) { if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER); } else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE); } else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK); } else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_SMOKE_CIGGY) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY); } } else if(BizzInfo[PlayerInfo[playerid][InBusiness]][bType] == 5) { if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER); } else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE); } else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK); } else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_SMOKE_CIGGY) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY); } } else if(BizzInfo[PlayerInfo[playerid][InBusiness]][bType] == 7) { PlayerPaintballing[playerid] = 0; TogglePlayerControllable(playerid, 1); SetPlayerArmour(playerid, pKevlar[playerid]); SetPlayerHealth(playerid, pHP[playerid]); } ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[playerid][pVirtualWorld] = 0; SetPlayerVirtualWorld( playerid, 0); SetPlayerInterior( playerid, BizzInfo[PlayerInfo[playerid][InBusiness]][bExteriorID]); SetPlayerPos( playerid, BizzInfo[PlayerInfo[playerid][InBusiness]][bEntranceX], BizzInfo[PlayerInfo[playerid][InBusiness]][bEntranceY], BizzInfo[PlayerInfo[playerid][InBusiness]][bEntranceZ]); PlayerInfo[playerid][InBusiness] = 0; StopAudioStreamForPlayer(playerid); } } else { if(PlayerInfo[playerid][pMask] == 1) { format(string, sizeof(string), "* Stranger has left the business."); } else { format(string, sizeof(string), "* %s has left the business.", sendername); } ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[playerid][pVirtualWorld] = 0; SetPlayerVirtualWorld( playerid, 0 ); SetPlayerInterior( playerid, BizzInfo[i][bExteriorID]); SetPlayerPos( playerid, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]); } } } for(new i = 0; i < sizeof(MInfo); i++) { if(IsPlayerInRangeOfPoint(playerid, 3, MInfo[PlayerInfo[playerid][Inmotel]][mInteriorX], MInfo[PlayerInfo[playerid][Inmotel]][mInteriorY], MInfo[i][mInteriorZ])) { if(GetPlayerInterior(playerid) == MInfo[PlayerInfo[playerid][Inmotel]][mInteriorID] && GetPlayerVirtualWorld(playerid) >= 0) { if(PlayerInfo[playerid][Inmotel] != 0) { PlayerInfo[playerid][pVirtualWorld] = 0; SetPlayerVirtualWorld( playerid, 0 ); SetPlayerInterior( playerid, MInfo[PlayerInfo[playerid][Inmotel]][mExteriorID]); SetPlayerPos( playerid, MInfo[PlayerInfo[playerid][Inmotel]][mExteriorX], MInfo[PlayerInfo[playerid][Inmotel]][mExteriorY], MInfo[PlayerInfo[playerid][Inmotel]][mExteriorZ]); PlayerInfo[playerid][Inmotel] = 0; } else { PlayerInfo[playerid][pVirtualWorld] = 0; SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, MInfo[i][mExteriorID]); SetPlayerPos(playerid, MInfo[i][mExteriorX], MInfo[i][mExteriorY], MInfo[i][mExteriorZ]); } } } } for(new h = 0; h < sizeof(HQInfo); h++) { if(IsPlayerInRangeOfPoint(playerid,2.0,HQInfo[h][HQInsideX],HQInfo[h][HQInsideY],HQInfo[h][HQInsideZ])) { if(GetPlayerVirtualWorld(playerid) == h + 2000) { if(HQInfo[h][HQLocked]) return SendClientMessage(playerid, GREY, "HQ is locked."); SetPlayerPosEx(playerid, HQInfo[h][HQEnterX],HQInfo[h][HQEnterY],HQInfo[h][HQEnterZ]); SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, 0); SetCameraBehindPlayer(playerid); } } } for(new h = 0; h < sizeof(EntranceInfo); h++) { if(IsPlayerInRangeOfPoint(playerid,EntranceInfo[h][EntranceExitRadius],EntranceInfo[h][EntranceInsideX],EntranceInfo[h][EntranceInsideY],EntranceInfo[h][EntranceInsideZ])) { if(GetPlayerVirtualWorld(playerid) == EntranceInfo[h][EntranceVirtualWorld]) { if (EntranceInfo[h][EntranceLocked]) return SendClientMessage(playerid, GREY, "This entrance is locked."); if (EntranceInfo[h][EntranceTeleVeh] == 1) { new i = h; new vehicleid; new Seat[MAX_PLAYERS], InCar[MAX_PLAYERS]; if(GetPlayerState(playerid) == 2) { vehicleid = GetPlayerVehicleID(playerid); for(new j = 0; j < MAX_PLAYERS; j++) { if(IsPlayerInVehicle(j, vehicleid)) { InCar[j] = vehicleid; Seat[j] = GetPlayerVehicleSeat(playerid); SetPlayerInterior(j, EntranceInfo[i][EntranceExitInt]); SetPlayerVirtualWorld(j, EntranceInfo[i][EntranceExitVW]); } } SetVehiclePos(vehicleid, EntranceInfo[h][EntranceEnterX],EntranceInfo[h][EntranceEnterY],EntranceInfo[h][EntranceEnterZ]); SetVehicleZAngle(vehicleid, EntranceInfo[h][EntranceEnterA]); SetVehicleWorld(vehicleid, EntranceInfo[i][EntranceExitVW]); SetVehicleInterior(vehicleid, EntranceInfo[i][EntranceExitInt]); } SetPlayerFacingAngle(playerid, EntranceInfo[h][EntranceEnterA]); SetPlayerInterior(playerid, EntranceInfo[h][EntranceExitInt]); SetPlayerVirtualWorld(playerid, EntranceInfo[h][EntranceExitVW]); if(vehicleid != 0) { for (new j = 0; j < MAX_PLAYERS; j++) { if (InCar[j] == 0) continue; if (InCar[j] == vehicleid) { PutPlayerInVehicle(j, vehicleid, Seat[j]); } } PutPlayerInVehicle(playerid, vehicleid, 0); } } SetPlayerFacingAngle(playerid, EntranceInfo[h][EntranceEnterA]); SetPlayerInterior(playerid, EntranceInfo[h][EntranceExitInt]); SetPlayerVirtualWorld(playerid, EntranceInfo[h][EntranceExitVW]); SetCameraBehindPlayer(playerid); if (ObjectWaiting[playerid]) { ObjectWaiting[playerid] = 0; KillTimer(ObjectWaitTimer[playerid]); TogglePlayerControllable(playerid, 1); } if (EntranceInfo[h][EntranceEnterWait]) { ObjectWait(playerid, EntranceInfo[h][EntranceEnterX],EntranceInfo[h][EntranceEnterY],EntranceInfo[h][EntranceEnterZ]); } else { SetPlayerPosEx(playerid, EntranceInfo[h][EntranceEnterX],EntranceInfo[h][EntranceEnterY],EntranceInfo[h][EntranceEnterZ]); } } } } for(new i = 0; i < sizeof(HouseInfo); i++) { if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[PlayerInfo[playerid][InHouse]][hInteriorX], HouseInfo[PlayerInfo[playerid][InHouse]][hInteriorY], HouseInfo[PlayerInfo[playerid][InHouse]][hInteriorZ])) { if(GetPlayerVirtualWorld(playerid) > 0) { if(PlayerInfo[playerid][InHouse] != 0) { if(PlayerInfo[playerid][pMask] == 1) { format(string, sizeof(string), "* Stranger has left the house."); } else { format(string, sizeof(string), "* %s has left the house.", sendername); } ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[playerid][pVirtualWorld] = 0; SetPlayerVirtualWorld( playerid, 0 ); SetPlayerInterior( playerid, HouseInfo[PlayerInfo[playerid][InHouse]][hExteriorID]); SetPlayerPos( playerid, HouseInfo[PlayerInfo[playerid][InHouse]][hExteriorX], HouseInfo[PlayerInfo[playerid][InHouse]][hExteriorY], HouseInfo[PlayerInfo[playerid][InHouse]][hExteriorZ]); PlayerInfo[playerid][InHouse] = 0; } else { if(PlayerInfo[playerid][pMask] == 1) { format(string, sizeof(string), "* Stranger has left the house."); } else { format(string, sizeof(string), "* %s has left the house.", sendername); } ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[playerid][pVirtualWorld] = 0; SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, HouseInfo[i][hExteriorID]); SetPlayerPos(playerid, HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ]); } StopAudioStreamForPlayer(playerid); } } } for(new i = 0; i < sizeof(BInfo); i++) { if(IsPlayerInRangeOfPoint(playerid, 3, BInfo[PlayerInfo[playerid][Inbuilding]][bInteriorX], BInfo[PlayerInfo[playerid][Inbuilding]][bInteriorY], BInfo[i][bInteriorZ])) { if(GetPlayerInterior(playerid) == BInfo[PlayerInfo[playerid][Inbuilding]][bInteriorID] && GetPlayerVirtualWorld(playerid) >= 0) { if(PlayerInfo[playerid][Inbuilding] != 0) { PlayerInfo[playerid][pVirtualWorld] = 0; SetPlayerVirtualWorld( playerid, 0 ); SetPlayerInterior( playerid, BInfo[PlayerInfo[playerid][Inbuilding]][bExteriorID]); SetPlayerPos( playerid, BInfo[PlayerInfo[playerid][Inbuilding]][bExteriorX], BInfo[PlayerInfo[playerid][Inbuilding]][bExteriorY], BInfo[PlayerInfo[playerid][Inbuilding]][bExteriorZ]); PlayerInfo[playerid][Inbuilding] = 0; StopAudioStreamForPlayer(playerid); } else { PlayerInfo[playerid][pVirtualWorld] = 0; SetPlayerVirtualWorld(playerid, 0); SetPlayerInterior(playerid, BInfo[i][bExteriorID]); SetPlayerPos(playerid, BInfo[i][bExteriorX], BInfo[i][bExteriorY], BInfo[i][bExteriorZ]); } } } } if(PlayerPaintballing[playerid] != 0) //paintball { SetPlayerWeapons(playerid); PlayerPaintballing[playerid] = 0; SetPlayerPos(playerid,1310.0685,-1367.6198,13.5382); TogglePlayerControllable(playerid, 1); PaintballPlayers --; return 1; } if(IsPlayerInRangeOfPoint(playerid,3.0,367.62509155273,-1149.8499755859,1228.7457275391)) //FBI building { SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, 1676.8248,-1634.7830,14.2266); PlayerInfo[playerid][pInt] = 0; SetPlayerFacingAngle(playerid, 125.0000); SetCameraBehindPlayer(playerid); } else if(IsPlayerInRangeOfPoint(playerid,3.0,385.8938,173.8353,1008.3828)) //City Hall { if(GetPlayerInterior(playerid) == 101) { SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetPlayerPos(playerid, 1481.2781,-1774.8430,15.3466); SetPlayerFacingAngle(playerid, 181.8075); SetCameraBehindPlayer(playerid); } } else if(IsPlayerInRangeOfPoint(playerid,3.0,2776.5386,-1492.2943,1066.2562)) // Gun Depot Exit Point { GameTextForPlayer(playerid,"~w~Objects Loading....",1000,5); Pause(playerid); SetPlayerPos(playerid,2755.3499,-2515.5325,13.6397); GameTextForPlayer(playerid, "~w~Gun Depot", 5000, 1); } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2876.14,-2041.58,11.07)) //V.I.P Lounge { SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, 2872.64,-2041.68,11.10); SetCameraBehindPlayer(playerid); } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 3210.75,714.29,1014.14)) //HITMAN { SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, 2257.35,-71.02,31.60); SetCameraBehindPlayer(playerid); } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 391.95086669922,-1159.1645507813,1235.4501953125)) // FBI Second Floor which lead back to Elevator { SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, 389.4391,-1162.3976,1227.8639); SetCameraBehindPlayer(playerid); } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 397.96765136719,-1166.8763427734,1224.2651367188)) // FBI Prisons Floor which lead back to Elevator { SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, 393.1075,-1162.8607,1227.8639); SetCameraBehindPlayer(playerid); }