AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need Help (https://forums.alliedmods.net/showthread.php?t=134383)

totalcsscripting 08-04-2010 02:53

Need Help
 
PHP Code:

displayTelMenu(idpos)

    if (
pos 0)
        return

    
get_players(g_menuPlayers[id], g_menuPlayersNum[id])

    new 
menuBody[512]
    new 
0
    
new i
    
new name[32]
    new 
start pos 6
    
new bool:blockMenu = (is_user_alive(id) && g_menuOption[id] < 1) ? true false

    
if (start >= g_menuPlayersNum[id])
        
start pos g_menuPosition[id] = 0

    
new len format(menuBody511g_coloredMenus "\y%L\R%d/%d^n\w^n" "%L %d/%d^n^n"id"TELE_MENU"pos 1, (g_menuPlayersNum[id] / + ((g_menuPlayersNum[id] % 6) ? 0)))
    new 
end start 6
    
new keys MENU_KEY_0|MENU_KEY_8

    
if (end g_menuPlayersNum[id])
        
end g_menuPlayersNum[id]

    for (new 
startend; ++a)
    {
        
g_menuPlayers[id][a]
        
get_user_name(iname31)

        if (
blockMenu || !is_user_alive(i) || (id != && get_user_flags(i) & ADMIN_IMMUNITY))
        {
            ++
b
        
            
if (g_coloredMenus)
                
len += format(menuBody[len], 511-len"\d%d. %s^n\w"bname)
            else
                
len += format(menuBody[len], 511-len"#. %s^n"name)
        } else {
            
keys |= (1<<b)
            
            if (
is_user_admin(i))
                
len += format(menuBody[len], 511-leng_coloredMenus "%d. %s \r*^n\w" "%d. %s *^n", ++bname)
            else
                
len += format(menuBody[len], 511-len"%d. %s^n", ++bname)
        }
    }

    if (
g_menuOption[id] > 0)    // 1
    
{
        
keys |= MENU_KEY_7
        len 
+= format(menuBody[len], 511-len"^n7. To location: %d %d %d^n"g_menuOrgin[id][0], g_menuOrgin[id][1], g_menuOrgin[id][2])
    }
    else if (
g_menuOption[id])    // -1
    
{
        if (
g_coloredMenus)
            
len += format(menuBody[len], 511-len"^n\d7. %L^n\w"id"CUR_LOC")
        else
            
len += format(menuBody[len], 511-len"^n#. %L^n"id"CUR_LOC")
    } else {                    
// 0
        
keys |= MENU_KEY_7
        len 
+= format(menuBody[len], 511-len"^n7. %L^n"id"CUR_LOC")
    }

    
len += format(menuBody[len], 511-len"8. %L^n"id"SAVE_LOC")

    if (
end != g_menuPlayersNum[id])
    {
        
format(menuBody[len], 511-len"^n9. %L...^n0. %L"id"MORE"idpos "BACK" "EXIT")
        
keys |= MENU_KEY_9
    
}
    else
        
format(menuBody[len], 511-len"^n0. %L"idpos "BACK" "EXIT")

    
show_menu(idkeysmenuBody, -1"Teleport Menu")


This is a part of teleport plugin. I'm tying to mix this plugin with mines.

It works perfectly but i dont' want to use a diccionari so y convert
SAVE_LOC
CUR_LOC
TELE_MENU

into variables but still shows ML_NOTFOUND

Hel Please

Arkshine 08-04-2010 04:37

Re: Need Help
 
If you want to remove ML( I would like to know why ? ) , remove %L, remove id, remove the identifier ( "CUR_LOC" etc. ) and remove register_dictionary().

totalcsscripting 08-04-2010 11:39

Re: Need Help
 
y want the message to still appear, but i don't want to depend of a doccionary. I want to have all compiled in one plugin.

Instead of "CUR_LOC" y create a variable

new CUR_LOC[]="mi text"

but it doesn't work



thanks

Arkshine 08-04-2010 12:46

Re: Need Help
 
Why you don't want to depend of this file ? For your information, your plugin will compile without problem using ML system without any requirement. Also it helps you to modify easily a text without compiling again. Really, I don't understand what you are doing, such waste of time.

totalcsscripting 08-04-2010 17:59

Re: Need Help
 
Because the only things i have in the diccionary are those 3 variables. And i found useless to have a txt file for only 3 texts.

Please, help me with this

totalcsscripting 08-05-2010 18:11

Re: Need Help
 
Quote:

Originally Posted by Arkshine (Post 1261539)
Why you don't want to depend of this file ? For your information, your plugin will compile without problem using ML system without any requirement. Also it helps you to modify easily a text without compiling again. Really, I don't understand what you are doing, such waste of time.

Please answer me

fysiks 08-05-2010 18:15

Re: Need Help
 
Quote:

Originally Posted by totalcsscripting (Post 1261804)
Because the only things i have in the diccionary are those 3 variables. And i found useless to have a txt file for only 3 texts.

Please, help me with this

When you use it correctly for multilingual then there will be 3 x (the number of languages). So, if you have 10 languages in there then you actually have 30 "texts" as you call them.

totalcsscripting 08-05-2010 18:20

Re: Need Help
 
Quote:

Originally Posted by fysiks (Post 1262654)
When you use it correctly for multilingual then there will be 3 x (the number of languages). So, if you have 10 languages in there then you actually have 30 "texts" as you call them.

I only wanted it in one language. Only to use 3 variables!

fysiks 08-05-2010 18:25

Re: Need Help
 
Quote:

Originally Posted by Arkshine (Post 1261270)
If you want to remove ML( I would like to know why ? ) , remove %L, remove id, remove the identifier ( "CUR_LOC" etc. ) and remove register_dictionary().

Do as Arkshine said and then add in the %s's as usual with your variables.

new const CUR_LOC[]="mi text"

totalcsscripting 08-05-2010 19:00

Re: Need Help
 
Quote:

Originally Posted by fysiks (Post 1262674)
Do as Arkshine said and then add in the %s's as usual with your variables.

new const CUR_LOC[]="mi text"

I still don't unerstand.

For example i have that variable

new const CUR_LOC[]="mi text"

and then this
PHP Code:

len += format(menuBody[len], 511-len"^n\d7. %L^n\w"id"CUR_LOC"

What i have to do!


All times are GMT -4. The time now is 00:14.

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