SA-MP Forums Archive
Timer - 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: Timer (/showthread.php?tid=629134)



Timer - aoky - 20.02.2017

I want to add it so after 10 seconds it will set the players color back to: SetPlayerColor(playerid, 0xFF0000);

Code:
Код:
task randomcolor[75 * 1000]()
{
	new playerid = Iter_Random(Player);
	if(Dead[playerid] == false)
	{
		SetPlayerColor(playerid, 0xF40024);
		GameTextForPlayer(playerid, "~r~You're on the map~w~!", 5000, 3);

	}
	else
		randomcolor();
	return 1;
}
I've tried the timer ex on the wiki and can't seem to do it.


Re: Timer - TopShooter - 20.02.2017

PHP код:
SetTimerEx("color"10000false"i"playerid); 
PHP код:
forward color(playerid);
public 
color(playerid)
{
   
SetPlayerColor(playerid0xFF0000);
   return 
1;




Re: Timer - aoky - 20.02.2017

Quote:
Originally Posted by TopShooter
Посмотреть сообщение
PHP код:
SetTimerEx("color"10000false"i"playerid); 
PHP код:
forward color(playerid);
public 
color(playerid)
{
   
SetPlayerColor(playerid0xFF0000);
   return 
1;

Can you add it to this code for me?
Код:
task randomcolor[75 * 1000]()
{
	new playerid = Iter_Random(Player);
	if(Dead[playerid] == false)
	{
		SetPlayerColor(playerid, 0xF40024);
		GameTextForPlayer(playerid, "~r~You're on the map~w~!", 5000, 3);

	}
	else
		randomcolor();
	return 1;
}



Re: Timer - ISmokezU - 20.02.2017

- Delete -


Re: Timer - TopShooter - 20.02.2017

Код:
task randomcolor[75 * 1000]()
{
	new playerid = Iter_Random(Player);
	if(Dead[playerid] == false)
	{
		SetPlayerColor(playerid, 0xF40024);
		GameTextForPlayer(playerid, "~r~You're on the map~w~!", 5000, 3);
                SetTimerEx("color", 10000, false, "i", playerid);  

	}
	else
		randomcolor();
	return 1;
}