SA-MP Forums Archive
Race cmds? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Race cmds? (/showthread.php?tid=567261)



Race cmds? - fuckingcruse - 12.03.2015

Hey all I read from the sa-mp.com website that to add.. this to the script to continue the race..

SetPlayerRaceCheckpoint

Can anyone explain me? I want something like this...

If a player enter's the first checkpoint , then there must be another checkpoint where i want.. in my script.. Can anyone expain?


Re: Race cmds? - CalvinC - 12.03.2015

In the OnPlayerEnterRaceCheckpoint callback, use IsPlayerInRangeOfPoint to check if he's in the first checkpoint's coordinates, and display the next checkpoint.


Re: Race cmds? - fuckingcruse - 12.03.2015

Can you explain with some coding?


Re: Race cmds? - CalvinC - 12.03.2015

pawn Код:
SetPlayerRaceCheckpoint(playerid, 0, 100, 110, 15, 120, 140, 16, 5); // Set a race checkpoint where-ever
public OnPlayerEnterRaceCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 100, 110, 15) // Use the same coordinates as the race checkpoint was created at
    {
        // The player was in that checkpoint we created, set the next one here
    }
    return 1;
}



Re: Race cmds? - fuckingcruse - 12.03.2015

Then if i want to continue like i want 7 cp's that time?

Then i must type like this?

Quote:

SetPlayerRaceCheckpoint(playerid, 0, 100, 110, 15, 120, 140, 16, 5); // Set a race checkpoint where-ever
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 100, 110, 15) // Use the same coordinates as the race checkpoint was created at
{
// The player was in that checkpoint we created, set the next one here
SetPlayerRaceCheckpoint(playerid , [floatx] , [floaty] , [floatz]?
}


return 1;
}