Checking if a player has a gun.
Posted: Sun Oct 11, 2009 2:34 pm
I'm busy building a pistol-only area in a map and I've into a problem.
As soon as you enter the area I give a 'useweaponclass pistol'.
This works fine, but if the player dropped its pistol this doesn't do anything.
If the player doesn't have a pistol I want to force the player to holster the weapon.
But how do I find if a player has a weapon?
I can't find any link to the inventory besides 'listinventory' which doesn't seem to do the job I want it to do.
Yes, I know there is a way to detect which gun someone is using using weaponcommand targetname. But this only gives the weapon you are using which is useless if the weapon is holstered.
Btw, I also have a script in RAISE_WEAPON to prevent switching to != pistol.
As soon as you enter the area I give a 'useweaponclass pistol'.
This works fine, but if the player dropped its pistol this doesn't do anything.
If the player doesn't have a pistol I want to force the player to holster the weapon.
But how do I find if a player has a weapon?
I can't find any link to the inventory besides 'listinventory' which doesn't seem to do the job I want it to do.
Yes, I know there is a way to detect which gun someone is using using weaponcommand targetname. But this only gives the weapon you are using which is useless if the weapon is holstered.
Btw, I also have a script in RAISE_WEAPON to prevent switching to != pistol.