Loop issue
#6

I just optimized it a bit and added a debug, check what does it print and make sure the value meets the conditions.

pawn Код:
forward starttime(playerid, vehicleid);
public starttime(playerid, vehicleid)
{
    static str[16];
    static amount = 30;
    static amount2 = 4;
   
    format(str, 16, "1:%d, 2:%d", amount, amout2), SendClientMessage(playerid, -1, str);
    if(amount <= 0)
    {
        amount2 = --;
       
        IsStarted[0] = true;
       
        format(str, sizeof(str), "%i", amount2);

        for(new i;i<8;i++)
        {
            if(GrottiTPlayer[i] == -1)
            {
                GameTextForPlayer(i, str, 1200, 3);
                PlayerPlaySound(i, 1056, 0, 0, 0);
                SetCameraBehindPlayer(i);
               
                for(new j; j<sizeof(GrottiT); j++) TextDrawHideForPlayer(i, GrottiT[j]);//This hides all the GrottiT textdraws
            }
        }

        if(amount2 <= 0)
        {
            KillTimer(tstarttime);
            for(new i; i < 8; i++)
            {
                if(GrottiTPlayer[i] == -1)
                {
                    TogglePlayerControllable(i, 1);
                    GameTextForPlayer(i, "GO!", 1000, 3);
                    PlayerPlaySound(i, 1057, 0, 0, 0);
                    SetPlayerRaceCheckpoint(i,0,617.816467,-1214.835815,17.872802,632.711059,-1399.011596,13.103024,6); /* Rodeo */
                    GrottiTCP[i] = 1;
                }
            }
        }
    }
    else TextDrawShowForPlayer(playerid, GrottiT[10]);
   
    amount = --;
    format(str, sizeof(str), "Start ~y~%i", amount);
    TextDrawSetString(GrottiT[10], str);
    return 1;
}
Reply


Messages In This Thread
Loop issue - by cnoopers - 07.08.2015, 10:17
Re: Loop issue - by X337 - 07.08.2015, 10:55
Re: Loop issue - by cnoopers - 07.08.2015, 11:16
Re: Loop issue - by cnoopers - 07.08.2015, 14:59
Re: Loop issue - by cnoopers - 08.08.2015, 00:06
Re: Loop issue - by xVIP3Rx - 08.08.2015, 00:49
Re: Loop issue - by cnoopers - 08.08.2015, 01:29
Re: Loop issue - by xVIP3Rx - 08.08.2015, 02:09
Re: Loop issue - by cnoopers - 08.08.2015, 02:35
Re: Loop issue - by xVIP3Rx - 08.08.2015, 02:39

Forum Jump:


Users browsing this thread: 1 Guest(s)