Squirrel/Server/Functions/Players/Armour
From Liberty Unleashed Wiki
(Difference between revisions)
(→Notes) |
(→Related Functions) |
||
Line 31: | Line 31: | ||
== Related Functions == | == Related Functions == | ||
− | {{ | + | {{Squirrel/Server/Squirrel/Functions/Players}} |
Revision as of 10:20, 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.