20.08.2012, 00:56
Here are mine, they work perfectly.
Код:
CMD:freeze(playerid, params[]) { if(PlayerData[playerid][AdminLevel] < 2) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to use this command!"); new id, string[128]; if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /freeze [ID]"); if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected!"); if(PlayerData[id][Frozen] == true) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is already frozen!"); format(string, sizeof(string), "ADMIN: You have been frozen by %s %s!", GetPlayerAdminStatus(playerid), GetPlayerRPName(playerid)); SendClientMessage(id, COLOR_BLUE, string); format(string, sizeof(string), "ADMIN: %s has been frozen!", GetPlayerRPName(id)); SendClientMessage(playerid, COLOR_BLUE, string); TogglePlayerControllable(id, false); PlayerData[id][Frozen] = true; return 1; } CMD:unfreeze(playerid, params[]) { if(PlayerData[playerid][AdminLevel] < 2) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to use this command!"); new id, string[128]; if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /unfreeze [ID]"); if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected!"); if(PlayerData[id][Frozen] == false) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not even frozen!"); format(string, sizeof(string), "ADMIN: You have been un-frozen by %s %s!", GetPlayerAdminStatus(playerid), GetPlayerRPName(playerid)); SendClientMessage(id, COLOR_BLUE, string); format(string, sizeof(string), "ADMIN: %s has been un-frozen!", GetPlayerRPName(id)); SendClientMessage(playerid, COLOR_BLUE, string); TogglePlayerControllable(id, true); PlayerData[id][Frozen] = false; return 1; }