Thread
:
Trying to fix these 2 persistent errors
View Single Post
dirtyminuth
Senior Member
Join Date: Sep 2009
01-14-2011 , 21:40 Re: Trying to fix these 2 persistent errors
#
7
Quote:
Originally Posted by
thatdarnkid
OHH. See, little gears inside my head are starting to turn and I'm starting to understand this stuff.
But what I don't get....is what item would count as -1...
GetPlayerWeaponSlot returns an index to an entity. That entity is the weapon held by said client in said slot. If the client, for some reason, does not have a weapon in that slot, GetPlayerWeaponSlot will return -1.
Look at
SetGrenadeAmmo(client, ammo, index, slot) in your first post. Notice the use of IsValidEntity. You need to implement something similar in other parts of your code (e.g. the code we've been discussing).
__________________
Mods:
[TF2] Zombie Fortress
dirtyminuth
View Public Profile
Send a private message to dirtyminuth
Find More Posts by dirtyminuth