Raised This Month: $ Target: $400
 0% 

Menu little bug


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 02-03-2010 , 05:03   Menu little bug
Reply With Quote #1

I got a small bug, that I cant get wath its wrong, i've read the code a lot of times but I cant find a solution.
Code features: Its shows a menu for CTS when they respawn and they can pick some guys with different guns menu.
Bugs:
-When you pick guy 3 you should get a shield but it doesnt work.

Please I really need this help.
PHP Code:
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <engine_stocks>

#define OFFSET_PRIMARYWEAPON        116 


new g_iMenu;


public 
plugin_init() {
    
register_plugin"Tipos armas""1.0""benamo6" );    
    
RegisterHamHam_Spawn"player""HamPlayerSpawn");
    
    
g_iMenu menu_create"Elegi a alguien:""HandleWeaponsMenu" );
    
menu_additemg_iMenu"Capo""1");
    
menu_additemg_iMenu"Groso""2");
    
menu_additemg_iMenu"Gil""3");
    
menu_setpropg_iMenuMPROP_EXITMEXIT_ALL ); 
    
}


public 
HamPlayerSpawn(id) {
    if( 
cs_get_user_teamid ) == CS_TEAM_CT ) {
        
menu_displayidg_iMenu);
    }
}

public 
HandleWeaponsMenuidiMenuiItem ) {
    if( 
iItem == MENU_EXIT || !is_user_aliveid ) )
        return 
PLUGIN_HANDLED;
    
    new 
szKey], _Trash;
    
menu_item_getinfoiMenuiItem_TrashszKey1""0_Trash );
    
    switch( 
szKey] ) {
        case 
'1': {
            if(
cs_get_user_teamid ) == CS_TEAM_CT)
            {
                
set_user_armor(id0);
                
set_user_health(id65);
            }
        }
        case 
'2': {
            if(
cs_get_user_teamid ) == CS_TEAM_CT)
            {
                
set_user_maxspeed(id290.0)
            }
        }
        case 
'3': {
            if(
cs_get_user_teamid ) == CS_TEAM_CT)
            {
                
set_user_maxspeed(id335.0)
                
strip_user_weaponsid );
                
set_pdata_int(idOFFSET_PRIMARYWEAPON0)
                
give_itemid"weapon_knife" );
                
give_itemid"weapon_shield" ); 
                
give_itemid"weapon_fiveseven" ); 
                
cs_set_user_bpammoidCSW_FIVESEVEN100 );
                
give_item(id"weapon_hegrenade")
                
give_item(id"weapon_smokegrenade")
                
set_user_health(id100);
                
set_user_armor(id100);
            }
        }
        
    }
    return 
PLUGIN_HANDLED;

__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it

Last edited by benamo6; 02-03-2010 at 05:28.
benamo6 is offline
Send a message via MSN to benamo6
 



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 07:22.


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