From 7c7cc2dea692f47ae2c6cc2387abbd355eca6e9c Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 1 Sep 2021 18:18:44 +0200 Subject: [PATCH] Add gsc script to disable aimassist when sv_allowAimAssist is set to 0 --- iw4x/iw4x_00/scripts/_aimassist.gsc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 iw4x/iw4x_00/scripts/_aimassist.gsc diff --git a/iw4x/iw4x_00/scripts/_aimassist.gsc b/iw4x/iw4x_00/scripts/_aimassist.gsc new file mode 100644 index 0000000..6dbff20 --- /dev/null +++ b/iw4x/iw4x_00/scripts/_aimassist.gsc @@ -0,0 +1,28 @@ +// ======================================================== +// This script disables aim assist features on clients. +// To configure this behaviour change the value of the sv_allowAimAssist dvar. +// Put this file in your scripts folder. +// ======================================================== + +#include maps\mp\_utility; + +init() +{ + aimAssistAllowed = getDvarInt("sv_allowAimAssist"); + if (aimAssistAllowed <= 0) + { + level thread disableAimAssistForConnectedPlayers(); + } +} + +disableAimAssistForConnectedPlayers() +{ + for(;;) + { + level waittill( "connected", player ); + + // The dvars are cheat protected and not saved. They will be reset automatically upon joining another server. + player setClientDvar("aim_lockon_enabled", 0); + player setClientDvar("aim_slowdown_enabled", 0); + } +} \ No newline at end of file