Scripting/Squirrel/Functions/CreateSphere: 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 "This function will create a sphere. == Syntax == '''1''' <pre>CreateSphere( player, world, pos, rgb, radius )</pre> == Arguments == '''1''' * ''int'' '''player''' - The pl...")
 
(Arguments updated.)
 
(One intermediate revision by one other user not shown)
Line 9: Line 9:


'''1'''
'''1'''
* ''int'' '''player''' - The player to stream this sphere to. If player is null it will be shown to everyone
* [[Scripting/Squirrel/Functions#Player_Functions|''Player'']] | ''null'' '''player''' - The player to stream this sphere to. If player is null it will be shown to everyone
* ''int'' '''world''' - The world id
* ''int'' '''world''' - The world id
* ''Vector'' '''pos''' - The sphere pos
* [[Scripting/Squirrel/Functions/Vector|''Vector'']] '''pos''' - The sphere position
* ''int'' '''rg''' - The sphere color
* [[Scripting/Squirrel/Functions/cRGB|''cRGB'']] '''rgb''' - The sphere color
* ''int'' '''radius''' - The diameter of the sphere
* ''int'' '''radius''' - The diameter of the sphere


== Example ==
== Example ==
The following example create a sphere
The following example will create a sphere
<source lang=squirrel>
<source lang=squirrel>
function onPlayerCommand( player, cmd, text );
function onPlayerCommand( player, cmd, text );

Latest revision as of 21:38, 1 July 2015

This function will create a sphere.

Syntax

1

CreateSphere( player, world, pos, rgb, radius )

Arguments

1

  • Player | null player - The player to stream this sphere to. If player is null it will be shown to everyone
  • int world - The world id
  • Vector pos - The sphere position
  • cRGB rgb - The sphere color
  • int radius - The diameter of the sphere

Example

The following example will create a sphere

function onPlayerCommand( player, cmd, text );
{
 if ( cmd == "sph" )
 {
  CreateSphere( player, player.World, player.Pos, RGB(255, 0, 255), 2);
 }
}

Notes

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

Related Functions