Raised This Month: $ Target: $400
 0% 

Menu little bug


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
benjibau
Veteran Member
Join Date: Jul 2009
Location: France (Nord 59)
Old 02-03-2010 , 05:45   Re: Menu little bug
Reply With Quote #2

try this

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun> 

new g_Maxplayers
new g_iMenu1

public plugin_init() 
{
    
register_plugin"Tipos armas""1.1""benamo6" );    

    
register_logevent("Event_Round_Start"2"1=Round_Start")

    
g_Maxplayers get_maxplayers()

    
Menus()
}

Menus()
{
    
g_iMenu1 menu_create("\wChoose:""primmenu_handler")
    
menu_additemg_iMenu1"Capo""1");
    
menu_additemg_iMenu1"Groso""2");
    
menu_additemg_iMenu1"Gil""3");
    
menu_setprop(g_iMenu1MPROP_EXITMEXIT_ALL)
}

public 
plugin_end()
{
    
menu_destroy(g_iMenu1)
}

public 
Event_Round_Start()
{
    for(new 
id 1id <= g_Maxplayersid++)
    {
        if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
        {
            
menu_display(idg_iMenu10)
        }
    }
}

public 
primmenu_handler(idg_iMenu1item)
{
    if (
item == MENU_EXIT)
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(g_iMenu1itemaccessdata5iName63callback)

    switch( 
str_to_num(data) )
    {
        case 
1:
        {
            
set_user_armor(id0);
            
set_user_health(id65);
        }
        case 
2:
        {
            
set_user_maxspeed(id290.0)
        }
        case 
3:
        {
            
strip_user_weapons(id);
            
set_user_maxspeed(id335.0)
            
give_item(id"weapon_knife")
            
give_item(id"weapon_shield")
            
give_item(id"weapon_fiveseven"
            
cs_set_user_bpammo(idCSW_FIVESEVEN100)
            
give_item(id"weapon_hegrenade")
            
give_item(id"weapon_smokegrenade")
            
set_user_health(id100);
            
set_user_armor(id100);
        }
    }
    return 
PLUGIN_HANDLED

benjibau is offline
Send a message via MSN to benjibau
 



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