21.03.2014, 07:21
Try this:
Код:
COMMAND:ar(playerid,params[]) { new pId; new pskin = GetPlayerSkin(playerid); if(gTeam[playerid] == TEAM_COPS) { if(sscanf(params, "d", pId)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /ar [ID]"); else if(!IsPlayerConnected(pId)) return SendClientMessage(playerid, 0xFF0000AA, "The ID You Entered Was Not Found."); else { new Float:x, Float:y, Float:z; GetPlayerPos(pId, x, y, z); if(IsPlayerInRangeOfPoint(playerid, 12.0, x, y, z)) { new pname[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME], string1[250], string2[256], string3[100], string4[100]; GetPlayerName(playerid, pname, sizeof(pname)); GetPlayerName(pId, aname, sizeof(aname)); if (GetPlayerWantedLevel(pId) == 0) { SendClientMessage(playerid, 0xFF0000AA, "This Player Is Not Wanted!"); return 1; } else if (GetPlayerWantedLevel(pId) == 1) { SendClientMessage(playerid, 0xFF0000AA, "Error: this player has to high of a wanted level use /tk"); return 1; } else if (GetPlayerWantedLevel(pId) > 1) { new WantedLevel = GetPlayerWantedLevel(pId); SetPlayerInterior(pId, 3); new rand = random(sizeof(JailCellSpawns)); SetPlayerPos(pId, JailCellSpawns[rand][0], JailCellSpawns[rand][1], JailCellSpawns[rand][2]); SetTimerEx("UnJail",WantedLevel*1000*60,0,"i",pId); InJail[pId] = 1; GivePlayerMoney(pId, -WantedLevel*1000); GivePlayerMoney(playerid, WantedLevel*1000); SetPlayerWantedLevel(pId, 0); format(string1, sizeof(string1), "%s(%d) Has Ben Arrested By Officer %s(%d)", aname, pId, pname, playerid); SendClientMessageToAll(0xFF0000AA, string1); format(string2, sizeof(string2), "You Have Ben Sent To Jail For %s Minuets For Having A Level %s Wanted Level!", WantedLevel, WantedLevel); SendClientMessage(pId, 0xFF0000AA, string2); format(string3, sizeof(string3), "You Have Recived A %s000 Bonus For Arresting A Level %s Suspect!", WantedLevel, WantedLevel); SendClientMessage(playerid, 0xFF0000AA, string3); format(string4, sizeof(string4), "You Have Payed A %s000 Penalty On Your Arrest For Having A %s Wanted Level!", WantedLevel, WantedLevel); SendClientMessage(pId, 0xFF0000AA, string4); return 1; } } } } else { return SendClientMessage(playerid, 0xFF0000AA, "Error: You are not a police officer!"); } return 1; }