08.08.2015, 00:49
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;
}