[It work on player commands that i put restriction] -- anti spam don't work too
Код:
public OnPlayerText(playerid, text[])
{
new String[128];
if(pInfo[playerid][pMute] == 1)
{
if(pInfo[playerid][pMuteTime] <= 59) format(String, sizeof(String), "You are muted for %i seconds !", pInfo[playerid][pMuteTime]);
if(pInfo[playerid][pMuteTime] >= 60) format(String, sizeof(String), "You are muted for %i minutes !", pInfo[playerid][pMuteTime] / 60);
SendClientMessage(playerid, FactColor[11], String);
return 0;
}
if(aSpam[playerid] == 1)
{
SendClientMessage(playerid, FactColor[9], "[ANTISPAM]{FFE4C4} Asteapta 2 secunde !");
if(aSpamTimer[playerid] == 0) SetTimerEx("SpamTime", 2000, false, "i", playerid);
return 0;
}
return 0;
}
Код:
// On player logged in
SetTimerEx("MuteTimer", 1000, true, "i", playerid);
// Mute command
CMD:mute(playerid, params[])
{
if(pInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, FactColor[10], "You are not authorized to use that command !");
new id, time, reason[32], String[128];
if(sscanf(params, "uis", id, time, reason)) return SendClientMessage(playerid, FactColor[11], "USAGE: /mute [PlayerID/PartOfName][Time/Minutes][Reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, FactColor[11], "That player it's not connected !");
if(time == 0 || time > 120) return SendClientMessage(playerid, FactColor[11], "The time need to be between 0-120 minutes !");
if(pInfo[id][pMute] == 1) return SendClientMessage(playerid, FactColor[11], "That player already have mute !");
format(String, sizeof(String), "Adm Cmd: %s was muted by %s for %i minutes, reason: %s", Name(id), Name(playerid), time, reason);
SendClientMessageToAll(0xA52A2AFF, String);
pInfo[id][pMute] = 1;
pInfo[id][pMuteTime] = time*60;
return 1;
}
// There it's a command where i put the restriction if player it's muted ..
CMD:f(playerid, params[])
{
new String[64];
if(pInfo[playerid][pFaction] >= 0 && pInfo[playerid][pFaction] <= 4) return SendClientMessage(playerid, FactColor[5], "That command it's only for members of families !");
if(sscanf(params, "s", String)) return SendClientMessage(playerid, FactColor[11], "USAGE: /f(amily) [Text]");
if(fMuted[playerid] == 1) return SendClientMessage(playerid, FactColor[11], "You can't speak because you are fmuted !");
if(pInfo[playerid][pMute] == 1)
{
if(pInfo[playerid][pMuteTime] <= 59) format(String, sizeof(String), "You are muted for %i seconds !", pInfo[playerid][pMuteTime]);
if(pInfo[playerid][pMuteTime] >= 60) format(String, sizeof(String), "You are muted for %i minutes !", pInfo[playerid][pMuteTime] / 60);
SendClientMessage(playerid, FactColor[11], String);
return 1;
}
if(strlen(params) > 64) return SendClientMessage(playerid, FactColor[11], "Line too long !");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pFaction] == pInfo[playerid][pFaction])
{
new String1[sizeof(String) + MAX_PLAYER_NAME + 23];
format(String1, sizeof(String1), "** %s %s: %s. ))", GetRank(pInfo[playerid][pFaction], pInfo[playerid][pRank]), Name(playerid), params);
SendClientMessage(i, 0x00CED1FF, String1);
}
}
}
return 1;
}
If anyone can help me with a script like that for mute or fix that (or tell me what it's the problem) i will give +REP (If i can)