24.02.2013, 15:47
(
Последний раз редактировалось GoldZoroGrab; 24.02.2013 в 15:51.
Причина: forgot to add /unmute
)
pawn Код:
new mute[MAX_PLAYERS];
command(mute, playerid, params[])
{
new ID;
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /mute [id]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
else
{
if(mute[ID]==0)
{
mute[ID]=1;
SendClientMessage(ID, 0xFF0000AA, "You have been muted.");
}
else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player already muted.");
}
return 1;
}
pawn Код:
command(unmute, playerid, params[])
{
new ID;
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /mute [id]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
else
{
if(mute[ID]==1)
{
SendClientMessage(ID, 0xFF0000AA, "You have been unmuted.");
mute[ID]=0;
}
else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player isn't muted.");
}
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
if(mute[playerid]==1)
{
SendClientMessage(playerid, 0xC0C0C0FF, "You are muted and cannot talk.");
return 0;
}
return 1;
}