Scripting/Squirrel/Functions/CreateCheckpoint: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "CreateCheckpoint is the code for Create A CheckPoint it is Used in Racing Following Code is used for creating a checkoint CreateCheckpoint(player, world, pos, ARGB, radius)...")
 
No edit summary
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
CreateCheckpoint is the code for Create A CheckPoint it is Used in Racing
CreateCheckpoint is a function that creates a checkpoint. Checkpoints are used in racing.


Following Code is used for creating a checkoint
== Syntax ==


<pre>CreateCheckpoint(player, world, isSphere, pos, argb, radius)</pre>


CreateCheckpoint(player, world, pos, ARGB, radius);
== 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
*''bool'' '''isSphere''' - 'true' for is Sphere and 'false' for not '''(Added in 04rel004 will not work in earlier versions!)'''
*[[Scripting/Squirrel/Functions/Vector|''Vector'']] '''pos''' - The checkpoint position
*[[Scripting/Squirrel/Functions/cRGB|''cRGB'']] '''argb''' - The checkpoint color
*''int'' '''radius''' - The diameter of the checkoint


Player | null player - The player to stream this sphere to. If player is null it will be shown to everyone
== Example ==
int world - The world id
Vector pos - The sphere position
cRGB rgb - The sphere color
int radius - The diameter of the sphere
Example


The following example will create a sphere
The following example will create a checkpoint:


function onPlayerCommand( player, cmd, text );
<source lang="squirrel">
function onPlayerCommand( player, cmd, text )
{
{
if ( cmd == "sph" )
if ( cmd == "createcheckpoint" )
{
{
  CreateSphere( player, player.World, player.Pos, RGB(255, 0, 255), 2);
CreateCheckpoint( null, 0, false, player.Pos, ARGB(255, 0, 255, 255), 2);
}
}
}
}
</source>


=== Notes ===


System By Bryan_Fury
Call [[onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
 
== Related Functions ==
 
{{Scripting/Squirrel/Functions/Checkpoint_Functions}}
[[Category:Scripting/Squirrel/Functions/Checkpoint_Functions]]

Latest revision as of 02:01, 3 July 2018

CreateCheckpoint is a function that creates a checkpoint. Checkpoints are used in racing.

Syntax

CreateCheckpoint(player, world, isSphere, pos, argb, 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
  • bool isSphere - 'true' for is Sphere and 'false' for not (Added in 04rel004 will not work in earlier versions!)
  • Vector pos - The checkpoint position
  • cRGB argb - 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, false, player.Pos, ARGB(255, 0, 255, 255), 2);
	}
}

Notes

Call onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions