04.11.2011, 12:23
Hello for my race system I'm making something simular to I99 race system, when a player gets in range of a starting point of a race there will be a racecheckpoint and a gametext that says, ur at the startging point of... blahblah
ok so heres the code:
I don't really see what is wrong with this code...
ok so the problems, it doesn't matter how much I change the radius of IsPlayerInRangeOfPoint the RaceCheckPoint will always show up on the same distance... wich is about 10 and u can see I set it to 20 but it still is 10 ingame...
also when the checkpoint was shown sometimes the gametext dissapears immediately...
and a third problem when I'm not near the checkpoint no more (f.e: about 400 meters away from it, the checkpoint is still visable...
NOTE: there's no problem with the chords, nor is there one with the other info from the rInfo array...
thanks in advance
rep for helper!
ok so heres the code:
pawn Код:
public OnPlayerUpdate(playerid)
{
//==============================================================================
//Race CheckPoint showing
//==============================================================================
for(new i; i<sizeof(rInfo); i++)
{
if(rInfo[i][rRacing][playerid] == false && rInfo[i][rInRange][playerid] == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, rInfo[i][rCheckPoint_X][0], rInfo[i][rCheckPoint_Y][0], rInfo[i][rCheckPoint_Z][0]))
{
new string[128];
SetPlayerRaceCheckpoint(playerid, 0, rInfo[i][rCheckPoint_X][0], rInfo[i][rCheckPoint_Y][0], rInfo[i][rCheckPoint_Z][0], rInfo[i][rCheckPoint_X][1], rInfo[i][rCheckPoint_Y][1], rInfo[i][rCheckPoint_Z][1], 10.0);
format(string, sizeof(string), "~y~You are at the startpoint of the race~n~~r~%s ~n~~y~type /startrace to start this race", rInfo[i][rName]);
GameTextForPlayer(playerid, string, 5000, 5);
rInfo[i][rInRange][playerid] = 1;
}
else
{
DisablePlayerRaceCheckpoint(playerid);
rInfo[i][rInRange][playerid] = 0;
}
}
}
return 1;
}
ok so the problems, it doesn't matter how much I change the radius of IsPlayerInRangeOfPoint the RaceCheckPoint will always show up on the same distance... wich is about 10 and u can see I set it to 20 but it still is 10 ingame...
also when the checkpoint was shown sometimes the gametext dissapears immediately...
and a third problem when I'm not near the checkpoint no more (f.e: about 400 meters away from it, the checkpoint is still visable...
NOTE: there's no problem with the chords, nor is there one with the other info from the rInfo array...
thanks in advance
rep for helper!

