SendClientMessage timed
#12

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.
pawn Код:
forward SendClientMessageEx(playerid, color,msg[]);

public SendClientMessageEx(playerid, color, msg[])
{
    SendClientMessage(playerid, pgreen3, msg);
}
2.Lets define some variables
pawn Код:
new foursecondtimer;
forward FourSecondTimer();
3.Now we place our timer in our ongamemodeinit callback
pawn Код:
public OnGameModeInit()
{
  foursecondtimer = SetTimer("FourSecondTimer", 4000, true);
  return 1;
}
4.Now we create our FourSecondTimer callback
pawn Код:
public FourSecondTimer()
{
  for(new i=0; i<=GetMaxPlayers(); i++)
  {
    SendClientMessage(i, pgreen3, "string here"); // <- thanks for using my colors inc haha.
  }
  return 1;
}
Just fill in where it says "string here" with what you want printed every 4 seconds, and it works
Reply


Messages In This Thread
SendClientMessage timed - by CracK - 11.03.2009, 07:03
Re: SendClientMessage timed - by Burridge - 11.03.2009, 07:45
Re: SendClientMessage timed - by CracK - 11.03.2009, 08:48
Re: SendClientMessage timed - by Dujma - 11.03.2009, 08:54
Re: SendClientMessage timed - by CracK - 11.03.2009, 10:13
Re: SendClientMessage timed - by CracK - 11.03.2009, 11:22
Re: SendClientMessage timed - by CracK - 11.03.2009, 16:13
Re: SendClientMessage timed - by CracK - 12.03.2009, 14:39
Re: SendClientMessage timed - by NigNog1 - 12.03.2009, 15:35
Re: SendClientMessage timed - by Simon - 12.03.2009, 23:41
Re: SendClientMessage timed - by CracK - 13.03.2009, 08:54
Re: SendClientMessage timed - by Kinetic - 13.03.2009, 09:31
Re: SendClientMessage timed - by CracK - 13.03.2009, 09:41
Re: SendClientMessage timed - by Kinetic - 13.03.2009, 09:48
Re: SendClientMessage timed - by CracK - 13.03.2009, 10:18
Re: SendClientMessage timed - by Kinetic - 13.03.2009, 11:17
Re: SendClientMessage timed - by CracK - 13.03.2009, 11:33

Forum Jump:


Users browsing this thread: 1 Guest(s)