06.06.2017, 14:09
(
Последний раз редактировалось kalanerik99; 07.06.2017 в 14:04.
)
Hello guys
I have a problem
When I am alone on the server the race works perfectry fine
But when there are 2 or more players the race wont start.
It just doesnt show the second checkpoint( it does the count down and everything but when the countdown it just calls the LEAVE_RACE callback for all the racers(players)
I have a problem
When I am alone on the server the race works perfectry fine
But when there are 2 or more players the race wont start.
It just doesnt show the second checkpoint( it does the count down and everything but when the countdown it just calls the LEAVE_RACE callback for all the racers(players)
PHP код:
function CountDownForAll(times)
{
foreach(new i : Player)
{
new raceid = GetPVarInt(i,"raceID");
if(times)
{
if(IsPlayerInRaceCheckpoint(i) && (GetVehicleModel(GetPlayerVehicleID(i)) == RaceInfo[raceid][racevehicle]))
{
GameTextForPlayer(i, CDTxt[times], 1500, 3);
PlayerPlaySound(i, 1056, 0, 0, 0);
}
SetTimerEx("CountDownForAll",1000,false,"i",times-1);
}
else
{
if(IsPlayerInRaceCheckpoint(i) && (GetVehicleModel(GetPlayerVehicleID(i)) == RaceInfo[raceid][racevehicle]))
{
GameTextForPlayer(i, CDTxt[times], 1000, 3);
PlayerPlaySound(i, 1057, 0, 0, 0);
SetPlayerRaceCheckpoint(i, 0, RaceInfo[raceid][checkpointx][1], RaceInfo[raceid][checkpointy][1], RaceInfo[raceid][checkpointz][1], RaceInfo[raceid][checkpointx][2], RaceInfo[raceid][checkpointy][2], RaceInfo[raceid][checkpointz][2], CP_SIZE);
RaceCheckpoint[i] = 2;
RaceInfo[raceid][originalcount] ++;
RaceInfo[raceid][racecount] ++;
if(RaceInfo[raceid][originalcount] == 0) return 1;
RaceInfo[raceid][racetimer] = SetTimerEx("RaceTime", 10, true, "dd", raceid,i);
RaceInfo[raceid][racerunning] = true;
new string[512];
format(string, sizeof(string),"%s~n~Time:%s~n~Checkpoints:%d/%d",RaceInfo[raceid][racename],ReturnTime(RaceInfo[raceid][racetime]),RaceCheckpoint[i]-2,RaceInfo[raceid][cpnum] - 1);
PlayerTextDrawSetString(i,RaceTextDraw[i][0],string);
PlayerTextDrawShow(i, RaceTextDraw[i][0]);
RaceInfo[raceid][raceticktime] = GetTickCount();
}
else
{
LeaveRace(i, raceid);
}
}
}
return 1;
}