View Single Post
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-11-2010 , 00:22   Re: [L4D2] Drop weapon when punched (v1.0)
Reply With Quote #6

You should check that client is not invalid on line 111. Invalid being 0. Clients start from an index of 1. The IsValidClient() function does this, but you put GetClientTeam before the function checks.

PHP Code:
if (IsValidClient(attacker) && GetClientTeam(client) == && IsPlayerTank(attacker)) 


Quote:
Note: Registers all playable classes (Hunter, Smoker, Boomer, Tank, Survivors). See infected_hurt for Witch and Common Infected

userid user ID who was hurt
attacker user id who attacked
attackerentid entity id who attacked, if attacker not a player, and userid therefore invalid
I'm assuming the userID can also be invalid, like the player_death event. Bit cryptic if you ask me

Hope it helps
__________________
Silvers is offline