View Single Post
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 12-25-2016 , 18:23   Re: Frags,shield and invisibility issue
Reply With Quote #15

P228 is not a primary weapon actually. You probably wanted to write CSW_ELITE.

Code:
#define m_rgPlayerItems[6] = {367, 368, ...}

new weaponent = get_pdata_cbase(id, m_rgPlayerItems[1]) // pointer to the weapon(s) in each slot.

if (weaponent > 0) // we have a primary weapon
{
        new wname[32]
        get_weaponname(cs_get_weapon_id(weaponent), wname, charsmax(wname));
        engclient_cmd(id, "drop", wname);
}
else if (user_has_weapon(id, CSW_ELITE))
{
         engclient_cmd(id, "drop", "weapon_elite");
}
Edit.
You can also trying looking at the code from this post.
__________________


Last edited by NiHiLaNTh; 12-25-2016 at 18:28.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh