07.07.2016, 19:08
Код:
forward AjailCount(playerid); public AjailCount(playerid) { if(pInfo[playerid][pJailed] != 0) { pInfo[playerid][pJailed]--; if(pInfo[playerid][pJailed] == 0) { SendClientMessage(playerid, COLOR_RED, "Your time in Ajail is over.."); SetPlayerInterior(playerid, 0);//You can change interior SetPlayerVirtualWorld(playerid, 0); //You can change virtual world SetPlayerPos(playerid, 1529.6,-1691.2,13.3); } } return 1; } CMD:ajail(playerid, params[]) { new targetid, time, reason[64]; new string[128], adminname[64], targetname[64]; if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not Admin"); if(sscanf(params, "uds[64]", targetid, time, reason)) return SendClientMessage(playerid, -1, "USAGE: /ajail <playerid> <time> <reason>"); if(time == 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Minimum 1 minute !"); GetPlayerName(targetid, targetname, MAX_PLAYER_NAME); GetPlayerName(playerid, adminname, MAX_PLAYER_NAME); pInfo[playerid][pJailed] = 1; SetPlayerPos(targetid, 346.870025, 309.259033, 999.155700); SetPlayerVirtualWorld(targetid, 2); SetPlayerInterior(targetid,6); pInfo[playerid][pJailed] = time; format(string, sizeof(string), "Administrator %s ajailed %s for %d minutes. Reason: %s", adminname, targetname, time, reason); SendClientMessageToAll(COLOR_RED, string); playertimer[targetid] = SetTimerEx("AjailCount", 60000, 1, "i", playerid); return 1; } CMD:unjail(playerid, params[]) { new targetid, string[128], adminname[64], targetname[64]; if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not admin!"); if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "USAGE: /unajail <playerid>"); if(pInfo[targetid][pJailed] == 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player not in ajail right now!"); GetPlayerName(playerid, adminname, MAX_PLAYER_NAME); GetPlayerName(targetid, targetname, MAX_PLAYER_NAME); format(string, sizeof(string), "Administrator %s took %s out of Admin Jail.", adminname, targetname); SendClientMessage(targetid,-1,string); SendMessageToAllAdmins(string, -1); SetPlayerPos(playerid, 1529.6,-1691.2,13.3); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); pInfo[playerid][pJailed] = 0; return 1; }