08.02.2018, 19:18
(
Последний раз редактировалось PundacheMakalae; 08.02.2018 в 20:33.
)
<FIXED>
new CountdownNumber = -1; //setting a value to make sure it doesn't keep calling itself.
new TDTimer; //making a timer variable to kill it later
CountdownNumber = 5;// in this case its 5 seconds.
TDTimer = SetTimer("CountdownTextdraw",1000,true); //setting the timer for the function gets called every 1 second
CountdownTextdraw()
{
if(CountDownNumber != -1)
{
new TDString[10];//textdraw string
format(TDString, sizeof(TDString), "%s", CountDownNumber);//formatting the textdraw's string to hold the number value.
TextDrawSetString(textdrawid, string);//setting the textdraw's string.
TextDrawShowForPlayer(ID,textdrawid);//showing the textdraw.
CountdownNumber--;//Taking out -1 of the number's value to decrease it one by one.
}
else
{
KillTimer(TDTimer);//Killing the timer for next use
TextDrawHideForPlayer(ID, textdrawid); //hiding it after its done being used.
}
return 1;
}
As an example i'd provide is:
First go on top of the script and do: PHP код:
PHP код:
PHP код:
|