02.08.2012, 06:57
That's easy to make.
- Create a global variable for each playerpawn Код:new ChatTime[MAX_PLAYERS];
- When Player Connect set value to 0pawn Код:public OnPlayerConnect(playerid)
{
ChatTime[playerid] = 0;
return 1;
} - When he enters text get time.pawn Код:public OnPlayerText(playerid, text[])
{
new time = gettime();//get current time in unix
//see if difference is less than 3 seconds
if ((time - ChatTime[playerid]) < 3)
{
SendClientMessage(playerid,-1,"You can send message only once in 3 secomds");
return 0;
}
//if not then get the time they last used chat.
ChatTime[playerid] = gettime();
return 1;
}