Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Underwater Shooting Control

Featured Replies

  • Administrator

Enables or disables weapons firing underwater, so water becomes safe or deadly depending on server rules.

Underwater Shooting Control 1.0.0 (olds.ro)

Guns do not work under water. A player whose head is under water (or who is in the water up to the level you choose) cannot fire, or use the secondary attack (scope, silencer, burst mode), of any weapon that is not on the allow list. By default the knife, the USP and the Glock-18 still work, so water becomes a safe spot or a knife fight.

Requirements

  • ReHLDS, ReGameDLL_CS, Metamod-R, ReAPI
  • AMX Mod X 1.10 or newer (written for 1.10.0.5490), with the hamsandwich module (part of every AMX Mod X install)

Install

  • Compile scripting/olds_uwshoot.sma and copy olds_uwshoot.amxx to addons/amxmodx/plugins/. The compiler needs ReAPI's include files (reapi.inc and the reapi_*.inc files from the ReAPI release) next to the stock AMX Mod X includes.
  • Copy data/lang/olds_uwshoot.txt to addons/amxmodx/data/lang/.
  • Copy configs/plugins/olds_uwshoot.cfg to addons/amxmodx/configs/plugins/ (if it is missing, the plugin writes it with the default values).
  • Add olds_uwshoot.amxx to addons/amxmodx/configs/plugins.ini.

Commands None.

How it works

  • While a player is in water at olds_uw_level or deeper, the attack timers of a blocked weapon in his hands are held back every frame, so the gun neither fires on the server nor shows a shot or muzzle flash through the client's weapon prediction. Ham_Weapon_PrimaryAttack and Ham_Weapon_SecondaryAttack are blocked too, in case anything else calls them.
  • A player who presses fire under water gets a short message in the middle of the screen (at most once every 2 seconds) with olds_uw_msg 1.
  • Grenades follow olds_uw_nades, not the allow list. The C4 is never blocked.
  • Water levels: 1 = feet in the water, 2 = waist deep, 3 = head under water. With the default 3, a player wading waist deep can still shoot.
  • Changes to the cvars work at once, also olds_uw_allow; a name on that list that is not a weapon is reported in the server console.

Settings (addons/amxmodx/configs/plugins/olds_uwshoot.cfg)

  olds_uw_enable 1                    1 = on, 0 = every weapon works under water
  olds_uw_level 3                     water level from which guns are blocked (1 - 3)
  olds_uw_allow "knife usp glock18"   weapons that still work: names without
                                      "weapon_", separated by spaces
  olds_uw_nades 0                     1 = grenades cannot be thrown either
  olds_uw_msg 1                       1 = tell the player why he cannot shoot

No sounds, models or sprites are added.

Credits and licence Written from scratch by alexit (olds.ro workshop) for workshop card LIB-2003. Licence: GNU GPL version 3 or later (GPL-3.0-or-later).

Install

Download the ZIP above and copy its folders into cstrike/. Compile the .sma in addons/amxmodx/scripting with the AMX Mod X 1.10 compiler, put the .amxx in addons/amxmodx/plugins, and add it to plugins.ini.

Files: addons/amxmodx/scripting/olds_uwshoot.sma

Idea: olds.ro workshop library · Plugin: alexit · Tested automatically (compiled on AMX Mod X 1.8.2, 1.9 and 1.10, played on a CS 1.6 test server)
License: GPL-3.0-or-later. Written for the olds.ro plugin workshop (LIB-2003).

Underwater Shooting Control
v1.0.0Counter-Strike 1.6PluginNot tested yet
AMX Mod X 1.10Server engine ReHLDSNeeds ReAPI YesMetamod Metamod-R0 downloads5.4 KBUpdated 10 hours ago
Sign in to download
Pawn (AMX Mod X) · 249 lines
/*
 * Underwater Shooting Control (olds.ro workshop card LIB-2003)
 *
 * Guns do not work under water: a player whose head is under water (or who
 * is in water up to the level set by olds_uw_level) cannot fire or use the
 * secondary attack (scope, silencer, burst mode) of any weapon that is not
 * on the olds_uw_allow list. By default the knife, the USP and the Glock-18
Show all 249 lines

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.