Scripting/Squirrel/Functions/Checkpoint.Pos: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary |
No edit summary |
||
Line 34: | Line 34: | ||
{{Scripting/Squirrel/Functions/Checkpoint_Functions}} | {{Scripting/Squirrel/Functions/Checkpoint_Functions}} | ||
[[Category:Scripting/Squirrel/Functions/Checkpoint_Functions]] |
Revision as of 17:59, 30 January 2017
This function changes the Position of a Checkpoint.
Syntax
Checkpoint.Pos
Arguments
- Vector pos - The checkpoint position
Example
function onScriptLoad()
{
CheckpointGreen <- CreateCheckpoint( null, 0, Vector( -378.79, -537.962, 17.2832 ), RGB(255, 0, 255), 2);
return 1;
}
function onPlayerCommand( player, command, arguments )
{
if(cmd == "setcppos")
{
CheckpointGreen.Pos = Vector(player.Pos.x, player.Pos.y, player.Pos.z);
//NOTE: The Checkpoint might disappear use /kill to respawn, the Checkpoint will be visible again and the Position will be updated
}
return 1;
}
Notes
Call onScriptLoad and onPlayerCommand were used in this example. More info about them in the corresponding pages.