Scripting/Squirrel/Functions/CreateCheckpoint: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
BrYaN FuRy (talk | contribs) No edit summary |
ProsuWANTED (talk | contribs) (Fixed alot of things.) |
||
Line 1: | Line 1: | ||
CreateCheckpoint is | CreateCheckpoint is a function that creates a checkpoint. Checkpoints are used in racing. | ||
== Syntax == | |||
<pre>CreateCheckpoint(player, world, pos, rgb, radius)</pre> | |||
== Arguments == | |||
*[[Scripting/Squirrel/Functions#Player_Functions|''Player'']] | ''null'' '''player''' - The player to stream this checkpoint to. If the variable is null, it will be shown to everyone | |||
*''int'' '''world''' - The world id | |||
*[[Scripting/Squirrel/Functions/Vector|''Vector'']] '''pos''' - The checkpoint position | |||
*[[Scripting/Squirrel/Functions/cRGB|''cRGB'']] '''rgb''' - The checkpoint color | |||
*''int'' '''radius''' - The diameter of the checkoint | |||
== Example == | |||
Example | |||
The following example will create a checkpoint | The following example will create a checkpoint: | ||
function onPlayerCommand( player, cmd, text ) | <source lang="squirrel"> | ||
function onPlayerCommand( player, cmd, text ) | |||
{ | { | ||
if ( cmd == "createcheckpoint" ) | |||
{ | |||
CreateCheckpoint( null, 0, player.Pos, RGB(255, 0, 255), 2); | |||
} | |||
} | } | ||
</source> | |||
=== Notes === | |||
Call [[onPlayerCommand]] were used in this example. More info about them in the corresponding pages. | |||
== Related Functions == | |||
{{Scripting/Squirrel/Functions#Checkpoint_Functions}} |
Revision as of 14:16, 31 July 2015
CreateCheckpoint is a function that creates a checkpoint. Checkpoints are used in racing.
Syntax
CreateCheckpoint(player, world, pos, rgb, radius)
Arguments
- Player | null player - The player to stream this checkpoint to. If the variable is null, it will be shown to everyone
- int world - The world id
- Vector pos - The checkpoint position
- cRGB rgb - The checkpoint color
- int radius - The diameter of the checkoint
Example
The following example will create a checkpoint:
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "createcheckpoint" )
{
CreateCheckpoint( null, 0, player.Pos, RGB(255, 0, 255), 2);
}
}
Notes
Call onPlayerCommand were used in this example. More info about them in the corresponding pages.