Command server
#1

Hi all,

is it possible to let a server perform a certain action at a certain time, like SendClientMessageToAll(COLOR_WHITE,.. etcetera without having to be ingame?

Please if, tell me how.

thanks
Reply
#2

yes you can...
you can use a rcon cmd, which would mean that you don't have to be on the server but on the console..
another way (indepent from you) would be to use a timer or just a gettime function...

if you want to send the msg in a certain period then you could use this:

pawn Код:
public OnGameModeInit()
{
  SetTimer("SendMessage", seconds * 1000, true); //replace seconds with the amount of seconds you want to use..
  return 1;
}

forward SendMessage();
public SendMessage()
{
  SendClientMessageToAll(COLOR, "text");
  return 1;
}
or with gettime (this requires a timer, too)
pawn Код:
public OnGameModeInit()
{
  SetTimer("CheckTime", 30000, true);
  return 1;
}

forward CheckTime();
public CheckTime()
{
  new h, m, s;
  gettime(h, m, s); //h = hour, m = minute, s = second
  if(h == 12 && m == 0) //change the numbers (12 and 0) to the hour and minute you want the msg to show.
  {
    SendClientMessageToAll(COLOR, "text");
  }
  return 1;
}
Reply
#3

no i don't want it on period
i just want to send a message ingame without being ingame myself at a time I choose get it?
what is the command for the console?
Reply
#4

RCON say is the only avaible I think
Reply
#5

And you can ue OnRconCommand, which I did now, it's working, thanks!
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)