20.01.2013, 10:54
pawn Код:
CMD:mute(playerid, params[])
{
new id;
new reason[128];
new str[256];
new AdminName[MAX_PLAYER_NAME];
new Target[MAX_PLAYER_NAME];
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't authorized to use this command!");
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/mute (playerid/partofname) (reason)");
else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!");
else
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(id, Target, sizeof(Target));
format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, Target, reason);
SendClientMessageToAll(lightred, str);
PlayerInfo[id][isMuted] = 1;
}
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][isMuted] >= 1)
{
SendClientMessage(playerid, lightred, "[INFO]: {B4B5B7}You were muted by an Admin!");
return 0;
}
return 1;
}
pawn Код:
enum pInfo
{
isMuted,
isJailed
}
new PlayerInfo[MAX_PLAYERS][pInfo];