Add gsc script to disable aimassist when sv_allowAimAssist is set to 0

pull/3/head
Jan 2021-09-01 18:18:44 +02:00
parent 9ed9735592
commit 7c7cc2dea6
1 changed files with 28 additions and 0 deletions

View File

@ -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);
}
}