Quote:
Originally Posted by nikhilgupta345
Show the full code. It would also help if you told us which line was line 268.
Also, I don't think the errors you posted are from that part of the code.
|
Error code line was wrong... and has been found... 50 of my code uses get_pdata_cbase...
PHP Code:
#define OFFSET_PRIMARYWEAPON 116
#define OFFSET_C4_SLOT 372
public StripUserWeapons(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED;
new iC4Ent = get_pdata_cbase(id, OFFSET_C4_SLOT);
if( iC4Ent > 0 )
{
set_pdata_cbase(id, OFFSET_C4_SLOT, FM_NULLENT);
}
strip_user_weapons(id);
give_item(id, "weapon_knife");
set_pdata_int(id, OFFSET_PRIMARYWEAPON, 0);
if( iC4Ent > 0 )
{
entity_set_int(id, EV_INT_weapons, entity_get_int(id, EV_INT_weapons) | (1<<CSW_C4));
set_pdata_cbase(id, OFFSET_C4_SLOT, iC4Ent);
cs_set_user_bpammo(id, CSW_C4, 1);
cs_set_user_plant(id, 1);
}
if (g_bomb_targ)
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
cs_set_user_defuse(id, 1);
}
}
return PLUGIN_HANDLED;
}
Adding in is alive worked just fine.