20.08.2016, 14:59
(
Последний раз редактировалось oMa37; 21.08.2016 в 13:09.
)
Try this.
PHP код:
new ChatTime[MAX_PLAYERS],
ChatText[MAX_PLAYERS][144];
public OnPlayerDisconnect(playerid, reason)
{
ChatTime[playerid] = 0;
format(ChatText[playerid], 144, "");
return 1;
}
public OnPlayerText(playerid, text[])
{
if((GetTickCount() - ChatTime[playerid]) < 1000)
{
SendClientMessage(playerid, 0xFF0000FF, "Message has been blocked");
return 0;
}
if(strlen(text) == strlen(ChatText[playerid]) && !strcmp(ChatText[playerid], text, false))
{
SendClientMessage(playerid, 0xFF0000FF, "Your message has been blocked as spam");
format(ChatText[playerid], 144, "%s", text);
return 0;
}
ChatTime[playerid] = GetTickCount();
format(ChatText[playerid], 144, "%s", text);
return 1;
}