Text problem
#1

Okay i have this text. But i need a timer so every seconds the text changes to another text. I know how to make a timer. But isnt there a easyer way to change the text instead of making a whole new text earch time.

Ex:

1 second: 20
2 second: 19
3 second: 18
...

pawn Код:
TextTimer = TextDrawCreate(550.000000,402.000000,"20");
TextDrawAlignment(TextTimer,0);
TextDrawBackgroundColor(TextTimer,0x000000ff);
TextDrawFont(TextTimer,2);
TextDrawLetterSize(TextTimer,0.599999,2.100000);
TextDrawColor(TextTimer,0xff000099);
TextDrawSetProportional(TextTimer,1);
TextDrawSetShadow(TextTimer,1);
So isnt there another way instead of creating a new text earch time.
Reply
#2

Quote:
Originally Posted by The Woody
Посмотреть сообщение
Okay i have this text. But i need a timer so every seconds the text changes to another text. I know how to make a timer. But isnt there a easyer way to change the text instead of making a whole new text earch time.

Ex:

1 second: 20
2 second: 19
3 second: 18
...

pawn Код:
TextTimer = TextDrawCreate(550.000000,402.000000,"20");
TextDrawAlignment(TextTimer,0);
TextDrawBackgroundColor(TextTimer,0x000000ff);
TextDrawFont(TextTimer,2);
TextDrawLetterSize(TextTimer,0.599999,2.100000);
TextDrawColor(TextTimer,0xff000099);
TextDrawSetProportional(TextTimer,1);
TextDrawSetShadow(TextTimer,1);
So isnt there another way instead of creating a new text earch time.
Something like this? or not? :P

pawn Код:
public OnGameModeInit()
{
    SetTimer("SendRandomMessageToAll", 120000, 1);
    return 1;
}
public SendRandomMessageToAll()
{
    switch(random(4))
    {
        case 0: TextDrawSetString(TextTimer, "Apple pie for everyone!");
        case 1: TextDrawSetString(TextTimer, "ID 0 is nub!");
        case 2: TextDrawSetString(TextTimer, "Everyone gonna be banned soon!");
        case 3: TextDrawSetString(TextTimer, "Hacking is ALLOWED!");
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Unknown123
Посмотреть сообщение
Something like this? or not? :P

pawn Код:
public OnGameModeInit()
{
    SetTimer("SendRandomMessageToAll", 120000, 1);
    return 1;
}
public SendRandomMessageToAll()
{
    switch(random(4))
    {
        case 0: TextDrawSetString(TextTimer, "Apple pie for everyone!");
        case 1: TextDrawSetString(TextTimer, "ID 0 is nub!");
        case 2: TextDrawSetString(TextTimer, "Everyone gonna be banned soon!");
        case 3: TextDrawSetString(TextTimer, "Hacking is ALLOWED!");
    }
    return 1;
}
Nah.. Its a timer hmm like a taxi timer every second the text changes to another number like 20, 19, 18, 17...'

EDIT: Actuelly! ive looked further on your code and i misunderstood thanks .
Reply
#4

Is there a way to make it switch to case 0 then case 1 then case 2 and so on.. because that "switch random" is just choosing a random case?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)