Scripting/Squirrel/Functions/AddClass: 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>AddClass( class, RGB( 24, 255, 241 ) ,0, Vector( pos.x, pos.y, pos.z ), angle, weapon1, ammo1 ,weapon2, ammo2, weapon3, ammo3 );</pre> <source lang=squirre...")
 
(Added arguments & a small description.)
Line 1: Line 1:
Adds a class to select.
== Syntax ==
== Syntax ==


<pre>AddClass( class, RGB( 24, 255, 241 ) ,0, Vector( pos.x, pos.y, pos.z ), angle, weapon1, ammo1 ,weapon2, ammo2, weapon3, ammo3 );</pre>
<pre>AddClass( class, RGB( 24, 255, 241 ) ,0, Vector( pos.x, pos.y, pos.z ), angle, weapon1, ammo1 ,weapon2, ammo2, weapon3, ammo3 );</pre>
== Arguments ==
*''int'' '''class''' - Class/team id
*[[Scripting/Squirrel/Functions/cRGB|''cRGB'']] '''color''' - Color
*''int'' '''skin''' - Skin id
*[[Scripting/Squirrel/Functions/Vector|''Vector'']] '''position''' - Position of the class
*''float'' '''angle''' - Angle
*''int'' '''weapon1''' - First weapon id of the class
*''int'' '''ammo1''' - Ammo of the first weapon
*''int'' '''weapon2''' - Second weapon id 2 of the class
*''int'' '''ammo2''' - Ammo of the second weapon
*''int'' '''weapon3''' - Third weapon id 3 of the class
*''int'' '''ammo3''' - Ammo of the third weapon
== Example ==


<source lang=squirrel>
<source lang=squirrel>
function onScriptLoad()
function onScriptLoad(){
AddClass( 1, RGB( 24, 255, 241 ) ,0, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
AddClass( 1, RGB( 24, 255, 241 ) ,0, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
AddClass( 2, RGB( 100,200,300 ) ,5, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
AddClass( 2, RGB( 100,200,300 ) ,5, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
Line 10: Line 28:
AddClass( 4, RGB( 121, 91, 9 ) ,16, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
AddClass( 4, RGB( 121, 91, 9 ) ,16, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
AddClass( 5, RGB( 255, 51, 153 ) ,34, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
AddClass( 5, RGB( 255, 51, 153 ) ,34, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
 
        }
 
 
</source>
</source>


=== Notes ===
=== Notes ===
Call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
Call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.

Revision as of 14:08, 1 July 2015

Adds a class to select.

Syntax

AddClass( class, RGB( 24, 255, 241 ) ,0, Vector( pos.x, pos.y, pos.z ), angle, weapon1, ammo1 ,weapon2, ammo2, weapon3, ammo3 );

Arguments

  • int class - Class/team id
  • cRGB color - Color
  • int skin - Skin id
  • Vector position - Position of the class
  • float angle - Angle
  • int weapon1 - First weapon id of the class
  • int ammo1 - Ammo of the first weapon
  • int weapon2 - Second weapon id 2 of the class
  • int ammo2 - Ammo of the second weapon
  • int weapon3 - Third weapon id 3 of the class
  • int ammo3 - Ammo of the third weapon

Example

function onScriptLoad(){
	AddClass( 1, RGB( 24, 255, 241 ) ,0, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
	AddClass( 2, RGB( 100,200,300 ) ,5, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
	AddClass( 3, RGB( 51, 51, 255 ) ,97, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
	AddClass( 4, RGB( 121, 91, 9 ) ,16, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
	AddClass( 5, RGB( 255, 51, 153 ) ,34, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );
        }

Notes

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