SetPlayerRaceCheckpoint
From SA-MP Wiki
(Difference between revisions)
Revision as of 11:25, 21 February 2011 Bloody (Talk | contribs) ← Previous diff |
Revision as of 18:06, 5 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{Scripting}} | {{Scripting}} | ||
- | {{Title}} | ||
{{Description|Creates a race checkpoint. When the player enters it, the [[OnPlayerEnterRaceCheckpoint]] callback is called.}} | {{Description|Creates a race checkpoint. When the player enters it, the [[OnPlayerEnterRaceCheckpoint]] callback is called.}} | ||
Line 49: | Line 48: | ||
[[Category:Scripting Functions]] | [[Category:Scripting Functions]] | ||
+ | |||
+ | [[en:SetPlayerRaceCheckpoint]] |
Revision as of 18:06, 5 February 2014
Description:
Creates a race checkpoint. When the player enters it, the OnPlayerEnterRaceCheckpoint callback is called.
(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
playerid | The ID of the player to set the checkpoint for |
type | Type of checkpoint.0-Normal, 1-Finish, 2-Nothing(Only the checkpoint without anything on it), 3-Air normal, 4-Air finish |
Float:x | X-Coordinate |
Float:y | Y-Coordinate |
Float:z | Z-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 | Z-Coordinate of the next point, for the arrow facing direction |
Float:size | Size (diameter) of the checkpoint |
Return Values:
This function does not return any specific values.
//from Yagu's race filterscript, (c) by Yagu public SetRaceCheckpoint(playerid,target,next) { if(next == -1 && Airrace == 0) SetPlayerRaceCheckpoint(playerid,1,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2], 0.0,0.0,0.0,CPsize); else if(next == -1 && Airrace == 1) SetPlayerRaceCheckpoint(playerid,4,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2], 0.0,0.0,0.0,CPsize); else if(Airrace == 1) SetPlayerRaceCheckpoint(playerid,3,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2], RaceCheckpoints[next][0],RaceCheckpoints[next][1],RaceCheckpoints[next][2],CPsize); else SetPlayerRaceCheckpoint(playerid,0,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2], RaceCheckpoints[next][0],RaceCheckpoints[next][1],RaceCheckpoints[next][2],CPsize); }
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- SetPlayerCheckpoint: Create a checkpoint for a player.
- DisablePlayerCheckpoint: Disable the player's current checkpoint.
- IsPlayerInCheckpoint: Check if a player is in a checkpoint.
- DisablePlayerRaceCheckpoint: Disable the player's current race checkpoint.
- IsPlayerInRaceCheckpoint: Check if a player is in a race checkpoint.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerEnterCheckpoint: Called when a player enters a checkpoint.
- OnPlayerLeaveCheckpoint: Called when a player leaves a checkpoint.
- OnPlayerEnterRaceCheckpoint: Called when a player enters a race checkpoint.
- OnPlayerLeaveRaceCheckpoint: Called when a player leaves a race checkpoint.