OnPlayerWeaponAmmoChange

From GT-MP
Jump to: navigation, search
OnPlayerWeaponAmmoChange
Server-Side Function
Utilities-terminal.png Server-Side Csharp.png C#

This event is triggered when a player's ammo changes.


Requirements

First of all, it should be defined in your Main constructor for it to be called, otherwise it wouldn't be initiated at all!

public Main()
{
    API.onPlayerWeaponAmmoChange += OnPlayerWeaponAmmoChangeHandler;
}

Usage example(s)

private void OnPlayerWeaponAmmoChangeHandler(Client client, WeaponHash weapon, int oldAmmo)
{
    //Code
}

References