Raised This Month: $ Target: $400
 0% 

[menu]need help with custom menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 03-25-2009 , 11:20   Re: [menu]need help with custom menu
Reply With Quote #10

SnoW
That was just an example, i use everything you said in ZP_CS_Buymenu

limeassist
yeah, forgot num_to_str works different in c++ and pawn. this one tested.
PHP Code:
new const ACCESS_FLAG ADMIN_BAN//level of access needed to use command
new g_players//amount of player slots on your server

public plugin_init() 
{
    
//blablalbla
    
    
g_players get_maxplayers()

    
register_clcmd("admin_snapshot_menu""clcmd_admin_snapshot_menu"ACCESS_FLAG//register client command
    
}

public 
clcmd_admin_snapshot_menu(id,levelcid)
{
    if (!
cmd_access(idlevelcid2)) return PLUGIN_HANDLED;

    new 
strtemp1[32]
    new 
strtemp2[2]
    new 
snapmenu menu_create("Snapshot player:","snap_handle")  

    for (new 
1<= g_playersi++)
        if (
is_user_alive(i))
    {
        
get_user_name(i,strtemp1,32);
        
num_to_str(i,strtemp2,2);
             
menu_additem(snapmenustrtemp1,strtemp2);
    }
            
    
menu_display(idsnapmenu0);  

}

public 
snap_handle(idmenuitemlevelcid)
{
    new 
cmd[32]; 
    new 
accesscallback//tempvar, unused
    
menu_item_getinfo(menuitemaccesscmd,2,_,_callback); //put selected player id in cmd
    
new selectedplayerid str_to_num(cmd);
    
    if (!
is_user_alive(selectedplayerid)) return PLUGIN_HANDLED;
    
    
playerss(idlevelcid);
    
    return 
PLUGIN_HANDLED;

__________________


Last edited by SonicSonedit; 03-25-2009 at 11:28.
SonicSonedit is offline
 



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 08:55.


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