Author Topic: Weapon Restriction – Water  (Read 1012 times)

Can someone make a support script for allowing weapons to be used exclusively above water or below water?  Such as wanting a gun not to work because the player is underwater?

Thanks.

Can someone make a support script for allowing weapons to be used exclusively above water or below water?  Such as wanting a gun not to work because the player is underwater?

Thanks.
So you just want to be able to set a variable on the weapon image to do this? Do you want it packaged as an add-on or just a Support_WaterWeapons.cs file?
« Last Edit: June 09, 2014, 02:29:41 PM by jes00 »

I'm not sure.  Maybe a support script, and then have something where if you hold a weapon and say some command, it sets it in a preference file for your server to read.  Also, maybe a server pref that decides the fate of the weapon or tool, whether it won't let you fire or alt fire but keep it out, whether it forces you to unmount it and close the tools tab (like pressing Q), or removing the item from your inventory altogether.

If you have any other ideas on how to make this easier or more convenient, go ahead and say it.

« Last Edit: June 10, 2014, 02:25:00 AM by SWAT One »

I'm not sure.  Maybe a support script, and then have something where if you hold a weapon and say some command, it sets it in a preference file for your server to read.  Also, maybe a server pref that decides the fate of the weapon or tool, whether it won't let you fire or alt fire but keep it out, whether it forces you to unmount it and close the tools tab (like pressing Q), or removing the item from your inventory altogether.

If you have any other ideas on how to make this easier or more convenient, go ahead and say it.
Right now what I have is a support script. Set weaponImage.waterUsable to 1 to make the weapon only usable in water, and 2 to make it only usable out of water. If the weapon isn't usable, you just can't equip it.

Is there a 0 that sets it to usable in both environments?

Is there a 0 that sets it to usable in both environments?
If the variable is not defined or any number but 1 or 2 then it is usable in both environments.