Problem in my racing system
#1

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:
pawn Код:
public OnGameModeInit()
{
   
    AddCheckpointToRace(0, 0, 2378.034423, -1256.948120, 23.392478);
    return 1;
}
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:
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;

}
and this:
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;
}
and the RInfo:
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];
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
Reply


Messages In This Thread
Problem in my racing system - by knackworst - 04.09.2013, 13:34
Re: Problem in my racing system - by Konstantinos - 04.09.2013, 14:11
Re: Problem in my racing system - by knackworst - 04.09.2013, 14:24
Re: Problem in my racing system - by Dragonsaurus - 04.09.2013, 14:46
Re: Problem in my racing system - by Konstantinos - 04.09.2013, 14:46
Re: Problem in my racing system - by knackworst - 04.09.2013, 16:24
Re: Problem in my racing system - by Konstantinos - 04.09.2013, 16:30
Re: Problem in my racing system - by knackworst - 04.09.2013, 16:52
Re: Problem in my racing system - by knackworst - 04.09.2013, 17:04
Re: Problem in my racing system - by Konstantinos - 04.09.2013, 17:20

Forum Jump:


Users browsing this thread: 1 Guest(s)