22.08.2012, 17:34
I really need a timer for the /mute command and I got no idea...
The command
The command
pawn Код:
if(strcmp(cmd, "/mute", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /mute [playerid/PartOfName]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playa][pMuted] == 0)
{
PlayerInfo[playa][pMuted] = 1;
printf("AdmCmd: %s silenced %s",sendername, giveplayer);
format(string, sizeof(string), "I have given to %s /mute", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You got /mute from %s", sendername);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "AdmCmd: %s a primit Mute de la %s", giveplayer, sendername);
ABroadCast(COLOR_RED,string,1);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command !");
}
}
return 1;
}