10.09.2013, 20:07
Hi guys, i'm making a race but i've a problem with for(new i = 0; i < MAX_PLAYERS; i++). The cd is repeated a lot of times and i'm sure that i've done a terrible mess with the script:
pawn Код:
public Start5()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerRace[i] == true)
{
GameTextForPlayer(i, "~y~5", 1500, 3);
SetTimer("Start4", 1000, false);
PlayerPlaySound(i, 1056, 0, 0, 0);
}
}
return 1;
}
public Start4()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerRace[i] == true)
{
GameTextForPlayer(i, "~b~4", 1500, 3);
SetTimer("Start3", 1000, false);
PlayerPlaySound(i, 1056, 0, 0, 0);
}
}
return 1;
}
public Start3()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerRace[i] == true)
{
GameTextForPlayer(i, "~p~3", 1500, 3);
SetTimer("Start2", 1000, false);
PlayerPlaySound(i, 1056, 0, 0, 0);
}
}
return 1;
}
public Start2()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerRace[i] == true)
{
GameTextForPlayer(i, "~y~2", 1500, 3);
SetTimer("Start1", 1000, false);
PlayerPlaySound(i, 1056, 0, 0, 0);
}
}
return 1;
}
public Start1()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerRace[i] == true)
{
GameTextForPlayer(i, "~r~1", 1500, 3);
SetTimer("StartGo", 1000, false);
PlayerPlaySound(i, 1056, 0, 0, 0);
}
}
return 1;
}
public StartGo()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerRace[i] == true)
{
GameTextForPlayer(i, "~g~go!", 1000, 3);
PlayerPlaySound(i, 1057, 0, 0, 0);
TogglePlayerControllable(i, 1);
DisablePlayerRaceCheckpoint(i);
SetPlayerRaceCheckpoint(i, 0, 1156.5406,-877.0353,43.8308, 1166.3489,-731.7609,60.8410, 20.0);
CountCheck[i] = 1;
Partenza = true;
racez[i] = true;
}
}
return 1;
}