Problem with Command /mute
#2

This is the right code edit it and make an time on /mut'ing someone

Quote:

CMD:mute(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128], giveplayerid;
if(sscanf(params, "i", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /mute [playerid]");

if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You can not use this command on yourself!");
return 1;
}

if(PlayerInfo[giveplayerid][pMuted] == 0)
{
if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
{
format(string, sizeof(string), "%s just tried to /mute you.",GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
return 1;
}
PlayerInfo[giveplayerid][pMuted] = 1;
format(string, sizeof(string), "AdmCmd: %s was silenced by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx (playerid));
ABroadCast(COLOR_LIGHTRED,string,2);
}
else
{
PlayerInfo[giveplayerid][pMuted] = 0;
format(string, sizeof(string), "AdmCmd: %s was unsilenced by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx (playerid));
ABroadCast(COLOR_LIGHTRED,string,2);
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}

Reply


Messages In This Thread
Problem with Command /mute - by John997 - 04.09.2015, 12:47
Re: Problem with Command /mute - by Nour1 - 04.09.2015, 13:18

Forum Jump:


Users browsing this thread: 2 Guest(s)