native

rg_switch_best_weapon

Syntax

native rg_switch_best_weapon(const player, const currentWeapon = 0);

Description

Switches player current weapon into the best one on its inventory using the CHalfLifeMultiplay::GetNextBestWeapon function.

Parameters

player Player index.
currentWeapon Current player active weapon. 0 = retrieve from m_pActiveItem member

Note

Weapon selection is based on weapon's Weight attribute from ItemInfo structure.

Return

1 if weapon was found and switched to, 0 otherwise