10.04.2011, 03:48
When I mute someone he can talks :/
*Edit: This is an include.
pawn Код:
CMD:mute(playerid, params[])
{
new string[256];
if(!IsAdmin(playerid)) return NotAdmin(playerid);
new muteid, mutetime, reason[256];
new nameid[20];
if(sscanf(params, "s[20]I(2)S(No reason)[80]", nameid, mutetime, reason)){
return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /mute [id] [minutes] [reason]");
}
if(ReturnUser(nameid,playerid) == -1)
{
return 1;
} else {
muteid = ReturnUser(nameid, playerid);
}
if(!IsPlayerConnected(muteid)){
return SendClientMessage(playerid, COLOR_YELLOW, "Player is not connected !");
}
new file[256];
file = GetUserPath(muteid,1);
if(dini_Int(file,"muted")){
return SendClientMessage(playerid, COLOR_YELLOW, "Player is already muted !");
}
mutetime = mutetime * 60;
format(string, sizeof string, "%s has been muted %i seconds by %s for %s", GetName(muteid), mutetime, GetName(playerid), reason);
SendClientMessageToAll(COLOR_RED_SHINY, string);
format(string, sizeof string, "You have been muted %i seconds !", mutetime);
SendClientMessage(muteid,COLOR_RED_SHINY, string);
dini_IntSet(file, "mute_t", GetTickCount() + mutetime * 1000);
dini_IntSet(file, "muted", 1);
dini_IntSet(file, "mute_s", mutetime * 1000);
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
new file[256];
file = GetUserPath(playerid);
LogChat(playerid, text);
if(dini_Int(file, "muted")) {
SendClientMessage(playerid, COLOR_YELLOW, "You are muted PM an administrator if you think you were muted incorrectly");
return 0;
}
return 1;
}