Craxor Thanks a lot it works great but one little problem when i am having CSW_P90 weapon it does not drop and add shield
NiHiLaNTh Thanks you for little code i tried your code i m getting undefined symbol "m_rgPlayerItems" while compiling
PHP Code:
#include < amxmodx >
#include < fun >
#include < hamsandwich >
#define m_rgPlayerItems[6] = {367, 368, ...}
public plugin_init()
{
register_clcmd("say /shield","get_a_shield");
}
public get_a_shield(id)
{
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");
}
set_task(1.0,"give_shield",id);
}
public give_shield(id)
{
if(is_user_alive(id))
{
give_item(id,"weapon_shield");
client_print(id,print_chat,"Now i added shield");
}
}
this code (
link) is already tried does not work when i m having primary weapon
__________________
Thanks everyone. #miss_you_all