Thread: Public Pug Mod
View Single Post
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-06-2018 , 23:35   Re: Public Pug Mod
Reply With Quote #2

PHP Code:

public openServers(id)
{
    
id -= TASK_OPENSERVERS
    
    
new szTittle[65]
    
formatex(szTittlecharsmax(szTittle), "\y[ \w%s\d - %L \y ]"g_szMenuPrefixLANG_PLAYER"SERVER_OPENSERVERS_MENU")
    new 
iMenu menu_create(szTittle"ask_handler")
    
    new 
szItem[6]
    
formatex(szItemcharsmax(szItem), "\y%L"LANG_SERVER"SERVER_MENU_OPTION_YES")
    
menu_additem(iMenuszItem)

    
formatex(szItemcharsmax(szItem), "\r%L"LANG_SERVER"SERVER_MENU_OPTION_NO")
    
menu_additem(iMenuszItem// you forget
    
    
menu_display(idiMenu)
}

public 
servers_handler(idiMenuiItem)
{
    if(
iItem == MENU_EXIT)
    {
        
menu_destroy(iMenu)
        return
    }
    
    new 
szServerName[MAX_PLAYERS], szServerIP[MAX_PLAYERS]
    
ArrayGetString(g_arServerNameiItemszServerNamecharsmax(szServerName))
    
ArrayGetArray(g_arServerIPiItemszServerIP)

    
CC_SendMatched(0CC_COLOR_TEAM"%s %L"g_szPrefixLANG_SERVER"SERVER_REDIRECTED"g_dUserData[id][szName], szServerName)
    
client_cmd(id"reconnect;connect %s"szServerIP)
    
client_cmd(id"^"reconnect^";^"connect^" %s"szServerIP// should be this way



Last edited by iceeedr; 04-06-2018 at 23:37.
iceeedr is offline
Send a message via Skype™ to iceeedr