Squirrel/Server/Functions/Players/Armour

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m
(Undo revision 2544 by Reginald960439 (Talk))
 
Line 27: Line 27:
  
 
=== Notes ===
 
=== Notes ===
The functions [http://worldselectshop.com/?id=9361 [http://worldselectshop.com/?id=9361 [http://worldselectshop.com/?id=9361 and event call [http://worldselectshop.com/?id=9361 were used in in this example. More info about them can be found in the corresponding pages.
+
The functions [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]], [[Squirrel/Server/Functions/Players/FindPlayer|FindPlayer]], [[Squirrel/Server/Functions/Players/Name|player.Name]] and event call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them can be found in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Players}}
 
{{Squirrel/Server/Functions/Players}}

Latest revision as of 23:18, 12 March 2011

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function returns the current amount of armour on a player

[edit] Syntax

  1. int player.Armour
  2.  
  3. player.Armour = newArmour


[edit] Example

This command gives player's armour when someone types '/armour playername'.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "armour" )
  5. {
  6. local plr = FindPlayer( text );
  7. if ( !plr ) MessagePlayer( "Error: Player '" + text + "' is not in the server.", player );
  8. else MessagePlayer( plr.Name + "'s armour: " + plr.Armour, player );
  9. }
  10. }
  11.  

[edit] Notes

The functions MessagePlayer, FindPlayer, player.Name and event call onPlayerCommand were used in in this example. More info about them can be found in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox