Raised This Month: $ Target: $400
 0% 

New AMXX Menu System


Post New Thread Reply   
 
Thread Tools Display Modes
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 04-05-2009 , 18:20   Re: New AMXX Menu System
Reply With Quote #81

Quote:
Originally Posted by fysiks View Post
I tried to pass a long string (long -> >6 charaters) and it didn't work. It seems I'm limited to data[6] . Is this correct?

I was trying to avoid using newplayername[33][32] to pass the new name through to the handler.
Show your code. you can pass more big information.

Example
PHP Code:
menu_additem(mymenu"LALIN""HEREALLMYDATA")

[...]

static 
Data[64]
menu_item_getinfo(menuitem_Data63)

server_print(Data)  --> HEREALLMYDATA 
__________________

Last edited by AntiBots; 04-05-2009 at 18:23.
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-05-2009 , 18:25   Re: New AMXX Menu System
Reply With Quote #82

Oops, I changed the dim on data but forgot to change "len" in menu_item_getinfo my bad.
__________________
fysiks is offline
faiLL
New Member
Join Date: Apr 2009
Location: Lithuania, Utena
Old 04-06-2009 , 09:36   Re: New AMXX Menu System
Reply With Quote #83

Very big THANKS to Emp` good job ;)
faiLL is offline
Send a message via MSN to faiLL Send a message via Skype™ to faiLL
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-11-2009 , 05:11   Re: New AMXX Menu System
Reply With Quote #84

Added vote menu example, sub-menu example, and end notes to the main post.

edit: Added advance vote menu example.

Last edited by Emp`; 04-11-2009 at 06:06.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-11-2009 , 07:57   Re: New AMXX Menu System
Reply With Quote #85

So, you say to store as a global if it's a unchanging menu. Do I create the menu in plugin_init? Also, should I ever call menu_destroy() within the plugin? I read that there was "memory leaking" when you don't destroy a menu.
__________________
fysiks is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-11-2009 , 08:30   Re: New AMXX Menu System
Reply With Quote #86

This can be a example of a menu
PHP Code:
#include <amxmodx>  
#include <fun>  
#include <fakemeta>  
#include <cstrike> 

public plugin_init() {  
    
register_plugin(PLUGINVERSIONAUTHOR)  
    
register_clcmd("say /Scoutmenu","cmdScoutKnifeZMenu") , 
    
register_clcmd("say_team /Scoutmenu","cmdScoutKnifeZMenu")  
     


public 
cmdScoutKnifeZMenuid ) { 
        return; 
     
    new 
menu menu_create ("\rMenu for ScoutKnifeZ_Manager!:""handleScoutKnifeZMenu")  
    
menu_additem(menu"\wGravity800""1"0)  
    
menu_additem(menu"\wGravity600""2"0)  
    
menu_additem(menu"\wGravity400""3"0)  
    
menu_additem(menu"\wGravity200""4"0)  
    
menu_additem(menu"\wGravity100""5"0)  
    
menu_additem(menu"\wGiveSg550""6"0)  
    
menu_additem(menu"\wGiveAWP""7"0)  
    
menu_additem(menu"\wGiveG3sg1""8"0)  
    
menu_display(idmenu0)  
}  

public 
handleScoutKnifeZMenu(idmenuitem)  { 
    if (
item == MENU_EXIT)  
    {  
        
menu_destroy(menu)  
        return 
PLUGIN_HANDLED  
    
}  
    new 
data[6], iName[64]  
    new 
accesscallback  
     
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)  
    new 
key str_to_num(data)  
     
    switch( 
key
    { 
        case 
1:  
        {  
                
set_user_gravity(id1.0)  
                
client_print(idprint_chat"You have 800 gravity isnt that normal?"
            } 
        }  
        case 
2:  
        { 
                
set_user_gravity(id0.75)  
                
client_print(idprint_chat"600 gravity, a bit less than 800, nothing less?")  
            } 
        }  
        case 
3:  
        {  
                
set_user_gravity(id0.5)  
                
client_print(idprint_chat"400, the half of normal!")  
            } 
        }  
        case 
4:  
        {  
                
set_user_gravity(id0.25)  
                
client_print(idprint_chat"200, the half of 400, you jump high now"
            } 
        }  
        case 
5:  
        {  
                
set_user_gravity(id0.125)  
                
client_print(idprint_chat"100, the less in the whole server!")  
            } 
        }  
        case 
6:  
        {  
                
client_cmd(id"slot1; drop")  
                
give_itemid"weapon_sg550" 
                
give_itemid"ammo_556nato")  
                
give_itemid"ammo_556nato")  
                
give_itemid"ammo_556nato")  
                
give_itemid"ammo_556nato")  
                
give_itemid"ammo_556nato")  
                
client_print(idprint_chat"Didnt i deleted SG550?!")  
            } 
        }  
        case 
7:  
        {  
                
client_cmd(id"slot1; drop")  
                
give_itemid"weapon_awp" )  
                
give_itemid"ammo_338magnum" )  
                
give_itemid"ammo_338magnum" )  
                
give_itemid"ammo_338magnum" )  
                
give_itemid"ammo_338magnum" )  
                
give_itemid"ammo_338magnum" )  
                
client_print(idprint_chat"Isnt a AWP forbidden?!")  
            } 
        }  
        case 
8:  
        {  
                
client_cmd(id"slot1; drop")  
                
give_item(id"weapon_g3sg1" )  
                
give_item(id"ammo_762nato")  
                
give_item(id"ammo_762nato")  
                
give_item(id"ammo_762nato")  
                
give_item(id"ammo_762nato")  
                
give_item(id"ammo_762nato")  
                
give_item(id"ammo_762nato")  
                
client_print(idprint_chat"Did you really buy a G3SG1?!")  
            } 
        }  
    }  
     
    
menu_destroy(menu)  
    return 
PLUGIN_HANDLED  

I think i have to many #includes , but this is a menu
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
chungkiman
Junior Member
Join Date: Feb 2009
Location: Hong Kong
Old 04-23-2009 , 21:01   Re: New AMXX Menu System
Reply With Quote #87

i wanna to ask, how to make a menu like this



in which you can on\off the menu option

關 = off the function

thank you

Last edited by chungkiman; 04-23-2009 at 22:56.
chungkiman is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-23-2009 , 22:58   Re: New AMXX Menu System
Reply With Quote #88

Depends on what the menu option does. (Most of use can't read that btw).
__________________
fysiks is offline
chungkiman
Junior Member
Join Date: Feb 2009
Location: Hong Kong
Old 04-24-2009 , 02:18   Re: New AMXX Menu System
Reply With Quote #89

for example, if i want to adjust the volume of the mic
in the menu, there is a option like that

Volume of Mic 100\50\10\0

you can choose the volume by the way you want.

how to do it - -?
chungkiman is offline
hnorgist
Junior Member
Join Date: Feb 2009
Location: Russia, Vladivostok
Old 04-25-2009 , 19:16   Re: New AMXX Menu System
Reply With Quote #90

Can't understand if it is possible to destroy menu hud by plugin. When vote stops by timer (some player didn't vote and still have menu on screen), killing the menu doesn't clean player's hud.. Is it really impossible to do?.. description says so:
Code:
/**
 * Destroys a menu.  Player menus will be cancelled (although may still linger on the HUD), and future attempts to access the menu resource will result in an error.
...
 */
native menu_destroy(menu);
__________________
[rus] Дальневосточные кстрайкеры настолько суровы, что рождаются вместе с девайсами и минусуют во время перезарядки
hnorgist is offline
Reply



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 12:12.


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