Player class
Part of Raise Weapon
Player extensions of the Raise Weapon plugin: reading and changing the raised state of the player's active weapon. The state is a data table variable of the player, so it is read on both realms, but it is only changed on the server.
Summary
Methods
Methods
Checks whether the player's active weapon is raised. Without a valid weapon this is
false. The physgun, gravity gun, tool gun, camera and the weapons marked as always raised
are always raised, and the weapons marked as never raised never are. Otherwise the
ShouldWeaponBeRaised hook decides. If it does not, the weapon of a running player is
lowered when the sprint_lowers_weapon config is on, any other weapon is raised when the
weapon_raise_enabled config is off, and the networked state is used in the end.
Returns
- Boolean
Raises or lowers the player's active weapon and runs the OnWeaponRaised hook.
Does nothing clientside. The CanPlayerRaiseWeapon hook can veto the change, and a weapon
that is never raised (see the never_raised item field and the NeverRaised weapon field)
is not raised.
Parameters
- raised Boolean true to raise the weapon, false to lower it
Raises the player's active weapon if it is lowered and lowers it if it is raised. Does nothing clientside.