14.04.2011, 03:04
I didn't look much at the code- its unorganized and hard to read; your methods need some work as well. See if the system below works. If it does, we will continue to incorporate extra features into the system until it is working like it should. You will need to show some effort though; I am not going to waste my time helping you if you aren't willing to try and get things to work if they end up not working.
WARNING: This code has not been tested.
pawn Код:
native sscanf(const data[], const format[], {Float,_}:...);
public OnPlayerText(playerid, text[])
{
if(GetPVarInt(playerid, "Muted") == 1)
return 0, SendClientMessage(playerid, 0xFFFFFFAA, "ATTENTION: You have been muted and cannot use the chat!");
return 1;
}
CMD:mute(playerid, params[])
{
new id;
if(!IsPlayerAdmin(playerid)) return false;
if(sscanf(params, "u", id))
return SendClientMessage(playerid, 0xFFFFFFAA, "SYNTAX: /mute [playerid]");
if(GetPVarInt(id, "Muted") == 1)
{
SetPVarInt(id, "Muted", 0);
SendClientMessage(id, 0xFFFFFFAA, "ATTENTION: You have been unmuted by an administrator.");
SendClientMessage(playerid, 0xFFFFFFAA, "Player unmuted.");
}
else if(GetPVarInt(id, "Muted") == 0)
{
SetPVarInt(id, "Muted", 1);
SendClientMessage(id, 0xFFFFFFAA, "ATTENTION: You have been muted by an administrator.");
SendClientMessage(playerid, 0xFFFFFFAA, "Player muted.");
}
else SendClientMessage(playerid, 0xFFFFFFAA, "SYSTEM ERROR, PLEASE CONTACT SCRIPT DEVELOPER.");
return 1;
}