Set timer inside a textdraw
#7

Код:
new RESPAWN_COUNT[MAX_PLAYERS] = 0;
public OnPlayerConnect(playerid)
{

    RESPAWN_COUNT[playerid] = 0; // reseting variable.
 
	if(RESPAWN_COUNT[playerid] == 0)
	{
       RESPAWN_COUNT[playerid] = 10; // setting respawn count to 10 seconds
	   playertimer[playerid] = SetTimerEx("RespawnCount", 1000, true, "i", playerid);
	}
	return 1;
}





public RespawnCount(playerid)
{
    RESPAWN_COUNT[playerid] --; //decreases the count every 1 secoond. (10, 9, 8...,0)
    if(RESPAWN_COUNT[playerid] == 0)
    {
        KillTimer(playertimer[playerid]);
    }
    else
    {
        new str[32];
        format(str, sizeof(str), "RESPAWN IN %d", RESPAWN_COUNT[playerid]);
        TextDrawSetString(TDEditor_TD[1],str); 
    }
    return 1;
}
Something like this!
Reply


Messages In This Thread
Set timer inside a textdraw - by Zeus666 - 29.09.2018, 11:32
Re: Set timer inside a textdraw - by TheToretto - 29.09.2018, 11:53
Re: Set timer inside a textdraw - by Zeus666 - 29.09.2018, 12:12
Re: Set timer inside a textdraw - by Zeus666 - 29.09.2018, 12:40
Re: Set timer inside a textdraw - by d3Pedro - 29.09.2018, 13:21
Re: Set timer inside a textdraw - by Zeus666 - 29.09.2018, 13:23
Re: Set timer inside a textdraw - by UFF - 29.09.2018, 15:02
Re: Set timer inside a textdraw - by Zeus666 - 29.09.2018, 15:06
Re: Set timer inside a textdraw - by UFF - 29.09.2018, 15:21
Re: Set timer inside a textdraw - by Zeus666 - 29.09.2018, 16:07

Forum Jump:


Users browsing this thread: 3 Guest(s)