SA-MP Forums Archive
Text problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Text problem (/showthread.php?tid=247339)



Text problem - The Woody - 08.04.2011

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.


Re: Text problem - Unknown123 - 08.04.2011

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;
}



Re: Text problem - The Woody - 08.04.2011

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 .


Re: Text problem - The Woody - 08.04.2011

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?