Fix for the suspicious Weaponname Bug :-)
Posted: Fri Apr 03, 2026 4:29 am
Since the error with the strange weapon names occurred again, I quickly built a solution for it.
Quickly is an joke....
Put these in function in your includes/logspecial.php before the function get_weapon
Search in the function for :
write before that :
after that it looks like this :
save the file and you are ready to go.
Skully
Quickly is an joke....
Code: Select all
function replaceWordsWithNumbers($string) {
// Mapping (lowercase for compare)
$map = array(
'minigun' => 'Minigun',
'flakcannon' => 'FlakCannon',
'assaultrifle' => 'AssaultRiffle',
'rocketlauncher' => 'RocketLauncher',
'biorifle' => 'BioRifle',
'classicsniperrifle' => 'ClassicSniperRifle',
'linkgun' => 'LinkGun',
'lightninggun' => 'LightningGun',
'oldshieldgunut' => 'OldShieldGunUTSnd',
'onsgrenadelauncher' => 'ONSGrenadeLauncher',
'onsminelayer' => 'ONSMineLayer',
'painter' => 'Painter',
'redeemer' => 'Redeemer',
'shieldgun' => 'ShieldGun',
'shockrifle' => 'ShockRifle',
'sniperrifle' => 'SniperRifle'
);
return preg_replace_callback('/\b([a-zA-Z]+)(\d+)\b/u', function($matches) use ($map) {
$word = strtolower($matches[1]);
if (isset($map[$word])) {
return $map[$word];
}
// not in the mapping ... get back original string
return $matches[0];
}, $string);
}
Search in the function for :
Code: Select all
$weapons = sql_addslashes($weapon);
Code: Select all
$weapon = replaceWordsWithNumbers($weapon);
Code: Select all
$weapon = replaceWordsWithNumbers($weapon);
$weapons = sql_addslashes($weapon);
Skully