Hi.
Well I've created a VIP menu plugin for my personal server and it's working perfectly, except one thing.
After choosing from menu, player who has C4, it doesn't show C4 back model.
If someone knows what's missing here, I'd be grateful to be taught.
PHP Code:
public WpHandler(id, EXIT, item)
{
if (!is_user_alive(id))
return PLUGIN_HANDLED
if(item == MENU_EXIT)
{
menu_destroy(EXIT);
return PLUGIN_HANDLED;
}
switch(item)
{
case 0: {
if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
PlayerhasC4[id] = true;
else
PlayerhasC4[id] = false;
strip_user_weapons(id);
give_item(id, "weapon_m4a1");
cs_set_user_bpammo(id, CSW_M4A1, 90);
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);
give_item(id, "weapon_knife");
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "item_thighpack");
give_item(id, "item_assaultsuit");
if (PlayerhasC4[id])
{
give_item(id, "weapon_c4");
cs_set_user_plant( id );
cs_set_user_submodel(id, 1); // <--- THIS LINE WAS NEEDED.
}
}