13.03.2009, 09:31
So by what I am reading, you want something printed in the chatbox every 4 seconds.
Lets do it like this... (I am assuming you want this message to send to all players)
1. First of all, there is no need for SendClientMessageEx because there is nothing that it is doing except adding the Ex to the end of the function name, I am going to discard this.
2.Lets define some variables
3.Now we place our timer in our ongamemodeinit callback
4.Now we create our FourSecondTimer callback
Just fill in where it says "string here" with what you want printed every 4 seconds, and it works
Lets do it like this... (I am assuming you want this message to send to all players)
1. First of all, there is no need for SendClientMessageEx because there is nothing that it is doing except adding the Ex to the end of the function name, I am going to discard this.
pawn Код:
forward SendClientMessageEx(playerid, color,msg[]);
public SendClientMessageEx(playerid, color, msg[])
{
SendClientMessage(playerid, pgreen3, msg);
}
pawn Код:
new foursecondtimer;
forward FourSecondTimer();
pawn Код:
public OnGameModeInit()
{
foursecondtimer = SetTimer("FourSecondTimer", 4000, true);
return 1;
}
pawn Код:
public FourSecondTimer()
{
for(new i=0; i<=GetMaxPlayers(); i++)
{
SendClientMessage(i, pgreen3, "string here"); // <- thanks for using my colors inc haha.
}
return 1;
}

