Raised This Month: $ Target: $400
 0% 

HELP Best way to do


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Toallin
Junior Member
Join Date: Jun 2014
Old 06-24-2014 , 15:48   HELP Best way to do
Reply With Quote #1

Good for all.
What happens is I search the best way to do this code
not what you think if you could improve or if they stay well.

PHP Code:
#include <amxmodx>
#include <amxmisc>

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

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /lr""ShowMenuLR")
}

public 
ShowMenuLR(id)
{
    new 
menu menu_create("last request""CmdMenuLR")
    
    
menu_additem(menu"Duel Knife""1")
    
menu_additem(menu"Duel Scouts""2")
    
    
menu_display(idmenu)
}

public 
CmdMenuLR(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item)
    {
        case 
0ShowListCT(id)
        case 
1ShowListCT(id)
    }
    return 
PLUGIN_HANDLED;
}

public 
ShowListCT(id)
{
    new 
menu menu_create("go to fight""CmdListCT")
    
    new 
iPlayers[32], pnumtempid
    
new iName[32], szTempid[10]
    
    
get_players(iPlayerspnum"aeh""CT")
    
    for(new 
0pnumi++)
    {
        
tempid iPlayers[i]
        
        
get_user_name(tempidiNamecharsmax(iName))
        
num_to_str(tempidszTempidcharsmax(szTempid))
        
menu_additem(menuiNameszTempid)
    }
    
    
menu_display(idmenu)
    return 
PLUGIN_HANDLED;
}

public 
CmdListCT(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64]; 
    new 
accesscallback
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), iNamecharsmax(iName), callback)
    
    
// bla bla

The plugin is a menu of modes all have a list of players to fight with each mode is different but not if they could do any better Thank you.

Last edited by Toallin; 06-24-2014 at 15:49.
Toallin is offline
 


Thread Tools
Display Modes

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 21:07.


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