19.08.2012, 22:30
Here is the freeze command with Zcmd and Sscanf, try it
First define the colors :-
Now for the command
Unfreeze command :-
Sorry if I bumped, I hope it works with you
First define the colors :-
Код:
#define Green 0x33AA33AA #define Yellow 0xFFFF00AA
Код:
CMD:freeze(playerid, params[]) { new targetid, string[128], aname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid, Yellow, "You must be an admin to use this cmd!"); if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, Green, "Correct Usage: /freeze [PlayerID]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, Yellow, "This player is not connected to the server"); if(PlayerInfo[targetid][Adminlevel] < 1) return SendClientMessage(playerid, Red, "You can't freeze another admin"); GetPlayerName(playerid, aname, MAX_PLAYER_NAME); GetPlayerName(targetid, tname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s has frozen %s", aname, tname); TogglePlayerControllable(targetid, 0); SendClientMessageToAll(Yellow, string); GameTextForPlayer(targetid, "~r~Freezed!", 2000, 2); return 1; }
Код:
CMD:unfreeze(playerid, params[]) { new targetid, string[128], aname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid, Yellow, "You must be an admin to use this cmd!"); if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, Green, "Correct Usage: /unfreeze [PlayerID]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, Yellow, "This player is not connected to the server"); GetPlayerName(playerid, aname, MAX_PLAYER_NAME); GetPlayerName(targetid, tname, MAX_PLAYER_NAME); format(string, sizeof(string), "%s has unfrozen %s", aname, tname); TogglePlayerControllable(targetid, 1); SendClientMessageToAll(Yellow, string); GameTextForPlayer(targetid, "~g~Unfreezed", 2000, 2); return 1; }