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
No edit summary
Line 1: Line 1:
Checkpoint.remove is very easy first u need. to give name to checkpoint
Checkpoint.remove : To use it, like others, you need to give the checkpoint a name.
For example






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


function onScriptLoad()
Now lets create the checkpoint
{  
<pre>function onPlayerJoin(player)
{
if(checkp_status == false)
{
array <- CreateCheckpoint(null, 0, Vector( 132.42, 674.34, 12.6543 ), RGB( 255, 0,255 ), 2);
array <- CreateCheckpoint(null, 0, Vector( 132.42, 674.34, 12.6543 ), RGB( 255, 0,255 ), 2);
}
checkp_status = true;
 
}
now delete on playerpart
}


Now we may like to delete it when we get 0 players.


function onPlayerPart( player )  
function onPlayerPart( player )  
{  
{  
if(GetPlayers()-1 == 0)
{
array.Remove();
array.Remove();
checkp_status = false;
}
}
}


By VCMP Team
By VCMP Team

Revision as of 19:16, 21 August 2015

Checkpoint.remove : To use it, like others, you need to give the checkpoint a name. For example


function onScriptLoad()
 { 
checkp_status = false
 }

Now lets create the checkpoint

function onPlayerJoin(player)
{
if(checkp_status == false)
{
array <- CreateCheckpoint(null, 0, Vector( 132.42, 674.34, 12.6543 ), RGB( 255, 0,255 ), 2);
checkp_status = true;
}
}

Now we may like to delete it when we get 0 players.

function onPlayerPart( player ) 
{ 
if(GetPlayers()-1 == 0)
{
array.Remove();
checkp_status = false;
}
}

By VCMP Team