16.04.2009, 20:36
//Top of script:
//OnPlayerText:
//OnPlayerCommandText:
Код:
new bool:ChatBlocked;
Код:
public OnPlayerText(playerid, text[])
{
if(ChatBlocked == true && !IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0xFF0000AA, "Sorry, the admins blocked the chat");
return 0;
}
return 1;
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/blockchat", true)==0 && IsPlayerAdmin(playerid))
{
if(ChatBlocked == false)
{
ChatBlocked = true;
SendClientMessageToAll(0xFF0000AA, "The Admins blocked the chat!");
}
else
{
ChatBlocked = false;
SendClientMessageToAll(0x00FF00AA, "The Admins unblocked the chat!");
}
return 1;
}
return 0;
}

