Then wtf is that?!
Code:
/* Returns entvar data from an entity Use the pev_* enum to specify which form of data you want returned.
*
* If retrieving strings, you may optionally get a pointer into the global string table. Depending on
* your situation, there are two ways to do this.
* 1: This simply gets the pointer.
* new ptr = pev(entid, pev_classname)
* 2: The pointer will be stored in ptr AND the actual string is retrieved.
* new ptr, classname[32]
* pev(entid, pev_classname, ptr, classname, 31)
*/
native pev(_index,_value,{Float,Sql,Result,_}:...);
Anyway it works ok. Did you check the result value for cs_get_weapon_id() ?