So I have this code below:
PHP Code:
public Pressedrod(id, menu, item)
{
if( item == MENU_EXIT ) //Checks if player clicks menu exit (0)
{
menu_destroy(menu); //If so the menu will be destroyed
return PLUGIN_HANDLED;
}
new iFlashes = cs_get_user_bpammo( id, CSW_FLASHBANG );
new HasC4[33], HasHE[33], HasSG[33];
HasC4[id] = (user_has_weapon(id, CSW_C4))
HasHE[id] = (user_has_weapon(id, CSW_HEGRENADE))
HasSG[id] = (user_has_weapon(id, CSW_SMOKEGRENADE))
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
new key = str_to_num(data);
if(is_user_alive(id) && !g_bRoundEnd)
{
strip_user_weapons( id );
switch(key)
{
case 1: {
give_item(id,"weapon_m4a1") //Gives M4A1
cs_set_user_bpammo(id, CSW_M4A1, 90); //Sets M4A1 back pack ammo to 90
client_print( id, print_center, "%L", id, "CHOSE_M4A1" ); //Shows a message that's set in vipplugin.txt as CHOSE_M4A1
}
case 2: {
give_item(id,"weapon_ak47") //Gives AK47
cs_set_user_bpammo(id, CSW_AK47, 90); //Sets AK47 back pack ammo to 90
client_print( id, print_center, "%L", id, "CHOSE_AK47" ); //Shows a message that's set in vipplugin.txt as CHOSE_AK47
}
case 3: {
give_item(id,"weapon_awp") //Gives AWP
cs_set_user_bpammo(id, CSW_AWP, 30); //Sets AWP back pack ammo to 30
client_print( id, print_center, "%L", id, "CHOSE_AWP" ); //Shows a message that's set in vipplugin.txt as CHOSE_AWP
}
}
if (HasC4[id])
{
give_item(id, "weapon_c4");
cs_set_user_plant( id );
set_pev(id, pev_body, 1);
}
if (HasHE[id])
{
give_item(id, "weapon_hegrenade")
}
if (HasSG[id])
{
give_item(id, "weapon_smokegrenade");
}
if( iFlashes > 0 )
{
give_item( id, "weapon_flashbang" );
cs_set_user_bpammo( id, CSW_FLASHBANG, iFlashes );
}
give_item(id,"weapon_knife") //Gives knife
give_item(id,"weapon_deagle") //Gives deagle
cs_set_user_bpammo(id, CSW_DEAGLE, 35); //Sets deagle back pack ammo to 35
if(g_bHasBombSite && cs_get_user_team(id) == CS_TEAM_CT) //Checks if current map has bombsite
{
give_item(id, "item_thighpack"); //Gives defuse kit
}
gMenuUsed[id]++ //Makes sure that VIP really made a choice
}
menu_destroy(menu); //Destroys menu
return PLUGIN_CONTINUE
}
After I throw a grenade and really fast choose any of the cases I still get the grenade back... That's the inaccuracy, you actually don't have the grenade, but you still get it... Is it possible to fix this somehow?