Squirrel/Server/Events/Player/onPlayerArmourChange

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (Example: Broken example fixed)
 
Line 23: Line 23:
 
function onPlayerArmourChange( player, oldarm, newarm )
 
function onPlayerArmourChange( player, oldarm, newarm )
 
{
 
{
     if ( oldarm > newarm ) Message( "Armour Cheats Detected on: " + player.Name );
+
     if ( newarm > oldarm ) Message( "Armour Cheats Detected on: " + player.Name );
 
      
 
      
 
     return 1;
 
     return 1;

Latest revision as of 07:22, 3 August 2011

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

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

[edit] Syntax

  1. function onPlayerArmourChange( Player player, int oldArmour, int newArmour )

[edit] Arguments

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

[edit] Returns

This event does not handle return values.

[edit] 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 ( newarm > oldarm ) Message( "Armour Cheats Detected on: " + player.Name );
  5. return 1;
  6. }
  7.  

[edit] Notes

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

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox