View Single Post
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-21-2020 , 12:22   Re: [L4D2] Weapon Fire Modes
Reply With Quote #2

Excellent, thank you! This will be fun to play with.

Some suggestions:
  • IsValidClient not required.
  • Delete line 186 (getting weapon classname) is already called at function start.
  • StrContains is inefficient. It would be better to do:
PHP Code:
// Skip "weapon_" and compare.
strcmp(sClsName[7], "rifle_desert") == 0

// Only compare the "pistol" part matching "weapon_pistol_magnum" too.
strncmp(sClsName[7], "pistol"6) == 
Any reason for restricting to L4D2 only and using "SDKHook_PostThink" instead of "OnPlayerRunCmd"?
__________________
Silvers is offline