24.03.2013, 05:19
hello.. i have created an textdraw timer .. timer works fine .. but textdraw timer on screen does not respond ..
i want to show it like
"in 10 seconds"
"in 9 seconds"
"in 8 seconds"
etc..
here are codes
any help?
i want to show it like
"in 10 seconds"
"in 9 seconds"
"in 8 seconds"
etc..
here are codes
pawn Код:
new Time;
new TimeM;
new TimeS;
// filterscript int,,
Textdraw15 = TextDrawCreate(308.000000, 347.000000, "~n~~y~this box will close automatically in~n~~p~10 seconds.");
TextDrawAlignment(Textdraw15, 2);
TextDrawBackgroundColor(Textdraw15, 255);
TextDrawFont(Textdraw15, 2);
TextDrawLetterSize(Textdraw15, 0.500000, 1.000000);
TextDrawColor(Textdraw15, -1);
TextDrawSetOutline(Textdraw15, 0);
TextDrawSetProportional(Textdraw15, 1);
TextDrawSetShadow(Textdraw15, 1);
TextDrawUseBox(Textdraw15, 1);
TextDrawBoxColor(Textdraw15, 999999);
TextDrawTextSize(Textdraw15, 14.000000, 388.000000);
TextDrawSetSelectable(Textdraw15, 0);
TimeM = 0;
TimeS = 10;
// in command ..
Time = SetTimerEx("CREDITS_TIMER", 10*1000, false, "i", playerid);
//
forward CREDITS_TIMER(playerid);
public CREDITS_TIMER(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw15);
new Str[34];
TimeS --;
if(TimeM == 0 && TimeS == 0)
{
KillTimer(Time);
}
TimeS = 10;
format(Str, sizeof(Str), "~n~~y~this box will close automatically in~n~~p~%02d seconds.", TimeS);
TextDrawSetString(Textdraw15, Str);
return 1;
}