13.07.2015, 13:57
How can i set time for jail,i mean how can i make this command like /jail <id> <time>
Код:
CMD:jail(playerid, params[]) { new str[128], id, reason[128]; new rand = random(sizeof(JailRandomSpawn)); if(PlayerInfo[playerid][pAdmin] >= 3) { if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_LIME, "[FR Usage] /jail (id) (reason)"); if(id == INVALID_PLAYER_ID) return ErrorMessages(playerid, 2); if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return ErrorMessages(playerid, 3); if(PlayerInfo[id][Jail] == 1) return SendClientMessage(playerid, COLOR_RED, "That player is already in jail!"); PlayerInfo[id][Jail] = 1; ResetPlayerWeapons(id); SetPlayerPos(id, JailRandomSpawn[rand][0], JailRandomSpawn[rand][1], JailRandomSpawn[rand][2]); SetPlayerFacingAngle(id, JailRandomSpawn[rand][3]); SetPlayerInterior(id, 3); format(str, sizeof(str), "Admin %s(%d) has jailed %s(%d) (Reason:%s)", GetName(playerid), playerid, GetName(id), id, reason); SendClientMessageToAll(BAN, str); JailLog(playerid, id, reason); PlayerInfo[id][JailC]++; format(str, sizeof(str), "You jailed %s(%d) for (Reason:%s)", GetName(id), id, reason); SendClientMessage(playerid, BAN, str); format(str, sizeof(str), ""COL_GREEN"\nYou have been jailed\n(Reason:%s)", reason); ShowPlayerDialog(id, 122, DIALOG_STYLE_MSGBOX, ""COL_GREEN"Jailed", str, "OK", ""); } else return ErrorMessages(playerid, 1); return 1; }