Textdraw timer..
#1

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

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;
}
any help?
Reply
#2

three hours .. not a single reply :S .. i need solution please !
Reply
#3

Try this, not tested
pawn Код:
forward CREDITS_TIMER(playerid);
public CREDITS_TIMER(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw15);

new Str[34];
if(TimeM == 0 && TimeS == 0)
{
KillTimer(Time);
TimeS = 10;
}

format(Str, sizeof(Str), "~n~~y~this box will close automatically in~n~~p~%d seconds.",  TimeS);
TextDrawSetString(Textdraw15, Str);
SetTimer("CREDITS_TIMER",1000,false);
return TimeS--;
}
Reply
#4

Why u hide that textdraw?
Reply
#5

Quote:
Originally Posted by por12802
Посмотреть сообщение
Why u hide that textdraw?
you're right, I had only seen this now.
why hide TextDraw? .-.

pawn Код:
forward CREDITS_TIMER(playerid);
public CREDITS_TIMER(playerid)
{
new Str[34];
if(TimeM == 0 && TimeS == 0)
{
KillTimer(Time);
TimeS = 10;
}

format(Str, sizeof(Str), "~n~~y~this box will close automatically in~n~~p~%d seconds.",  TimeS);
TextDrawSetString(Textdraw15, Str);
SetTimer("CREDITS_TIMER",1000,false);
return TimeS--;
}
Reply
#6

works not can some one show me some other way to do that..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)