3 #include <server/defs.qh>
4 #include <server/miscfunctions.qh>
6 .int selectweapon; // last selected weapon of the player
10 // switch between weapons
11 void Send_WeaponComplain(entity e, float wpn, float type);
13 .float hasweapon_complain_spam;
14 bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andammo, bool complain);
16 .int weaponcomplainindex;
17 float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing, .entity weaponentity);
19 #define w_getbestweapon(ent,wepent) REGISTRY_GET(Weapons, W_GetCycleWeapon(ent, CS(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
21 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
23 // perform weapon to attack (weaponstate and attack_finished check is here)
24 void W_SwitchToOtherWeapon(entity this, .entity weaponentity);
25 bool W_SwitchWeapon(entity this, Weapon imp, .entity weaponentity); // returns false if the player does not have the weapon
26 void W_SwitchWeapon_TryOthers(entity this, Weapon imp, .entity weaponentity);
28 void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponentity);
30 void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity);
33 void W_NextWeapon(entity this, float list, .entity weaponentity);
36 void W_PreviousWeapon(entity this, float list, .entity weaponentity);
38 // previously used if exists and has ammo, (second) best otherwise
39 void W_LastWeapon(entity this, .entity weaponentity);