Scripting/Squirrel/Functions/Checkpoint.ID: 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
No edit summary
No edit summary
Line 1: Line 1:
This function gets the checkpoint ID.
== Syntax ==
== Syntax ==
Checkpoint.ID
== Arguments ==
None


== Return value ==
<pre>Checkpoint.ID</pre>
The checkpoint's ID


== Example ==
== Example ==


<pre>function onScriptLoad()
<source lang="squirrel">
function onScriptLoad()
{
{
CreateCheckpoint(null, 0, Vector( 876.45, 432.54, 12.34 ), RGB( 255, 0, 255 ), 2);
CheckpointGreen <- CreateCheckpoint( null, 0, Vector( -378.79, -537.962, 17.2832 ), RGB(255, 0, 255), 2);
CreateCheckpoint(null, 0, Vector( 765.43, 324.65, 14.54 ), RGB( 243, 67, 189 ), 2);
CheckpointWhite <- CreateCheckpoint( null, 0, Vector( 876.45, 432.54, 12.34 ), RGB(255, 255, 255), 2);
print( FindCheckpoint(0).ID ); //1st one.
print("CheckpointGreen ID: " + CheckpointGreen.ID);
print( FindCheckpoint(1).ID ); //2nd one
print("CheckpointWhite ID: " + CheckpointWhite.ID);
//and so on
return 1;
}</pre>
}
</source>
 
=== Notes ===
 
Call [[onPlayerCommand]] were used in this example. More info about them in the corresponding pages.


== Related Functions ==


By VCMP Team
{{Scripting/Squirrel/Functions/Checkpoint_Functions}}

Revision as of 19:58, 23 April 2016

This function gets the checkpoint ID.

Syntax

Checkpoint.ID

Example

function onScriptLoad()
{
	CheckpointGreen <- CreateCheckpoint( null, 0, Vector( -378.79, -537.962, 17.2832 ), RGB(255, 0, 255), 2);
	CheckpointWhite <- CreateCheckpoint( null, 0, Vector( 876.45, 432.54, 12.34 ), RGB(255, 255, 255), 2);
	print("CheckpointGreen ID: " + CheckpointGreen.ID);
	print("CheckpointWhite ID: " + CheckpointWhite.ID);
	return 1;
}

Notes

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

Related Functions