Raised This Month: $ Target: $400
 0% 

How to menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 04-10-2009 , 16:29   Re: How to menu
Reply With Quote #1

ok
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 04-10-2009 , 16:49   Re: How to menu
Reply With Quote #2

here is code
Code:
#include <amxmodx>
new bool:g_1, bool:g_2, bool:g_3, bool:g_4

public plugin_init()
{
    
    register_clcmd( "/menu","Vote")
    
}

public Vote(id)
{
    
    new c = menu_create("a", "menu_handler")
    
    menu_additem(c, "w", "1", 0)
    menu_additem(c, "w", "2", 0)
    menu_additem(c, "w", "3", 0)
    menu_setprop(c, MPROP_EXIT, MEXIT_ALL)
    menu_display(id, c, 0)
}
public menu_handler(id, menu, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    
    new data[6], iName[64]
    new access, callback
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
    
    new key = str_to_num(data)
    
    switch(key)
    {
        case 1:{
            
        }
        case 2:{
            
        }
        case 3:{ 
            
        }
    }
    
    menu_destroy(menu)
    return PLUGIN_HANDLED
}
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-10-2009 , 17:04   Re: How to menu
Reply With Quote #3

Declare global array:
PHP Code:
new g_votecount[4
Replace the switch with:

PHP Code:
g_votecount[key]++ 
Remember to zero all the votes before the voting starts and then you can count and make decisions on the counts in another function.
__________________
fysiks 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 02:18.


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