Squirrel/Server/Events/Player/onPlayerArmourChange

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This is called when a player's armour amount changes, for any reason == Syntax == <code>function onPlayerArmourChange( player, oldArmour, newArmour )</code> == Parameters == ...)

Revision as of 09:35, 9 January 2010

This is called when a player's armour amount changes, for any reason

Syntax

  1. function onPlayerArmourChange( player, oldArmour, newArmour )

Parameters

  • player - The player pointer
  • oldArmour - Armour amount prior to the detected change
  • newArmour - Armour amount after the detected change

Example

This will detect any armour on a player in a server that does not have armour pickups/commands

  1.  
  2. function onPlayerArmourChange( player, oldarm, newarm )
  3. {
  4. if ( ( oldarm > newarm ) && ( player.IsSpawned ) ) Message( "Armour Cheats Detected on: " + player.Name );
  5. }
  6.  

Notes

The functions Message, player.Name and player.Spawned were used in in this example. More info about them can be found in the corresponding pages.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox