23.11.2014, 19:53
Hello i need unjail command for this jail command :
Код:
if(strcmp(cmd, "/jail", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [Playerid/PartOfName] [minutes] [reason]"); return 1; } new playa; new money; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); money = strval(tmp); if (PlayerInfo[playerid][pAdmin] >= 2) { if(IsPlayerConnected(playa)) { if(PlayerInfo[playa][pAdmin] > PlayerInfo[playerid][pAdmin]) { SendClientMessage(playerid, COLOR_GREY, "You can't jail higher level Admins !"); return 1; } if(playa != INVALID_PLAYER_ID) { GetPlayerName(playa, giveplayer, sizeof(giveplayer)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [Playerid/PartOfName] [minutes] [reason]"); return 1; } ResetPlayerWeaponsEx(playa); PlayerInfo[playa][pJail] = 1; PlayerInfo[playa][pJailTime] = money*60; SetPlayerInterior(playa, 6); InJail[playerid] = 1; SetPlayerHealth(playerid, 999999); SetPlayerPos(playa, 264.6288,77.5742,1001.0391); SetPlayerVirtualWorld(playerid, 6); format(string, sizeof(string), "You are jailed for %d minutes.", money); SendClientMessage(playa, COLOR_LIGHTBLUE, string); format(string, 256, "AdmCmd: %s has been jailed by an Admin, Reason: %s", giveplayer, (result)); SendClientMessageToAll(COLOR_LIGHTRED,string); format(string, sizeof(string), "AdmCmd: %s has been jailed by %s, Reason: %s", giveplayer, PlayerName(playerid), (result)); } } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not Admin!"); } } return 1; }