Help TextDrawBoxColor random
#1

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
Reply
#2

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;
}
Reply
#3

Thanks just wanted to verify
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)