#1

I use this timer to change the textdraw every 2 min. but it change only 1 time and doesn't change again

pawn Код:
SetTimer("TextDrawChange",120000,1);
public TextDrawChange()
{
    new crand =random(6);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(crand == 1)
    {
        TextDrawHideForPlayer(i,Message1);
        TextDrawHideForPlayer(i,Message2);
        TextDrawHideForPlayer(i,Message3);
        TextDrawHideForPlayer(i,Message4);
        TextDrawHideForPlayer(i,Message5);
        TextDrawHideForPlayer(i,Message6);
        TextDrawShowForPlayer(i,Message1);
    }
    if(crand == 2)
    {
        TextDrawHideForPlayer(i,Message1);
        TextDrawHideForPlayer(i,Message2);
        TextDrawHideForPlayer(i,Message3);
        TextDrawHideForPlayer(i,Message4);
        TextDrawHideForPlayer(i,Message5);
        TextDrawHideForPlayer(i,Message6);
        TextDrawShowForPlayer(i,Message2);
    }
    if(crand == 3)
    {
        TextDrawHideForPlayer(i,Message1);
        TextDrawHideForPlayer(i,Message2);
        TextDrawHideForPlayer(i,Message3);
        TextDrawHideForPlayer(i,Message4);
        TextDrawHideForPlayer(i,Message5);
        TextDrawHideForPlayer(i,Message6);
        TextDrawShowForPlayer(i,Message3);
    }
    if(crand == 4)
    {
        TextDrawHideForPlayer(i,Message1);
        TextDrawHideForPlayer(i,Message2);
        TextDrawHideForPlayer(i,Message3);
        TextDrawHideForPlayer(i,Message4);
        TextDrawHideForPlayer(i,Message5);
        TextDrawHideForPlayer(i,Message6);
        TextDrawShowForPlayer(i,Message4);
    }
    if(crand == 5)
    {
        TextDrawHideForPlayer(i,Message1);
        TextDrawHideForPlayer(i,Message2);
        TextDrawHideForPlayer(i,Message3);
        TextDrawHideForPlayer(i,Message4);
        TextDrawHideForPlayer(i,Message5);
        TextDrawHideForPlayer(i,Message6);
        TextDrawShowForPlayer(i,Message5);
    }
    if(crand == 6)
    {
        TextDrawHideForPlayer(i,Message1);
        TextDrawHideForPlayer(i,Message2);
        TextDrawHideForPlayer(i,Message3);
        TextDrawHideForPlayer(i,Message4);
        TextDrawHideForPlayer(i,Message5);
        TextDrawHideForPlayer(i,Message6);
        TextDrawShowForPlayer(i,Message6);
    }
    }
    }
}
Reply
#2

random(6) is from 0 to 5
Reply
#3

But you're using TextDrawHideForPlayer, what should be changing in that?
Second question, did you forward the timer?
Third question, do you possibly have any KillTimer in your script?
Reply
#4

Quote:
Originally Posted by Jefff
Посмотреть сообщение
random(6) is from 0 to 5
this Fixed it , thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)