Checkpoints? - 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: Checkpoints? (
/showthread.php?tid=401578)
Checkpoints? -
Riggster - 23.12.2012
Does anyone know how I would create a check point. Like if someone typed /joinrace it would make a check point.
And does anyone know how I would make it so they would get 100 dollars for passing the checkpoint
Any help would be greatly appreciated
Re: Checkpoints? -
DaRk_RaiN - 23.12.2012
In you mean normal checkpoints use
SetPlayerCheckpointBut if you want a race use
SetPlayerRaceCheckpoint
Now there are a lot of tutorials for organizing a race, here's a simple one:
The command
pawn Код:
if (strcmp("/joinrace", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,x,y,z);//The coords of the player in the race start
PutPlayerInVehicle(playerid,vehicle,1);//make sure you replace vehicleid with an already defined car
SetPlayerRaceCheckpoint(playerid,type,(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size);//This will be the first checkpoint
return 1;
}
the callback when a player enters the Cp
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
GivePlayerMoney(playerid,100);//Giving the player money
return 1;
}
P.S: this is just an example in you want a whole race you have to use a variable and cases to not mix up the CheckPoints,Check the tutorials.