AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Custom Menu Help :S (https://forums.alliedmods.net/showthread.php?t=127714)

mojeda92 05-24-2010 01:31

Custom Menu Help :S
 
I've been trying all day to get a working menu for the Left Fort Dead plugin that will allow players to type in "!build" and a menu comes up with categories "Vehicles, Fences, etc.) but I haven't any clue how to start, I'm new to sourcemod so I need my hand to be held along right now.

I've read: http://forums.alliedmods.net/showthread.php?t=46364

But am not sure where exactly I'm supposed to put the file and if I'm supposed to download something in order for amxmodx to fully work.

Thanks!

Brreaker 05-24-2010 02:54

Re: Custom Menu Help :S
 
This is not sourcemod...For the command use:
PHP Code:

public plugin_init() {
    
register_clcmd("say !build""sayBuild");
}

public 
sayBuild(id) {
    new 
menu menu_create("\rBuilding menu:""menu_handler");
    
menu_additem(menu"\wBuild vehicles""1"0);
    
menu_additem(menu"\wBuild Fences""2"0);
    
menu_additem(menu"\wBuild etc""3"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    return 
PLUGIN_CONTINUE;
}
public 
menu_handler(idmenuitem) {
    if( 
item == MENU_EXIT ) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], Name[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata5Name63callback);
    new 
choice str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            
//Choice 1
        
}
        case 
2:
        {
            
//choice 2
        
}
        case 
3: {
           
//choice 3
        
}
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 


mojeda92 05-24-2010 09:28

Re: Custom Menu Help :S
 
Where would I put this file?

Brreaker 05-24-2010 10:11

Re: Custom Menu Help :S
 
In your plugin...?

mojeda92 05-24-2010 18:45

Re: Custom Menu Help :S
 
2 Attachment(s)
I appended the code you gave me to the bottom of the plugin and tried to run compile.exe but it came up with some errors and I never saw the .smx file in the compiled folder.

Take a look at the attatchment.
I've also uploaded the source of the mod I'm trying to create a menu for. (Left Fort Dead by Boikinov URL

your code starts at line 735 when I have it appended to the end. The source I uploaded here, does not have it added...

NiQu 05-24-2010 19:16

Re: Custom Menu Help :S
 
Go to the sourcemod section, Breaker gave u a code for AMXX not for sourcemod.


All times are GMT -4. The time now is 05:25.

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