Raised This Month: $ Target: $400
 0% 

Help Me In My MENU!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
benjibau
Veteran Member
Join Date: Jul 2009
Location: France (Nord 59)
Old 10-23-2009 , 17:16   Re: Help Me In My MENU!
Reply With Quote #3

try this code

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

#define PLUGIN "Last ResTquest Menu"
#define VERSION "1.0"
#define AUTHOR "[M]aNuC[s]_"

new g_iLastTerroristId 

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("DeathMsg""evDeathMsg""b")
    
register_clcmd"say /lr","MenuLR");
    
register_clcmd"say !lr","MenuLR");
    
register_clcmd"say_team /lr","MenuLR");
    
register_clcmd"say_team !lr","MenuLR");
}

public 
MenuLR(id

    new 
Menu menu_create("\w Last Resquest:""menu_cases")
    
menu_additem(Menu"\w Khife Duel"        "1"0)
    
menu_additem(Menu"\w Shot For Shot"        "2"0
    
    
menu_setprop(Menu,MPROP_EXITNAME,"Salir"
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL
    
    
menu_display(idMenu0
}

public 
menu_cases(idMenuitem

    if (
item == MENU_EXIT
    { 
        
menu_destroy(Menu
        return 
PLUGIN_HANDLED 
    

    
    new 
iData[6]; 
    new 
iAccess
    new 
iCallback
    new 
iName[64]; 
    
menu_item_getinfo(MenuitemiAccessiData5iName63iCallback
    
    switch (
str_to_num(iData)) 
    { 
        case 
1:
        {
            if( 
is_user_alive(id) )
            {
                
give_item(id"weapon_knife");
                
set_user_health(id100);
                
strip_user_weapons(id)    
                
client_print(idprint_chat"Duel Khife...")
            }
        }
        case 
2:
        {
            if( 
is_user_alive(id) )
            {
                
strip_user_weapons (id)  
                
set_user_health(id100);
                
give_item(id,"weapon_deagle")
                
cs_set_user_bpammo(id,CSW_DEAGLE,200)
                
client_print(idprint_chat"Shot For Shot...")
            }  
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
evDeathMsg(id)
{
    new 
iPlayers[32], iNumPlayers
    
new 0iPlayerIDiCount 0iLoneID 0
    
    
for(0iNumPlayersi++)
    {
        
iPlayerID iPlayers[i]
        if( 
is_user_alive(iPlayerID) && cs_get_user_team(iPlayerID) == CS_TEAM_T )
        {
            
iCount++
            
iLoneID iPlayerID
        
}
    }
    
    if(
iCount == 1)
    {
        
g_iLastTerroristId iLoneID
    
}
}

public 
OpenMenu(id)
{
    if( 
id == g_iLastTerroristId)
    {
        
MenuLR(id)
    }
    else
    {
        
client_print(idprint_chat"Cant Use The LR Menu!")
    }

PHP Code:
register_clcmd"say /lr","OpenMenu");
  
register_clcmd"say !lr","OpenMenu"); 
to
PHP Code:
register_clcmd"say /lr","MenuLR");
  
register_clcmd"say !lr","MenuLR"); 
Because MenuLR is for create menu in your cvar you use not that
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 17:32.


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