Raised This Month: $ Target: $400
 0% 

Check and give weapons inaccuracy...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-16-2013 , 15:10   Check and give weapons inaccuracy...
Reply With Quote #1

So I have this code below:
PHP Code:
public Pressedrod(idmenuitem)
{
    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_bpammoidCSW_FLASHBANG );
    new 
HasC4[33], HasHE[33], HasSG[33];
    
HasC4[id] = (user_has_weapon(idCSW_C4))
    
HasHE[id] = (user_has_weapon(idCSW_HEGRENADE))
    
HasSG[id] = (user_has_weapon(idCSW_SMOKEGRENADE))
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    if(
is_user_alive(id) && !g_bRoundEnd)
    {
        
strip_user_weaponsid );
        switch(
key)
        {
        case 
1: {                                  
                
give_item(id,"weapon_m4a1"//Gives M4A1
                
cs_set_user_bpammo(idCSW_M4A190); //Sets M4A1 back pack ammo to 90
                
client_printidprint_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(idCSW_AK4790); //Sets AK47 back pack ammo to 90
                
client_printidprint_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(idCSW_AWP30); //Sets AWP back pack ammo to 30
                
client_printidprint_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_plantid );
            
set_pev(idpev_body1);
        }
        if (
HasHE[id])
        {
            
give_item(id"weapon_hegrenade")
        }
        if (
HasSG[id])
        {
            
give_item(id"weapon_smokegrenade");
        }
        if( 
iFlashes 
        { 
            
give_itemid"weapon_flashbang" ); 
            
cs_set_user_bpammoidCSW_FLASHBANGiFlashes ); 
        } 
        
give_item(id,"weapon_knife"//Gives knife
        
give_item(id,"weapon_deagle"//Gives deagle
        
cs_set_user_bpammo(idCSW_DEAGLE35); //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?
Unkolix is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode