Thread: drop hero
View Single Post
landfall
Junior Member
Join Date: Feb 2019
Old 09-09-2020 , 13:27   Re: drop hero
Reply With Quote #2

It is. I have it on my server, you can connect 95.142.47.100:27015 and try it.
I have this code in my superheromodnvault.sma:
PHP Code:
public DropMenu(id)
{
    new 
string[200]
    
    
formatex(string200"%L"id"MENU_DM_TITLE")
    new 
menu menu_create(string"mh_DropMenu");
    
    new 
heroIndex
    
new playerpowercount getPowerCount(id)
    for ( new 
1<= playerpowercount && <= SH_MAXLEVELSx++ )
    {
        
heroIndex gPlayerPowers[id][x]
        
menu_additem(menugSuperHeros[heroIndex][hero])
    }

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_setprop(menuMPROP_NUMBER_COLOR"\w");
    
    
formatex(string128"%L"id"MENU_BACK")
    
menu_setprop(menuMPROP_BACKNAMEstring);
    
formatex(string128"%L"id"MENU_MORE")
    
menu_setprop(menuMPROP_NEXTNAMEstring);
    
formatex(string128"%L"id"MENU_CANCEL")
    
menu_setprop(menuMPROP_EXITNAMEstring);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
}
//----------------------------------------------------------------------------------------------
public mh_DropMenu(idmenux)
{
    if ( !
is_user_connected(id) || is_user_bot(id) ) return PLUGIN_HANDLED;
    
    if (
== MENU_EXIT)
    {
        
menu_cancel(id);
        
MainMenu(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuxaccesscommandsizeof command 1namesizeof name 1callback);

    
1
    
new heroIndex gPlayerPowers[id][x]
    
debugMsg(id1"Dropping Hero: %s"gSuperHeros[heroIndex][hero])
    
clearPower(idx)
    
chatMessage(id_"%L"id"SHMOD_DROP_SUCCESS"gSuperHeros[heroIndex][hero])
    
displayPowers(idtrue)
    if (
getPowerCount(id) > 0)
        
DropMenu(id);
    else
        
MainMenu(id);

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;

landfall is offline