19.08.2013, 06:40
Now another new problem all works fine
Except, If i go to the next race checkpoint it somehow trolls me and disappears.
I've to go in Starting Point again to see that next race checkpoint and disappears doing this step will make you crazy.
How to fix it?
Except, If i go to the next race checkpoint it somehow trolls me and disappears.
I've to go in Starting Point again to see that next race checkpoint and disappears doing this step will make you crazy.
How to fix it?
pawn Код:
public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
{
for(new i=0; i<MAX_RACES; i++)
{
if(checkpointid == StartCP[i])
{
CPProgess[playerid] = 0;
RaceID[playerid] = i;
SetCP(playerid, RaceID[playerid], CPProgess[playerid], CPProgess[playerid]+1, TotalCP[RaceID[playerid]]);
}
}
return 1;
}
stock SetCP(playerid, id, PrevCP, NextCP, MaxCP)
{
if(NextCP == MaxCP) SetPlayerRaceCheckpoint(playerid, 1, CPCoords[id][PrevCP][0], CPCoords[id][PrevCP][1], CPCoords[id][PrevCP][2], CPCoords[id][NextCP][0], CPCoords[id][NextCP][1], CPCoords[id][NextCP][2], CP_SIZE);
else SetPlayerRaceCheckpoint(playerid, 0, CPCoords[id][PrevCP][0], CPCoords[id][PrevCP][1], CPCoords[id][PrevCP][2], CPCoords[id][NextCP][0], CPCoords[id][NextCP][1], CPCoords[id][NextCP][2], CP_SIZE);
printf("RaceID: %i", id);
}
stock LoadRaceCP(loop, id)
{
new string[90];
format(string, sizeof string, "CP_%i_X", loop);
CPCoords[id][loop][0] = dini_Float(RaceCPath(id), string);
format(string, sizeof string, "CP_%i_Y", loop);
CPCoords[id][loop][1] = dini_Float(RaceCPath(id), string);
format(string, sizeof string, "CP_%i_Z", loop);
CPCoords[id][loop][2] = dini_Float(RaceCPath(id), string);
}
stock LoadRace(id, Float:nextx, Float:nexty, Float:nextz)
{
new string[128];
format(RaceInfo[id][RaceName], 128, "%s", dini_Get(RaceIPath(id), "RaceName"));
RaceInfo[id][SPo][0] = dini_Float(RaceIPath(id), "StartPointX");
RaceInfo[id][SPo][1] = dini_Float(RaceIPath(id), "StartPointY");
RaceInfo[id][SPo][2] = dini_Float(RaceIPath(id), "StartPointZ");
RaceInfo[id][SPS] = dini_Float(RaceIPath(id), "StartCPSize");
format(string, sizeof string, "RaceName: %s\nRace ID: %i\nTotal Race CP: %i", RaceInfo[id][RaceName], id, TotalCP[id]);
StartLabel[id] = CreateDynamic3DTextLabel(string, -1, RaceInfo[id][SPo][0], RaceInfo[id][SPo][1], RaceInfo[id][SPo][2], 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 40.0);
StartCP[id] = CreateDynamicRaceCP(0, RaceInfo[id][SPo][0], RaceInfo[id][SPo][1], RaceInfo[id][SPo][2], nextx, nexty, nextz, RaceInfo[id][SPS], 0, -1, -1, 40.0);
}