First - this is a bit ridiculous as everybody here don't want to reveal anything to others but use everything themselves. Try to be little more open to people. And also taking into the account that you just found the code, not wrote it yourself.
Second - if you want me to explain the code
you get a base pointer of a weapon instance, initialized with some data of a specific weapon
Code:
int __stdcall Client_s::iGetWeaponID ( C_BaseCombatWeapon *pBaseCombatWeapon )
then you just call a void-parameter function (returns dword) inside this class (in data segment) which has different offset based on whether this is css or tf2 client
Code:
CALL DWORD PTR DS:[EAX+0x4A4]
CALL DWORD PTR DS:[EAX+0x4F0]
the function returns weapon id in eax, which is then moved into variable and returned.
Code:
MOV iWeaponID, EAX
return iWeaponID;
Third - give me an upper layer, where this function is called, and pointer initialized.
Point is, this function does call something like int GetWeaponId(), but then im interested where the ptr points to or how its initialized.