Scripting/Squirrel/Events/Player/onPlayerArmourChange

From VC-MP Wiki

Jump to: navigation, search

This is called when player's armour amount changes.

Syntax

function onPlayerArmourChange( player, oldArmour, newArmour )

Parameters

  • player - The pointer of the player
  • oldArmour - The amount of armour player had before the change
  • newArmour - The current armour amount

Example

This will alert the server without armour pickups about an armour cheater:

function onPlayerArmourChange( player, oldarm, newarm )
{
     if ( ( oldarm > newarm ) && ( player.IsSpawned ) ) Message( "Armour hax alert! Player: " + player.Name );
}

Notes

The functions Message, player.Name and player.IsSpawned were used in in this example. More info about them in corresponding pages.

Related Events

Personal tools
squirrel scripting