Thread: [Solved] native
View Single Post
Author Message
Theodore Bagwell
Member
Join Date: Jan 2021
Location: USA
Old 03-13-2021 , 02:35   native
#1

how can i make a native like this?
PHP Code:
addmenu_hp(const name, const handlerteam
I want to add a menu to the / hp command with this native. Please give an example
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
regsiret_clcmd("say /hp""hpcdm")
}
public 
hpcmd(id)
{
    new 
szText[555 char]
    
formatex(szTextcharsmax(szText), "HP")
    new 
menu menu_create(szText"hp2")
    
    
formatex(szTextchatsmax(szText), "\w 300 HP")
    
menu_additem(szTextmenu"1"0)
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
    return 
PLUGIN_CONTINUE
}
public 
hp2(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    new 
data], iName64 ], accesscallback;
    
menu_item_getinfomenuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback );
    
    switch(
key)
    {
        case 
1:
        {
            
set_user_health(id300)
        }
    }
    return 
PLUGIN_HANDLED


Last edited by asherkin; 03-13-2021 at 15:16. Reason: Restore to previous version.
Theodore Bagwell is offline