OnChangeActiveWeapon is what's called a "forward". A forward is essentially an event listener, which other plugins (written in SourcePawn, the language of SourceMod) or extensions (written in C++) can call to communicate events and information about them. From what dalto is saying, there's an extension that allows you to monitor players' weapon changes using a forward. You could then make a global array to track all players' weapons.
Mind you, changing a weapon does not indicate the firing of said weapon. I don't know how one would go about doing that in HL2DM (my sole Source multiplayer game of interest), but in CSS the event name is weapon_fire, which contains the player that fired it and the weapon used. Look on the dev wiki:
http://wiki.alliedmods.net/Events_(SourceMod_Scripting) and
http://wiki.alliedmods.net/Game_Events_(Source)
The reason that using OnChangeActiveWeapon and oldweapon works I assume is because a player can only have one grenade.
Also, your code doesn't take into account that there might already be a grenade in flight when another is fired; if the newly fired grenade has a higher entity index than the first, only the old one will be processed.