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
m (Oops.)
No edit summary
Line 3: Line 3:
== Syntax ==
== Syntax ==


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


== Arguments ==
== Arguments ==
Line 9: Line 9:
*[[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
*[[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
*''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/Vector|''Vector'']] '''pos''' - The checkpoint position
*[[Scripting/Squirrel/Functions/cRGB|''cRGB'']] '''rgb''' - The checkpoint color
*[[Scripting/Squirrel/Functions/cRGB|''cRGB'']] '''rgb''' - The checkpoint color
Line 22: Line 23:
if ( cmd == "createcheckpoint" )
if ( cmd == "createcheckpoint" )
{
{
CreateCheckpoint( null, 0, player.Pos, RGB(255, 0, 255), 2);
CreateCheckpoint( null, 0, false, player.Pos, RGB(255, 0, 255), 2);
}
}
}
}

Revision as of 16:25, 26 April 2016

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

Syntax

CreateCheckpoint(player, world, isSphere, 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
  • 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 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, false, player.Pos, RGB(255, 0, 255), 2);
	}
}

Notes

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

Related Functions