Professional timed messages? - 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)
+--- Thread: Professional timed messages? (
/showthread.php?tid=371008)
Professional timed messages? -
Guitar - 22.08.2012
Hello,
I know how to make these, but is there any way to make the messages professional? Because, as long as the server runs, as long as the timed messages will spam the server, they are more into random messages. So, I want something like, to check if the player is paused or tabbing, not to send the messages and like send these messages every 30 minutes?
Re: Professional timed messages? -
leonardo1434 - 22.08.2012
If you want to check if the player is paused, just do that.(never tested that, but it should work i guess.)
pawn Код:
new timecheck[MAX_PLAYERS],works[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
if(!GetPlayerAnimationIndex(playerid)) timecheck[playerid] = gettime() + 60*30; // 30 minutes...
}
public OnPlayerConnect(playerid)
{
works[playerid] = SetTimerEx("checkup",1000,true,"i",playerid);
}
forward checkup(playerid);
public checkup(playerid)
{
for(playerid = 0; playerid != MAX_PLAYERS; ++ playerid)
{
if(timecheck[playerid] < gettime()) {
// functions here.
}
}
}
// and put that on onplayerdisconnect
KillTimer(works[playerid]);
Re: Professional timed messages? -
Guitar - 22.08.2012
Nice, so the functions goes for uh the messages?