07.06.2010, 12:27
Hello,
Im trying to make a race script,
And ive run into a little problem with the countdown,
What i want it to do is,
Check if theres more than 1 player online, If there is.
It will start a timer. But when theres 2 people online my server, I never see the countdown?
This is my code: (Unfinished)
Oh and:
Im trying to make a race script,
And ive run into a little problem with the countdown,
What i want it to do is,
Check if theres more than 1 player online, If there is.
It will start a timer. But when theres 2 people online my server, I never see the countdown?
This is my code: (Unfinished)
pawn Код:
public CheckPlayers()
{
if(RaceStarted == 0)
{
if(GetOnlinePlayers() > 1)
{
SetTimer("Countdown", 1000, 0);
RaceStarted = 1;
GameTextForAll("~w~Race starting in...", 1000, 4);
}
}
return 1;
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(RaceStarted == 0)
{
TogglePlayerControllable(playerid, 0);
SetTimer("CheckPlayers", 5000, 1);
}
}
return 1;
}