Scripting/Squirrel/Functions/Checkpoint.Radius: 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
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Checkpoint.Radius : By using this function, You can set the radius of the checkpoint, that means how big the checkpoint will be.
This function changes the size of a Checkpoint.
To do it, 1st of all, you need to create a checkpoint.


== Syntax ==
== Syntax ==
<pre>Checkpoint.Radius = (int)Radius</pre>
<pre>Checkpoint.Radius</pre>


== Arguments ==
== Arguments ==
int <b>Radius</b> - The size/Radius of the checkpoint
*''int'' '''Radius''' - The size/Radius of the checkpoint
 
== Example ==
<source lang="squirrel">
function onScriptLoad()
{
CheckpointGreen <- CreateCheckpoint( null, 0, false, Vector( -378.79, -537.962, 17.2832 ), RGB(255, 0, 255), 2);
return 1;
}




== Example ==
function onPlayerCommand( player, command, arguments )
<pre>function onScriptLoad()
{
cp <- CreateCheckpoint(null, 0, Vector( 132.42, 674.34, 12.6543 ), RGB( 255, 0,255 ), 2);
}
function onPlayerJoin( player )  
{
{
if ( GetPlayers() >=3 )
if(cmd == "setcpsize")
{
{
cp.Radius = 2;  
CheckpointGreen.Radius = 5;
//NOTE: The Checkpoint might disappear use /kill to respawn, the Checkpoint will be visible again and the size will be updated
}
return 1;
}
}
}</pre>
</source>
 
=== Notes ===
 
Call [[onScriptLoad]] and [[onPlayerCommand]] 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:46, 3 August 2017

This function changes the size of a Checkpoint.

Syntax

Checkpoint.Radius

Arguments

  • int Radius - The size/Radius of the checkpoint

Example

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


function onPlayerCommand( player, command, arguments )
{
	if(cmd == "setcpsize")
	{
		CheckpointGreen.Radius = 5;
		//NOTE: The Checkpoint might disappear use /kill to respawn, the Checkpoint will be visible again and the size will be updated
	}
	return 1;
}

Notes

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

Related Functions