Squirrel/Server/Functions/Players/Armour
From Liberty Unleashed Wiki
(Difference between revisions)
(→Notes) |
(→Notes) |
||
Line 27: | Line 27: | ||
=== Notes === | === Notes === | ||
− | The functions [[ | + | 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 == | ||
{{Scripting/Server/Squirrel/Functions/Players}} | {{Scripting/Server/Squirrel/Functions/Players}} |
Revision as of 10:19, 9 January 2010
This function returns the current amount of armour on a player
Syntax
int player.Armour player.Armour = newArmour
Example
This command gives player's armour when someone types '/c armour playername'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "armour" ) { local plr = FindPlayer( text ); if ( !plr ) MessagePlayer( "Error: Player '" + text + "' is not in the server.", player ); else MessagePlayer( plr.Name + "'s armour: " + plr.Armour, player ); } }
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.