SA-MP Forums Archive
help with 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with checkpoints (/showthread.php?tid=53972)



help with checkpoints - gokurulles - 25.10.2008

i will make a race
but how i can make good checkpoints
and yes i have 20 minutes searched


Re: help with checkpoints - gijsmin - 25.10.2008

I ask it To


Re: help with checkpoints - Lorrden - 25.10.2008

search again.


Re: help with checkpoints - matt2127 - 25.10.2008

OnPlayerEnterCheckpoint


Re: help with checkpoints - Finn - 25.10.2008

1. Stop lying. You did not search for 20 minutes, I don't think you searched at all.
2. SetRaceCheckpoint


Re: help with checkpoints - gokurulles - 25.10.2008

thanks but how i activate it


Re: help with checkpoints - Finn - 25.10.2008

Right from the wiki:

Quote:

SetPlayerRaceCheckpoint(playerid, type, Float, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Floatize);

playerid The ID of the player to set the checkpoint for
type Kind of checkpoint.0-Normal, 1-Finish, 2-Nothing(Only the checkpoint without anything on it), 3-Air normal, 4-Air finish
Float X-Coordinate
Float:y Y-Coordinate
Float:z Y-Coordinate
Float:nextx X-Coordinate of the next point, for the arrow facing direction
Float:nexty Y-Coordinate of the next point, for the arrow facing direction
Float:nextz Y-Coordinate of the next point, for the arrow facing direction
Floatize Size (diameter) of the checkpoint

Quote:

Creates a race checkpoint. When the player enters it, a OnPlayerEnterRaceCheckpoint callback is fired.

3. LEARN TO READ!


Re: help with checkpoints - gijsmin - 25.10.2008

but i mean what must in the command (give me a exaple)


Re: help with checkpoints - Finn - 25.10.2008

pawn Код:
//Top of the script
new racecheckpoint[MAX_PLAYERS];
pawn Код:
//in the command
SetPlayerRaceCheckpoint(playerid, 0, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, 5.0);
racecheckpoint[playerid] = 1;
//START OF THE RACE
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
   DisablePlayerRaceCheckpoint(playerid);
   if(racecheckpoint[playerid] == 1)
   {
     SetPlayerRaceCheckpoint(playerid, 0, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, 5.0);
     racecheckpoint[playerid] = 2; // NEXT CP
   }
   else if(racecheckpoint[playerid] == 2)
   {
     SetPlayerRaceCheckpoint(playerid, 0, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, 5.0);
     racecheckpoint[playerid] = 3; // NEXT CP
   }
   else if(racecheckpoint[playerid] == 3)
   {
     SetPlayerRaceCheckpoint(playerid, 0, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, 5.0);
     racecheckpoint[playerid] = 4; // NEXT CP
   }
   else if(racecheckpoint[playerid] == 4)
   {
     SetPlayerRaceCheckpoint(playerid, 1, Float:x, Float:y, Float:z, 0.0, 0.0, 0.0, 5.0);
     racecheckpoint[playerid] = 5; // NEXT CP, THIS IS THE FINISH LINE CHECKPOINT
   }
   else if(racecheckpoint[playerid] == 5)
   {
     //FINISH
     racecheckpoint[playerid] = 0;
   }
   return 1;
}
This is just an example, it won't work properly for sure, but this is all I can help you.


Re: help with checkpoints - gijsmin - 25.10.2008

THANKS i go test it, I hope it work