Scripting/Squirrel/Functions/Checkpoint.Remove: 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
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Checkpoint.remove : To use it, like others, you need to find the checkpoint, either using a name or by using FindCheckpoint() function
This function removes a checkpoint.
For example


== Syntax ==


<pre>Checkpoint.Remove()</pre>


<pre>function onScriptLoad()
== Example ==
{
checkp_status = false
}</pre>


Now lets create the checkpoint
<source lang="squirrel">
<pre>function onPlayerJoin(player)
function onScriptLoad()
{
{
if(checkp_status == false)
CheckpointGreen <- CreateCheckpoint( null, 0, false, Vector( -378.79, -537.962, 17.2832 ), RGB(255, 0, 255), 2);
{
CheckpointWhite <- CreateCheckpoint( null, 0, true, Vector( 876.45, 432.54, 12.34 ), RGB(255, 255, 255), 2);
cp <- CreateCheckpoint(null, 0, Vector( 132.42, 674.34, 12.6543 ), RGB( 255, 0,255 ), 2);
return 1;
checkp_status = true;
}
}
}</pre>


Now we may like to delete it when we get 0 players.
function onScriptUnload()
<pre>
function onPlayerPart( player )
{
if(GetPlayers() == 0)
{
{
cp.Remove();
CheckpointGreen.Remove();
checkp_status = false;
CheckpointWhite.Remove();
return 1;
}
}
}</pre>
</source>
 
=== Notes ===
 
Call [[onScriptLoad]] and [[onScriptUnload]] were used in this example. More info about them in the corresponding pages.
 
== Related Functions ==


By someone
{{Scripting/Squirrel/Functions/Checkpoint_Functions}}
[[Category:Scripting/Squirrel/Functions/Checkpoint_Functions]]

Latest revision as of 17:47, 3 August 2017

This function removes a checkpoint.

Syntax

Checkpoint.Remove()

Example

function onScriptLoad()
{
	CheckpointGreen <- CreateCheckpoint( null, 0, false, Vector( -378.79, -537.962, 17.2832 ), RGB(255, 0, 255), 2);
	CheckpointWhite <- CreateCheckpoint( null, 0, true, Vector( 876.45, 432.54, 12.34 ), RGB(255, 255, 255), 2);
	return 1;
}

function onScriptUnload()
{
	CheckpointGreen.Remove();
	CheckpointWhite.Remove();
	return 1;
}

Notes

Call onScriptLoad and onScriptUnload were used in this example. More info about them in the corresponding pages.

Related Functions