04.09.2013, 13:34
Hello
I'm trying to make a race system for my server, but I stumbled upon a problem in the very beginning already...
Anyway, my goal on this code is to show a race checkpoint whenever a player is near one of the starting race checkpoints.
Here's what I did:
So the first 0 stands for the raceid, the second for the CheckPoint ID (so if that's 0 it's the starting point of the race)
and then there's 3 chords
here's the stock:
and this:
and the RInfo:
but when I go ingame and go to the position where I should get the checkpoint I don't see it...
Anybody knows what could be wrong?
Thanks in advance
I'm trying to make a race system for my server, but I stumbled upon a problem in the very beginning already...
Anyway, my goal on this code is to show a race checkpoint whenever a player is near one of the starting race checkpoints.
Here's what I did:
pawn Код:
public OnGameModeInit()
{
AddCheckpointToRace(0, 0, 2378.034423, -1256.948120, 23.392478);
return 1;
}
and then there's 3 chords
here's the stock:
pawn Код:
stock AddCheckpointToRace(RaceID, CheckPointID, Float:CheckPointX, Float:CheckPointY, Float:CheckPointZ)
{
RInfo[RaceID][CPX][CheckPointID] = CheckPointX;
RInfo[RaceID][CPX][CheckPointID] = CheckPointY;
RInfo[RaceID][CPX][CheckPointID] = CheckPointZ;
return 1;
}
pawn Код:
public HalfSecondTimer(playerid)
{
for(new i = 0; i < MAX_CHECKPOINTS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, RInfo[i][CPX][0], RInfo[i][CPY][0], RInfo[i][CPZ][0]))
{
SetPlayerRaceCheckpoint(i,2,RInfo[i][CPX][0], RInfo[i][CPY][0], RInfo[i][CPZ][0], 0.0,0.0,0.0,10);
}
}
return 1;
}
pawn Код:
enum RaceInfo
{
//blabla
Float:CPX[MAX_CHECKPOINTS], //The CP cords
Float:CPY[MAX_CHECKPOINTS],
Float:CPZ[MAX_CHECKPOINTS],
//blabla
}
new RInfo[MAX_RACES][RaceInfo];
Anybody knows what could be wrong?
Thanks in advance