//============================================================================= // CheaterPRI. //============================================================================= class CheaterPRI extends PlayerReplicationInfo; var bool bTestPerformed; var bool bServerInit; var(DefaultGameMutator) int WasCheating; var(DefaultGameMutator) ENetRole RemoteRole; var(DefaultGameMutator) bool bAlwaysRelevant; var int MaxTick,TickCount; replication { reliable if(Role Message,int Sw) { local Controller C; local PlayerReplicationInfo PRI; if (Role==ROLE_Authority) { for( C=Level.ControllerList;C!=None;C=C.NextController ) { PRI = C.PlayerReplicationInfo; if( (PRI != None) && !PRI.bBot && MessagingSpectator(C)== None) { if ((Me.PlayerReplicationInfo.PlayerID!=C.PlayerReplicationInfo.PlayerID) && (C.IsA('PlayerController'))) { Level.Game.Broadcasthandler.BroadcastLocalized(Me, PlayerController(C), Message, Sw, Me.PlayerReplicationInfo); } } } } } function ServerPlayerCheats(PlayerController C,int Sw) { BroadcastToAllExceptMe(C,class'CheatMessage',Sw); } simulated function bool CheckWeapon(class WeaponClass,float DefPrimary,float DefSecondary) { local bool a,b; a=False; b=False; if (WeaponClass.default.FireTime[0]!=DefPrimary) { WeaponClass.default.FireTime[0]=DefPrimary; //log("----- Primary Haxor!!! " $ String(WeaponClass)); //NotifyMeCheating("<< " $ String(WeaponClass) $ " primary fire rate modified!"); a=True; } if (WeaponClass.default.FireTime[1]!=DefSecondary) { WeaponClass.default.FireTime[1]=DefSecondary; //log("----- Secondary Haxor!!! " $ String(WeaponClass)); //NotifyMeCheating("<< " $ String(WeaponClass) $ " secondary fire rate modified!"); b=True; } return a || b; } /*simulated function NotifyMeCheating(string Msg) { Level.GetLocalPlayerController().Say(Chr(12) $ "" $ Msg); }*/ simulated function PerformCheatingTest() { local bool cheat; if (!bTestPerformed) { //log("--------- Performing Cheating Test ----------"); cheat=False; cheat=CheckWeapon(class'AssaultRifle', 0.1, 1.0) || cheat; cheat=CheckWeapon(class'EnergyRifle', 0.3, 2.0) || cheat; cheat=CheckWeapon(class'Flamethrower', 0.1, 0.1) || cheat; cheat=CheckWeapon(class'Pistol', 0.6, 1.1) || cheat; cheat=CheckWeapon(class'RocketLauncherEx', 1.08, 1.08) || cheat; cheat=CheckWeapon(class'RocketLauncher', 1.08, 1.08) || cheat; cheat=CheckWeapon(class'Shotgun', 0.93, 1.18) || cheat; cheat=CheckWeapon(class'SniperRifle', 1.0, 0.0) || cheat; cheat=CheckWeapon(class'WeaponAutoTurret', 0.1, 1.0) || cheat; cheat=CheckWeapon(class'WeaponRocketTurret',1.08, 1.08) || cheat; cheat=CheckWeapon(class'GrenadeLauncher', 1.33, 1.33) || cheat; cheat=CheckWeapon(class'GrenadeLauncherHeavy', 1.33, 1.33) || cheat; cheat=CheckWeapon(class'GrenadeLauncherLight', 1.33, 1.33) || cheat; cheat=CheckWeapon(class'GrenadeLauncherMedium', 1.33, 1.33) || cheat; if (cheat) { WasCheating=15; } bTestPerformed=True; MaxTick=500; TickCount=100; } else { if (WasCheating>0) { TickCount++; if (TickCount>MaxTick) { //NotifyMeCheating(PlayerName $ " WAS USING FIRE RATE HACK (Auto message " $ String(WasCheating) $ ")"); TickCount=0; WasCheating--; ServerPlayerCheats(Level.GetLocalPlayerController(),WasCheating); } } } } simulated function Tick(float DeltaTime) { if (Role < ROLE_Authority) //Client { PerformCheatingTest(); } super.Tick(DeltaTime); } defaultproperties { }