COuntDown Textdraw
#1

Hi, could someone help me on how to make a Countdown Textdraw? not a race one, but one of 60 seconds.

In the Up in the middle of the screen, so NOT in the middle


Thanks.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=118885
Reply
#3

Anyways, here :
pawn Code:
new Text:CountDownTD;
new seconds;

public OnGameModeInit()
{
  CountDownTD = TextDrawCreate(230.000000,120.000000,"60 Seconds remaining");
  TextDrawAlignment(CountDownTD,0);
  TextDrawBackgroundColor(CountDownTD,0x000000ff);
  TextDrawFont(CountDownTD,3);
  TextDrawLetterSize(CountDownTD,0.499999,1.900000);
  TextDrawColor(CountDownTD,0x0000ffff);
  TextDrawSetOutline(CountDownTD,1);
  TextDrawSetProportional(CountDownTD,1);
  TextDrawSetShadow(CountDownTD,1);
  SetTimerEx("CountDown", 1000, true, "i", playerid);
  return 1;
}

forward CountDown(playerid);
public CountDown(playerid)
{

    seconds--;
    new string[178];
    format(string,sizeof(string),"%d Seconds remaining",seconds);
    TextDrawSetString(CountDownTD,string);

   if(seconds == 0)
   {
     TextDrawHideForPlayer(playerid, CountDownTD);
     // do something else here
   }
   return 1;
}
If it has some bugs, just PM me about this.
Reply
#4

Thanks, ALso one problem,

I wanna make Checkpoints, but can i do it in the format of
Quote:

Checkpoint1 = SetPlayerCheckpoint(etc,etc,etc,etc,etc);

Reply
#5

Quote:
Originally Posted by DragonBlaster50
View Post
Thanks, ALso one problem,

I wanna make Checkpoints, but can i do it in the format of
Yeah, you can.
pawn Code:
//At the top of your GM / FS:
new Checkpoint1;
//Under OnGameModeInit:
Checkpoint1 = SetPlayerCheckpoint(...);
Reply
#6

Ah, thank you.
Reply
#7

Got Stuck Again, is their a way to define them all in 1 time?

Like
new Vehicles [4]
{
Cars here etc etc
}

but then for Checkpoints? (if so, Please give me a small example, i forgot it :P)
Reply
#8

Nevermind, got it myself
Reply
#9

Quote:
Originally Posted by ikarus
View Post
Yeah, you can.
pawn Code:
//At the top of your GM / FS:
new Checkpoint1;
//Under OnGameModeInit:
Checkpoint1 = SetPlayerCheckpoint(...);
Has no effect, as SetPlayerCheckpoint does not return an id.
Reply
#10

Also, you better use a Streamer for checkpoints, because you can only
use one if it's not streamed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)