Help with zcmd
#6

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;
}
Reply


Messages In This Thread
Help with zcmd - by Benzke - 18.08.2012, 08:23
Re : Help with zcmd - by ricardo178 - 18.08.2012, 08:30
Re: Help with zcmd - by Benzke - 18.08.2012, 08:31
Re : Help with zcmd - by ricardo178 - 18.08.2012, 09:20
Re: Help with zcmd - by gtakillerIV - 19.08.2012, 22:30
Re: Help with zcmd - by Shetch - 20.08.2012, 00:56

Forum Jump:


Users browsing this thread: 1 Guest(s)