SA-MP Forums Archive
settimer doesnt set for everybody? - 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: settimer doesnt set for everybody? (/showthread.php?tid=264701)



settimer doesnt set for everybody? - CrazyBlob - 27.06.2011

i have a update cmd and when i type it - it only shows for me and nobody else?


heres the cmd


Код:
if (strcmp("/update", cmdtext, true, 10) == 0)//System Update CMD
	{
	    if(!IsPlayerAdmin(playerid)) return UnknownText(playerid);
        if(IsPlayerAdmin(playerid))
        {
            if(updatecheck == true) return SendClientMessage(playerid,COLOR_RED,"System Update Is Already On!");
            SendClientMessageToAll(COLOR_YELLOW, "The Server Is Going To Be Updating In 10 Minutes");
            updatecheck = true;
            SetTimer("CountDownText",1000,true);
            SetTimer("CountDownStraw",250,false);
		}
		return 1;
	}
and the timers

Count Down Text Timer
Код:
public CountDownText(playerid)
{
	TextDrawHideForPlayer(playerid, Textdraw20[playerid]);
	TextDrawHideForPlayer(playerid, Textdraw21[playerid]);
	countsec--;
	new string[128];
	format(string, sizeof(string), "~y~System Update~w~:~r~ %d:%d", countmin, countsec);
    TextDrawSetString(Textdraw20[playerid], string);
   	TextDrawShowForPlayer(playerid, Textdraw20[playerid]);
   	TextDrawShowForPlayer(playerid, Textdraw21[playerid]);
	if(countsec == 0)
    {
        countsec = 60;
        countmin--;
        TextDrawShowForPlayer(playerid, Textdraw20[playerid]);
        return 1;
    }
    ///////////////////////////////////////////////////////////
    if(countmin == 0)
    {
        if(countsec == 1)
        {
            KillTimer(CountDownKill);
            TextDrawHideForPlayer(playerid, Textdraw20[playerid]);
            TextDrawHideForPlayer(playerid, Textdraw21[playerid]);
            TextDrawSetString(Textdraw20[playerid], "~y~System Update~w~:~r~ 0:0");
            printf("[Update] The Update Time Is Up Now Updating Files...");
            updatecheck = false;
            SendRconCommand("gmx");
        }
	}
	return 1;

}
Count Down Straw Timer

Код:
public CountDownStraw(playerid)
{
    TextDrawShowForPlayer(playerid, Textdraw20[playerid]);
	TextDrawShowForPlayer(playerid, Textdraw21[playerid]);
}
please help ty


Re: settimer doesnt set for everybody? - alpha500delta - 27.06.2011

Use a loop. That way you get all players instead of 'playerid' only now.


Re: settimer doesnt set for everybody? - CrazyBlob - 27.06.2011

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
Use a loop. That way you get all players instead of 'playerid' only now.
fixed it dw