03.05.2017, 00:56
Hi there when i use the cmd /arrest it sends me into the cell and the prisoner into the air and he falls and dies then. I don't know what could be the problem. theres the code
Код:
CMD:arrest(playerid, params[]) { new rand = random(sizeof(RandomAPrison)); new playerb, time, string[128], fine; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(!IsACop(playerid) && !IsFBI(playerid) && !IsARES(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a LEO."); if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty."); if(!IsPlayerNearArrestPoint(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the arrest point."); if(sscanf(params, "uis[64]", playerb, time, fine)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /arrest [playerid] [minutes] [price]"); if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id."); if(fine <=0 || fine > 5000)return SendClientMessage(playerid, COLOR_GREY, "Invalid money amount(0-5000)."); if(!PlayerInfo[playerb][pWanted]) return SendClientMessage(playerid, COLOR_GREY, "Player is not wanted."); if(IsACop(playerb) && IsFBI(playerb) && IsARES(playerb)) return SendClientMessage(playerid, COLOR_GREY, "You can't arrest an BCSD Officer."); if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player."); format(string, sizeof(string), "Local Prison: %s has been arrested by %s.", RPN(playerb), RPN(playerid)); foreach(Player, i) { if(IsACop(i) || IsFBI(i) || IsARES(i)) { SendClientMessage(i, COLOR_BLUE, string); } } SetPlayerColor(playerb, TRANSPARENT_ORANGE); PlayerInfo[playerb][pArrested] ++; PlayerInfo[playerb][pPrison] = 2; PlayerInfo[playerb][pPrisonTime] = time*60; GiveDodMoney(playerb, -fine); ClearDodWantedLevels(playerb); SetPlayerInterior(playerb, 0); SetPlayerVirtualWorld(playerb, 0); SetPlayerPos(playerid, RandomAPrison[rand][0], RandomAPrison[rand][1],RandomAPrison[rand][2], RandomAPrison[rand][3], RandomAPrison[rand][4],RandomAPrison[rand][5], RandomAPrison[rand][6], RandomAPrison[rand][7],RandomAPrison[rand][8], RandomAPrison[rand][9], RandomAPrison[rand][10],RandomAPrison[rand][11], RandomAPrison[rand][12], RandomAPrison[rand][13]); SetPlayerFacingAngle(playerb, 90.0); TogglePlayerControllable(playerb, 0); SetTimerEx("EnterExitTimer", 5000, false, "i", playerb); SetCameraBehindPlayer(playerb); format(string, sizeof(string), " You have been arrested by an officer for %d minutes (%d seconds) and fined $%d", PlayerInfo[playerb][pPrisonTime]/60, PlayerInfo[playerb][pPrisonTime], fine); SendClientMessage(playerb, COLOR_LIGHTBLUE, string); RemovePlayerAttachedObject(playerb, 0); SetPlayerSpecialAction(playerb, SPECIAL_ACTION_NONE); // Clearing robbery if(BankRobber[playerb]) { new Rob = BankRobber[playerb]-1; DisablePlayerCheckpoint(playerb); BankRobbersCount --; format(BankRobbers[Rob], MAX_PLAYER_NAME, ""); DeliverMoney[playerb] = 0; // foreach(Player, i) { if(BankRobber[i] || PlayerInfo[i][pFac] == 1) { if(Rob == 0) TextDrawHideForPlayer(i, Textdraw1); else if(Rob == 1) TextDrawHideForPlayer(i, Textdraw2); else if(Rob == 2) TextDrawHideForPlayer(i, Textdraw3); else if(Rob == 3) TextDrawHideForPlayer(i, Textdraw4); else if(Rob == 4) TextDrawHideForPlayer(i, Textdraw5); } } format(string, sizeof(string), "** %s has been arrested and has failed the robbery. **", RPN(playerb)); SendRobberyMessage(COLOR_LIGHTRED, string); SendCopMessage(COLOR_LIGHTRED, string); BankRobber[playerb] = 0; if(BankRobbersCount == 0) { TextDrawHideForAll(Textdraw0); TextDrawHideForAll(Textdraw1); TextDrawHideForAll(Textdraw2); TextDrawHideForAll(Textdraw3); TextDrawHideForAll(Textdraw4); TextDrawHideForAll(Textdraw5); // BankRobbery = 0; RobberyStarted = 0; TotalRobbers = 0; new copsonline; foreach(Player, i) { if(IsACop(i) || IsFBI(i) || IsARES(i)) copsonline++; } foreach(Player, i) { if(IsACop(i) || IsFBI(i) || IsARES(i)) { new Saved = (TotalRobbers*50000-(TotalStolen*50000)); format(string, sizeof(string), "** You have received your cut from the saved money. ($%d)", Saved/copsonline); SendClientMessage(i, COLOR_LIME, string); } } } } return 1; }