02.04.2011, 01:12
heres a better version. i will maybe edit it later to make it use a variable instead of pvars.
pawn Code:
public OnPlayerText(playerid, text[])
{
if((GetTickCount() - GetPVarInt(playerid, "AntiSpam")) > 1000)
{
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s (%i): %s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
SetPVarInt(playerid, "AntiSpam", GetTickCount());
}
else
{
SendClientMessage(playerid, 0xFF000FF, "You must wait atleast 1 second before using the chat again.");
}
return 0;
}