Scripting/Squirrel/Functions/Pickup.World: 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
(Created page with "== Syntax == <pre>Pickup.World = world;</pre> == Arguments == '''> Pickup''' - The pickup instance. * ''integer'' '''world''' - The world you want to set on pickup == Ex...")
 
No edit summary
 
Line 49: Line 49:
}
}
</pre>
</pre>
== Related Functions ==
{{Scripting/Squirrel/Functions/Pickup_Functions}}
[[Category:Scripting/Squirrel/Functions/Pickup_Functions]]

Latest revision as of 18:37, 30 January 2017

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