Raised This Month: $ Target: $400
 0% 

Can not see the menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Varchar'
Member
Join Date: Jun 2010
Old 08-27-2013 , 23:16   Can not see the menu
Reply With Quote #1

Hi, I was looking for a redirection plugin simplest servers, found one but when typing / servers do not see the menu, not that mistake could have, if I could help

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

#define PLUGIN  "Redirect Plugin (Lite Version)"
#define AUTHOR  "Alucard"
#define VERSION "0.0.1"

#define MAX_SERVERS 5

new fileName[192];

new 
g_Servers[MAX_SERVERS][256];

new 
g_Total;

public 
plugin_cfg()
{
    
get_configsdir(fileName191);
    
add(fileName191"/servers");
    
    if(!
dir_exists(fileName) )
        
mkdir(fileName);
    
    
add(fileName191"/servers_menu.ini");
    
    if(!
file_exists(fileName) )
        
fclose(fopen(fileName"wt") );
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say /servers""HookCmdServers");
    
    if(!
LoadServers() )
        
pause("a");
}

public 
HookCmdServers(id)
{
    new 
menu menu_create("\rServers Menu""HandlerMenuServers");
    
    new 
szItem[128], szName[64], szSlots[2], szTarget[2];
    
    new 
iTarget;
    for(new 
0g_Totali++)
    {
        
iTarget++;
        
num_to_str(iTargetszTarget1);
        
        
parse(g_Servers[i], ""0szName63szSlots1);
        
formatex(szItem127"%s [%s]"szNameszSlots);
        
menu_additem(menuszItemszTarget);
    }
    
    return 
PLUGIN_HANDLED;
}

public 
HandlerMenuServers(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[48], Accesscallback;
    
menu_item_getinfo(menuitemAccessdata5iName63callback);
    
    new 
szIP[64];
    
parse(g_Servers[item-1], szIP63);
    
    
client_cmd(id"connect %s"szIP);
    
    new 
szName[32];
    
get_user_name(idszName31);
    
    
client_print(0print_chat"%s fue redireccionado al server %s"szNameszIP);
    
    return 
PLUGIN_HANDLED;
}

LoadServers()
{
    new 
szLine[256];
    new 
iLineiLen;
    
    while(
read_file(fileNameiLine++, szLine255iLen) )
    {
        
copy(g_Servers[g_Total], 255szLine);
        
        
g_Total++;
        
        if(
g_Total == MAX_SERVERS) break;
    }
    
    if(!
g_Total) return 0;
    
    return 
1;

__________________
[IMG]http://img31.**************/img31/1363/varchar.png[/IMG]



Varchar' is offline
Send a message via MSN to Varchar'
 


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 19:08.


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