Ok, I did a new version of the patch to take account of the legal weapons only...
This time, it's done in two parts in etadmin_mod.pl:
- a declaration table
- the patch by itself
For the declaration find:
Code:
##############################################################
# ------------------------------------------------------------
# ----------- Don't change anything below this line ----------
# --------------- unless you know what you do! ---------------
# ------------------------------------------------------------
ABOVE add these lines:
Code:
# START: [FanT]AsthMaTiK tcetest Legal Weapons Declaration
my %TCE_LegalWeapons = (
'0' => 'Empty_At_Connection',
'2' => 'SH1' ,
'3' => 'SH8' ,
'5' => 'TH6' ,
'6' => 'TH19',
'7' => 'SH6' ,
'8' => 'TH1' ,
'10' => 'SH7' ,
'13' => 'TH20',
'14' => 'SH4' ,
'23' => 'TH16',
'24' => 'TH10',
'25' => 'TH18',
'32' => 'TH17',
'33' => 'TH4' ,
'37' => 'SHA2',
'38' => 'SHA1',
'39' => 'SH2' ,
'40' => 'SH5' ,
'41' => 'TH3' ,
'42' => 'TH5' ,
'43' => 'TH8' ,
'44' => 'TH7' ,
'45' => 'TH2' ,
'46' => 'TH15',
'47' => 'TH13',
'48' => 'TH11',
'49' => 'TH12',
'50' => 'TH9' ,
'51' => 'TH14',
'52' => 'SH3' ,
'53' => 'SHA4',
'54' => 'SHA3',
);
# END: [FanT]AsthMaTiK tcetest Legal Weapons Declaration
For the patch by itself, it is in the same place as before (line 2918-2920 in original version):
Code:
$guid =~ s/ $//g;
$guid = $over_guid if ( !$guid );
$userinfo{$name} = $guid if ( !defined( $userinfo{$name} ) && $guid );
AFTER add the following code:
Code:
# START: [FanT]AsthMaTiK tcetest [15 grenades/15 flashs/skin change/other team command] cheats fix
my $side_weapon = $$rhash{'sw'};
my $latched_weapon = $$rhash{'lw'};
# 15 NADES CHEAT
if ( ( $side_weapon == 9 ) || ( $weapon == 9 ) || ( $latched_weapon == 9 ) )
{
&log("[15 NADES CHEAT] Kicked $name ($guid). He wanted to use the cheat of the 15 grenades!");
&global_remote_send( "^1[15 NADES CHEAT]: $name $guid", "ETM-INFO" );
&say( "^1[15 NADES CHEAT]^3 $name -> Kick !!!" );
&kick( $client_id, "^1[15 NADES CHEAT] Attempt of cheat!" );
last;
}
# 15 FLASHS CHEAT
if ( ( $side_weapon == 4 ) || ( $weapon == 4 ) || ( $latched_weapon == 4 ) )
{
&log("[15 FLASHS CHEAT] Kicked $name ($guid). He wanted to use the cheat of the 15 flashs!");
&global_remote_send( "^1[15 FLASHS CHEAT]: $name $guid", "ETM-INFO" );
&say( "^1[15 FLASHS CHEAT]^3 $name -> Kick !!!" );
&kick( $client_id, "^1[15 FLASHS CHEAT] Attempt of cheat!");
last;
}
# CHANGE OF SKIN
if ( $class == 6 )
{
&log("[CHANGE OF SKIN] Kicked $name ($guid). He was using the change to vip skin!");
&global_remote_send( "^1[CHANGE OF SKIN] $name $guid ^3-> Kick !!!", "ETM-INFO" );
&say( "^1[CHANGE OF SKIN]^3 $name -> Kick !!!" );
&kick( $client_id, "^1[CHANGE OF SKIN] You are not allowed to change of skin!" );
last;
}
# Other /TEAM CHEAT ATTEMPT
if (
( $team > 3 )
|| ( $class >= 6 )
|| ( length( $TCE_LegalWeapons{$weapon} ) == 0 )
|| ( length( $TCE_LegalWeapons{$side_weapon} ) == 0 )
|| ( length( $TCE_LegalWeapons{$latched_weapon} ) == 0 )
)
{
&log("[/TEAM CHEAT ATTEMPT] Kicked $name ($guid). He wanted to use the cheat trying the /team $team $class $weapon $side_weapon !");
&global_remote_send( "^1[CHEAT ATTEMPT]: $name $guid /team $team $class $weapon $side_weapon", "ETM-INFO" );
&say( "^1[/TEAM CHEAT ATTEMPT]^3 $name -> Kick !!!" );
&kick( $client_id, "^1[/TEAM CHEAT ATTEMPT] You are not allowed to use illegal /team command!");
last;
}
# END: [FanT]AsthMaTiK tcetest [15 grenades/15 flashs/skin change/other team command] cheats fix
How it works ?
In %TCE_LegalWeapons are defined all the legal weaponID codes associated to their number.
When a number is passed in the /team command, it checks the length of the string associated inside
It's a lot easy for perl to use such structures.
I added the code 0, even if it's an illegal value, as it is used at connection.
It would be sad to be kicked for nothing
I hope this will help you Dutchmeat, we still need the anti-nuke and weaponstats at a lower level
P.S.:
You need to use \w and \sw, because you can reverse order of weapons in the team command...
That's how cheaters defeated your fix
