Scripting/Squirrel/Functions/Pickup.World

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

Syntax

Pickup.World = world;

Arguments

> Pickup - The pickup instance.

  • integer world - The world you want to set on pickup


Example

This example will create a pickup on given location and prints its World on console

function onScriptLoad()
{
   myPickup <- CreatePickup( 284, 1, Vector( -2261.12, 753.12, 211.123 ) );
   print(myPickup.World);
}

Example 2

This example will create a pickup on given location and you can change the world via commands given below.

function onScriptLoad()
{
   myPickup <- CreatePickup( 284, 1, Vector( -2261.12, 753.12, 211.123 ) );
}

function onPlayerCommand(player, cmd, text)
{
if(cmd =="world1")
{
myPickup.World = 1;
MessagePlayer("The pickup has been sent to world 1",player);
}
else if(cmd =="world2")
{
myPickup.World = 2;
MessagePlayer("The pickup has been sent to world 2",player);
}
else if(cmd =="myworld")
{
myPickup.World = player.World;
MessagePlayer("The pickup has been sent to your world",player);
}
}

Related Functions