View Single Post
MasterMind420
BANNED
Join Date: Nov 2010
Old 08-20-2016 , 23:11   Re: [L4D2] Improved Prevent M60 Drop
Reply With Quote #5

Quote:
Originally Posted by cravenge View Post
MasterMind, I advice you to always check if the "m_hActiveWeapon" netprop returns -1 because it produces errors about "Entity index -1 is invalid".

Code:
new Weapon = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon");
if(Weapon == -1 || !IsValidEntity(Weapon))
    return Plugin_Continue;
hmm i've yet to see that error in this plugin, although i have in other plugins i'll keep an eye out for it, wouldn't checking if its a valid entity to begin with be enough? I haven't played through an entire map yet and fully tested it though, thanks for the heads up...I'm gonna be rewriting it abit more anyway so i'll keep that in mind...

Last edited by MasterMind420; 08-20-2016 at 23:12.
MasterMind420 is offline