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
(Added arguments & a small description.)
No edit summary
 
(4 intermediate revisions by one other user not shown)
Line 3: Line 3:
== 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, color, skin, position, angle, weapon1, ammo1 ,weapon2, ammo2, weapon3, ammo3 );</pre>


== Arguments ==
== Arguments ==
Line 9: Line 9:
*''int'' '''class''' - Class/team id
*''int'' '''class''' - Class/team id
*[[Scripting/Squirrel/Functions/cRGB|''cRGB'']] '''color''' - Color
*[[Scripting/Squirrel/Functions/cRGB|''cRGB'']] '''color''' - Color
*''int'' '''skin''' - Skin id
*''int'' '''skin''' - [[Skins|Skin id]]
*[[Scripting/Squirrel/Functions/Vector|''Vector'']] '''position''' - Position of the class
*[[Scripting/Squirrel/Functions/Vector|''Vector'']] '''position''' - Position of the class
*''float'' '''angle''' - Angle
*''float'' '''angle''' - Angle
*''int'' '''weapon1''' - First weapon id of the class
*''int'' '''weapon1''' - First [[Weapons|weapon id]] of the class
*''int'' '''ammo1''' - Ammo of the first weapon
*''int'' '''ammo1''' - Ammo of the first weapon
*''int'' '''weapon2''' - Second weapon id 2 of the class
*''int'' '''weapon2''' - Second [[Weapons|weapon id]] 2 of the class
*''int'' '''ammo2''' - Ammo of the second weapon
*''int'' '''ammo2''' - Ammo of the second weapon
*''int'' '''weapon3''' - Third weapon id 3 of the class
*''int'' '''weapon3''' - Third [[Weapons|weapon id]] 3 of the class
*''int'' '''ammo3''' - Ammo of the third weapon
*''int'' '''ammo3''' - Ammo of the third weapon


== Example ==
== Example ==
Line 23: Line 25:
<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 );
AddClass( 3, RGB( 51, 51, 255 ) ,97, 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( 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/onScriptLoad|onScriptLoad]] were used in this example. More info about them in the corresponding pages.
 
== Related Functions ==
 
{{Scripting/Squirrel/Functions/Spawn_and_Wasted_Screen_Functions}}
[[Category:Scripting/Squirrel/Functions/Spawn_and_Wasted_Screen_Functions]]

Latest revision as of 21:58, 30 January 2017

Adds a class to select.

Syntax

AddClass( class, color, skin, position, 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 onScriptLoad were used in this example. More info about them in the corresponding pages.

Related Functions