onPlayerWeaponChange
Description
When a player changes his weapon to newone or oldone.
| Name | Description |
|---|---|
| player | The pointer of the player |
| oldWep | Players old weapon |
| newWep | Players new weapon |
Example
If a player will try to change his weapon to "33" ( minigun ), this example will automatically set his weapons ammo to 0. and in result, he won't be able to use that weapon.
function onPlayerWeaponChange(player, oldWep, newWep) { if(newWep == 33) { player.SetWeapon(33, 0); // set weapon ammo to 0 } return 1; //return true for other weapons}