SA-MP Forums Archive
Help TextDrawBoxColor random - 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)
+--- Thread: Help TextDrawBoxColor random (/showthread.php?tid=546007)



Help TextDrawBoxColor random - PolloLoko - 12.11.2014

Hi guys

I have a question, I wish I knew how to do "TextDrawBoxColor" In Random Color every 8 seconds

Example:

pawn Код:
public OnGameModeInit()
{
SetTimer("ColorBox",8000,1);
return 1;}

public ColorBox() //textdraw Global
{
case 0: TextDrawBoxColor(MyTextdraw, withe);
case 1: TextDrawBoxColor(MyTextdraw, red);
//....
And so every 8 seconds to change to another color


Re: Help TextDrawBoxColor random - Kyance - 12.11.2014

Quote:
Originally Posted by PolloLoko
Посмотреть сообщение
Hi guys

I have a question, I wish I knew how to do "TextDrawBoxColor" In Random Color every 8 seconds

Example:

pawn Код:
public OnGameModeInit()
{
SetTimer("ColorBox",8000,1);
return 1;}

public ColorBox() //textdraw Global
{
case 0: TextDrawBoxColor(MyTextdraw, withe);
case 1: TextDrawBoxColor(MyTextdraw, red);
//....
And so every 8 seconds to change to another color
That's pretty much how to do it, but ..
pawn Код:
forward ColorBox(); //incase you dont have it
public ColorBox() //textdraw Global
{
    new colors=random(5);
    switch(colors)
    {
        case 0: TextDrawBoxColor(MyTextdraw, white);
        case 1: TextDrawBoxColor(MyTextdraw, red);
        case 2: TextDrawBoxColor(MyTextdraw, yellow);
        case 3: TextDrawBoxColor(MyTextdraw, pink);
        case 4: TextDrawBoxColor(MyTextdraw, brown);
    }
    //TextDrawHideForAll(MyTextdraw); //if it duplicates uncomment this line(remove the //)
    TextDrawShowForAll(MyTextdraw); //Replace with TextDrawShowForPlayer, but needs to be new Text:MyTextdraw[MAX_PLAYERS]; .. or use player textdraws
    return 1;
}



Respuesta: Help TextDrawBoxColor random - PolloLoko - 13.11.2014

Thanks just wanted to verify