Squirrel/Server/Functions/Players/Class
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This function sets/returns the players class. == Syntax == <code>float Player.Class( int Value )</code> == Arguments == * '''Value''' - What you can set the class to. == Exa...) |
(→Notes) |
||
Line 41: | Line 41: | ||
=== Notes === | === Notes === | ||
− | The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] were used in in this example. More info about them in the corresponding page. | + | The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] and [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] were used in in this example. More info about them in the corresponding page. |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Players}} | {{Squirrel/Server/Functions/Players}} |
Revision as of 02:41, 26 May 2010
This function sets/returns the players class.
Syntax
float Player.Class( int Value )
Arguments
- Value - What you can set the class to.
Example 1. Returning
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "class" ) { MessagePlayer( "Your class is " + pPlayer.Class + ".", pPlayer ); } }
This will tell the player what their class currently is.
Example 2. Setting
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "newclass" ) { pPlayer.Class = 10; } }
This will set the players class to 10 when they do /newclass.
Notes
The call onPlayerCommand and MessagePlayer were used in in this example. More info about them in the corresponding page.
Related Functions
- FindPlayer
- GetClosestPlayer
- Player.Alpha
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.ClearWeapons
- Player.Colour
- Player.ColouredName
- Player.EnterVehicle
- Player.ExitVehicle
- Player.ForceToSpawnScreen
- Player.Frozen
- Player.GetBoundariesLower
- Player.GetBoundariesUpper
- Player.GetIgnored
- Player.Health
- Player.ID
- Player.IP
- Player.Immune
- Player.Island
- Player.LUID
- Player.Marker
- Player.MarkerScale
- Player.MarkerSprite
- Player.Muted
- Player.Name
- Player.Nametag
- Player.NametagColour
- Player.Ping
- Player.Pos
- Player.RemoveFromVehicle
- Player.RemoveLimb
- Player.Score
- Player.SetAnim
- Player.SetBoundaries
- Player.SetIgnored
- Player.SetIgnoredBy
- Player.SetVehicleEnterDoor
- Player.SetWeapon
- Player.Skin
- Player.Spawn
- Player.Spawned
- Player.Team
- Player.Train
- Player.Vehicle
- Player.VehicleSeat
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.SetWeapon
- Player.WeaponAmmo
- Player.WeaponState