Updated T6 AC GSC (#214)
* PlutoT6 AC GSC Updated PlutoT6's GSC modding capabilities changed, this allows us to bring the script on parity with the IW4x one. The following things changed: * Script no longer replaces stock GSC since custom GSC files are now supported. * The Script now captures the last time the client used his attack button; this is used to detect trigger bots. * Cleaned up the code a bit * Create README.MD Basic installation guide.
This commit is contained in:
parent
596272a3de
commit
8c5ff440db
35
GameFiles/PT6/README.MD
Normal file
35
GameFiles/PT6/README.MD
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# T6
|
||||||
|
|
||||||
|
This brings IW4M-Admins's Anti-cheat to Plutonium T6
|
||||||
|
The following limitations are known:
|
||||||
|
* Can't get the recoil from weapons fire; you have to disable this detection type manually.
|
||||||
|
* in extreme cases it can produce false positives for Snap and Offset detection.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
|
||||||
|
Move `_customcallbacks.gsc` to `%localappdata%\Plutonium\storage\t6\scripts\mp\`
|
||||||
|
|
||||||
|
Add this to the WeaponNameParserConfigurations List in the StatsPluginSettings.json file:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"Game": "T6",
|
||||||
|
"Delimiters": [
|
||||||
|
"_",
|
||||||
|
"+"
|
||||||
|
],
|
||||||
|
"WeaponSuffix": "mp",
|
||||||
|
"WeaponPrefix": null
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now create the following entry for __EVERY__ T6 server you are using this on in the ServerDetectionTypes list:
|
||||||
|
|
||||||
|
```
|
||||||
|
"1270014976": [
|
||||||
|
"Offset",
|
||||||
|
"Strain",
|
||||||
|
"Snap"
|
||||||
|
]
|
||||||
|
```
|
BIN
GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc
Normal file
BIN
GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc
Normal file
Binary file not shown.
@ -3,24 +3,6 @@
|
|||||||
#include common_scripts\utility;
|
#include common_scripts\utility;
|
||||||
|
|
||||||
init()
|
init()
|
||||||
{
|
|
||||||
level.clientid = 0;
|
|
||||||
level thread onplayerconnect();
|
|
||||||
level thread IW4MA_init();
|
|
||||||
}
|
|
||||||
|
|
||||||
onplayerconnect()
|
|
||||||
{
|
|
||||||
for ( ;; )
|
|
||||||
{
|
|
||||||
level waittill( "connecting", player );
|
|
||||||
player.clientid = level.clientid;
|
|
||||||
level.clientid++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
IW4MA_init()
|
|
||||||
{
|
{
|
||||||
SetDvarIfUninitialized( "sv_customcallbacks", true );
|
SetDvarIfUninitialized( "sv_customcallbacks", true );
|
||||||
SetDvarIfUninitialized( "sv_framewaittime", 0.05 );
|
SetDvarIfUninitialized( "sv_framewaittime", 0.05 );
|
||||||
@ -29,53 +11,52 @@ IW4MA_init()
|
|||||||
SetDvarIfUninitialized( "sv_printradarupdates", 0 );
|
SetDvarIfUninitialized( "sv_printradarupdates", 0 );
|
||||||
SetDvarIfUninitialized( "sv_printradar_updateinterval", 500 );
|
SetDvarIfUninitialized( "sv_printradar_updateinterval", 500 );
|
||||||
SetDvarIfUninitialized( "sv_iw4madmin_url", "http://127.0.0.1:1624" );
|
SetDvarIfUninitialized( "sv_iw4madmin_url", "http://127.0.0.1:1624" );
|
||||||
|
|
||||||
level thread IW4MA_onPlayerConnect();
|
level thread onPlayerConnect();
|
||||||
if (getDvarInt("sv_printradarupdates") == 1)
|
if (getDvarInt("sv_printradarupdates") == 1)
|
||||||
{
|
{
|
||||||
level thread runRadarUpdates();
|
level thread runRadarUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
level waittill( "prematch_over" );
|
level waittill( "prematch_over" );
|
||||||
level.callbackPlayerKilled = ::Callback_PlayerKilled;
|
level.callbackPlayerKilled = ::Callback_PlayerKilled;
|
||||||
level.callbackPlayerDamage = ::Callback_PlayerDamage;
|
level.callbackPlayerDamage = ::Callback_PlayerDamage;
|
||||||
level.callbackPlayerDisconnect = ::Callback_PlayerDisconnect;
|
level.callbackPlayerDisconnect = ::Callback_PlayerDisconnect;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Does not exist in T6
|
//It's called slightly different in T6
|
||||||
|
//set_dvar_if_unset(dvar, val, reset)
|
||||||
SetDvarIfUninitialized(dvar, val)
|
SetDvarIfUninitialized(dvar, val)
|
||||||
{
|
{
|
||||||
curval = getDvar(dvar);
|
set_dvar_if_unset(dvar,val);
|
||||||
if (curval == "")
|
|
||||||
SetDvar(dvar,val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IW4MA_onPlayerConnect( player )
|
onPlayerConnect( player )
|
||||||
{
|
{
|
||||||
for( ;; )
|
for( ;; )
|
||||||
{
|
{
|
||||||
level waittill( "connected", player );
|
level waittill( "connected", player );
|
||||||
player thread waitForFrameThread();
|
player thread waitForFrameThread();
|
||||||
//player thread waitForAttack();
|
player thread waitForAttack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Does not work in T6
|
//Got added to T6 on April 2020
|
||||||
/*waitForAttack()
|
waitForAttack()
|
||||||
{
|
{
|
||||||
self endon( "disconnect" );
|
self endon( "disconnect" );
|
||||||
|
|
||||||
self.lastAttackTime = 0;
|
self.lastAttackTime = 0;
|
||||||
|
|
||||||
for( ;; )
|
for( ;; )
|
||||||
{
|
{
|
||||||
self notifyOnPlayerCommand( "player_shot", "+attack" );
|
self notifyOnPlayerCommand( "player_shot", "+attack" );
|
||||||
self waittill( "player_shot" );
|
self waittill( "player_shot" );
|
||||||
|
|
||||||
self.lastAttackTime = getTime();
|
self.lastAttackTime = getTime();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
runRadarUpdates()
|
runRadarUpdates()
|
||||||
{
|
{
|
||||||
@ -95,7 +76,7 @@ runRadarUpdates()
|
|||||||
}
|
}
|
||||||
|
|
||||||
wait( interval / 1000 );
|
wait( interval / 1000 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hitLocationToBone( hitloc )
|
hitLocationToBone( hitloc )
|
||||||
@ -144,7 +125,7 @@ hitLocationToBone( hitloc )
|
|||||||
waitForFrameThread()
|
waitForFrameThread()
|
||||||
{
|
{
|
||||||
self endon( "disconnect" );
|
self endon( "disconnect" );
|
||||||
|
|
||||||
self.currentAnglePosition = 0;
|
self.currentAnglePosition = 0;
|
||||||
self.anglePositions = [];
|
self.anglePositions = [];
|
||||||
|
|
||||||
@ -152,7 +133,7 @@ waitForFrameThread()
|
|||||||
{
|
{
|
||||||
self.anglePositions[i] = self getPlayerAngles();
|
self.anglePositions[i] = self getPlayerAngles();
|
||||||
}
|
}
|
||||||
|
|
||||||
for( ;; )
|
for( ;; )
|
||||||
{
|
{
|
||||||
self.anglePositions[self.currentAnglePosition] = self getPlayerAngles();
|
self.anglePositions[self.currentAnglePosition] = self getPlayerAngles();
|
||||||
@ -165,9 +146,9 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount )
|
|||||||
{
|
{
|
||||||
currentIndex = self.currentAnglePosition;
|
currentIndex = self.currentAnglePosition;
|
||||||
wait( 0.05 * afterFrameCount );
|
wait( 0.05 * afterFrameCount );
|
||||||
|
|
||||||
self.angleSnapshot = [];
|
self.angleSnapshot = [];
|
||||||
|
|
||||||
for( j = 0; j < self.anglePositions.size; j++ )
|
for( j = 0; j < self.anglePositions.size; j++ )
|
||||||
{
|
{
|
||||||
self.angleSnapshot[j] = self.anglePositions[j];
|
self.angleSnapshot[j] = self.anglePositions[j];
|
||||||
@ -209,7 +190,7 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount )
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastAttack = 100;//int(getTime()) - int(self.lastAttackTime);
|
lastAttack = int(getTime()) - int(self.lastAttackTime);
|
||||||
isAlive = isAlive(self);
|
isAlive = isAlive(self);
|
||||||
|
|
||||||
logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" );
|
logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" );
|
||||||
@ -261,7 +242,7 @@ Callback_PlayerDamage( eInflictor, attacker, iDamage, iDFlags, sMeansOfDeath, sW
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( self.health - iDamage > 0 )
|
if ( self.health - iDamage > 0 )
|
||||||
{
|
{
|
||||||
self Process_Hit( "Damage", attacker, sHitLoc, sMeansOfDeath, iDamage, sWeapon );
|
self Process_Hit( "Damage", attacker, sHitLoc, sMeansOfDeath, iDamage, sWeapon );
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user