Command server - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command server (
/showthread.php?tid=254912)
Command server -
StilThere - 13.05.2011
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
Re: Command server -
Sascha - 13.05.2011
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;
}
Re: Command server -
StilThere - 13.05.2011
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?
Re: Command server -
Seven_of_Nine - 13.05.2011
RCON say is the only avaible I think
Re: Command server -
StilThere - 13.05.2011
And you can ue OnRconCommand, which I did now, it's working, thanks!