UWAGA
W związku z upgrade'em Forum Wiaderko do vB 4.x ewentualne błędy i nieprawidłowości proszę zgłaszać w tym temacie
Serwery Counter Strike 1.6 wiaderko.com

HashJama [TP] 193.33.176.148:27015 status serwera HashJama [TP] połącz

HashJama [FFA] 193.33.176.188:27015status serwera HashJama [FFA] połącz

HashJama [DM] 193.33.176.53:27015status serwera HashJama [DM] połącz

HashJama [Aim Hs] 193.33.176.15:27015status serwera HashJama [Aim Hs] połącz

HashJama [Flags] 193.33.176.111:27015status serwera HashJama  [Flags] połącz

HashJama [AWP/HG DM] 193.33.176.50:27015status serwera HashJama [AWP/HG DM] 193.33.176.50:27015 połącz

HashJama [TP #2] 193.33.176.54:27015status serwera HashJama [TP #2] 193.33.176.54:27015 połącz

wiaderko.com [Ventrilo] v1.svoice.pl:6416status serwera wiaderko.com [Ventrilo]

SPONSOR:
pukawka.pl

Wątek: Kolorowy tekst w .ini

Pokaż wyniki od 1 do 3 z 3
  1. #1 Kolorowy tekst w .ini 
    Lamka
    Dołączył
    Feb 2010
    Wiek
    21
    Posty
    20
    Chciałbym się dowiedzieć, jak zrobić kolorowy tekst w plikach /data/lang/plik.ini
    Dokładnie chodzi np o to:

    Kod:
    [pl]
    LANG_NOT_EXISTS = Ten jezyk nie istnieje
    PERSO_LANG = Twoj jezyk
    LANG_MENU = Menu jezykowe
    SERVER_LANG = Jezyk serwera
    SAVE_LANG = Zapisz jezyk
    SET_LANG_SERVER = Jezyk serwera zostal ustawiony na "%s"
    SET_LANG_USER = Twoj jezyk zostal ustawiony na "%s"
    TYPE_LANGMENU = Wpisz 'amx_langmenu' w konsoli aby wyswietlic menu z wyborem jezyka
    LANG_MENU_DISABLED = Menu jezykowe zostalo wylaczone.
    Jest np takie coś. Chciałbym, aby w linijce TYPE_LANGMENU napisz 'amx_langmenu' był zielony, a reszta ma mieć standardowy kolor saya (żółty). Jest w ogóle możliwe? Proszę o pomoc



    Ahaaa, nie wiem, czy potrzebny jest plik .sma, ale jeśli tak to proszę

    Kod php:
    /* AMX Mod X script.
    *   Multilingual System Plugin
    *
    * by the AMX Mod X Development Team
    *
    * This file is part of AMX Mod X.
    *
    *
    *  This program is free software; you can redistribute it and/or modify it
    *  under the terms of the GNU General Public License as published by the
    *  Free Software Foundation; either version 2 of the License, or (at
    *  your option) any later version.
    *
    *  This program is distributed in the hope that it will be useful, but
    *  WITHOUT ANY WARRANTY; without even the implied warranty of
    *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    *  General Public License for more details.
    *
    *  You should have received a copy of the GNU General Public License
    *  along with this program; if not, write to the Free Software Foundation,
    *  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    *
    *  In addition, as a special exception, the author gives permission to
    *  link the code of this program with the Half-Life Game Engine ("HL
    *  Engine") and Modified Game Libraries ("MODs") developed by Valve,
    *  L.L.C ("Valve"). You must obey the GNU General Public License in all
    *  respects for all of the code used other than the HL Engine and MODs
    *  from Valve. If you modify this file, you may extend this exception
    *  to your version of the file, but you are not obligated to do so. If
    *  you do not wish to do so, delete this exception statement from your
    *  version.
    */

    #include <amxmodx>
    #include <amxmisc>
    #include <colorchat>
    #define DISPLAY_MSG        // Comment to disable message on join

    new g_menuLang[33][2]
    new 
    g_serverLang
    new g_langNum
    new g_coloredMenus

    public plugin_init()
    {
        
    register_plugin("Multi-Lingual System"AMXX_VERSION_STR"AMXX Dev Team")
        
    register_dictionary("multilingual.txt")
        
    register_dictionary("common.txt")
        
    register_dictionary("languages.txt")
        
        
    register_cvar("amx_language""en"FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
        
    //Set to zero to disable client effects
        
    register_cvar("amx_client_languages""1")
        
    register_concmd("amx_setlang""cmdLang"ADMIN_CFG"<language>")
        
    register_clcmd("amx_langmenu""cmdLangMenu"ADMIN_ALL)
        
    register_menu("Language Menu"1023"actionMenu")

        new 
    lang[3]
        
        if (
    vaultdata_exists("server_language"))
        {
            
    get_vaultdata("server_language"lang2)
        } else {
            
    copy(lang2"en")
            
    set_vaultdata("server_language"lang)
        }
        
        
    set_cvar_string("amx_language"lang)

        
    g_langNum get_langsnum()
        
    g_serverLang get_lang_id(lang)
        
    g_coloredMenus colored_menus()
    }

    #if defined DISPLAY_MSG
    public client_putinserver(id)
    {
        if (
    get_cvar_num("amx_client_languages") && !is_user_bot(id))
            
    set_task(10.0"dispInfo"id)
    }

    public 
    client_disconnect(id)
    {
        
    remove_task(id)
    }

    public 
    dispInfo(id)
    {
        if (
    get_cvar_num("amx_client_languages"))
            
    client_print(idprint_chat"%L"id"TYPE_LANGMENU")
    }
    #endif

    public cmdLang(idlevelcid)
    {
        if (!
    cmd_access(idlevelcid2))
            return 
    PLUGIN_HANDLED

        
    new arg[3]
        
    read_argv(1arg2)

        if (!
    lang_exists(arg))
        {
            
    console_print(id"[AMXX] %L"id"LANG_NOT_EXISTS")
            return 
    PLUGIN_HANDLED
        
    }

        
    set_vaultdata("server_language"arg)
        
    set_cvar_string("amx_language"arg)
        
    g_serverLang get_lang_id(arg)

        return 
    PLUGIN_HANDLED
    }

    public 
    cmdLangMenu(idlevelcid)
    {
        new 
    buffer[3]

        if (!
    get_cvar_num("amx_client_languages"))
        {
            
    client_print(idprint_console"[AMXX] %L"LANG_SERVER"LANG_MENU_DISABLED")
            return 
    PLUGIN_HANDLED
        
    }

        
    get_user_info(id"lang"buffer2)
        
    g_menuLang[id][0] = get_lang_id(buffer)
        
    g_menuLang[id][1] = g_serverLang

        showMenu
    (id)

        return 
    PLUGIN_HANDLED
    }

    showMenu(id)
    {
        if (!
    get_cvar_num("amx_client_languages"))
            return 
    PLUGIN_HANDLED
        
        
    new menuBody[512], pLang[3]

        
    get_lang(g_menuLang[id][0], pLang)

        new 
    len format(menuBody511, (g_coloredMenus "\y%L\w^n^n" "%L^n^n"), id"LANG_MENU")
        
        
    len += format(menuBody[len], 511-len, (g_coloredMenus "1. %L\R\r%L\w^n" "1. %L %L^n"), id"PERSO_LANG"pLang"LANG_NAME")

        if (
    access(idADMIN_CFG))
        {
            new 
    sLang[3]
            
            
    get_lang(g_menuLang[id][1], sLang)
            
    len += format(menuBody[len], 511-len, (g_coloredMenus "2. %L\R\r%L\w^n^n" "2. %L %L^n^n"), id"SERVER_LANG"sLang"LANG_NAME")
            
    len += format(menuBody[len], 511-len"3. %L"id"SAVE_LANG")
        } else {
            
    len += format(menuBody[len], 511-len"^n2. %L"id"SAVE_LANG")
        }
        
        
    format(menuBody[len], 511-len"^n^n0. %L"id"EXIT")

        
    show_menu(idMENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3menuBody, -1"Language Menu")

        return 
    1
    }

    public 
    actionMenu(idkey)
    {
        if (!
    get_cvar_num("amx_client_languages"))
            return 
    0

        
    new isAdmin access(idADMIN_CFG)

        if (
    key == 0)
        {
            if (
    g_menuLang[id][0] < (g_langNum-1))
                
    g_menuLang[id][0]++
            else
                
    g_menuLang[id][0] = 0
            
            showMenu
    (id)
        }

        if (
    isAdmin && (key == 1))
        {
            if (
    g_menuLang[id][1] < (g_langNum 1))
                
    g_menuLang[id][1]++
            else
                
    g_menuLang[id][1] = 0
            
            showMenu
    (id)
        }

        new 
    pLang[3], pLang_old[3], sLang[3], sLang_old[3], lName[64]
        
        
    get_lang(g_menuLang[id][0], pLang)
        
    get_lang(g_menuLang[id][1], sLang)
        
    get_user_info(id"lang"pLang_old2)
        
    get_lang(g_serverLangsLang_old)

        if (
    isAdmin && (key == 2) && !equali(sLangsLang_old))
        {
            
    set_vaultdata("server_language"sLang)
            
    set_cvar_string("amx_language"sLang)
            
    g_serverLang g_menuLang[id][1]
            
    format(lName63"%L"sLang"LANG_NAME")
            
    client_print(idprint_chat"%L"pLang"SET_LANG_SERVER"lName)
        }

        if (!
    equali(pLangpLang_old) && ((isAdmin && (key == 2)) || (!isAdmin && (key == 1))))
        {
            
    client_cmd(id"setinfo ^"lang^" ^"%s^""pLang)
            
    format(lName63"%L"pLang"LANG_NAME")
            
    client_print(idprint_chat"%L"pLang"SET_LANG_USER"lName)
        }

        return 
    0
    }

    get_lang_id(lang[])
    {
        new 
    tLang[3]
        
        for (new 
    0g_langNumi++)
        {
            
    get_lang(itLang)
            if (
    equali(tLanglang))
                return 
    i
        
    }

        return 
    0

    Napiszę również, że chcę, aby ktoś mi wytłumaczył, jak to zrobić (nie tylko dać mi gotowe). :>>>
     

  2. #2 Odp: Kolorowy tekst w .ini 
    Super Mod Awatar peku33
    Dołączył
    Oct 2008
    Posty
    7,256
    nie znam takiej metody, trzeba to robić z .sma
    PISANIE DO MNIE NA GG Z PROŚBĄ O JAKĄKOLWIEK POMOC NIE JEST MILE WIDZIANE! Numer: 6374959
     

  3. #3 Odp: Kolorowy tekst w .ini 
    Adminus pospolitus
    Dołączył
    Jan 2008
    Wiek
    20
    Posty
    9,226
    Da się, da się.
    Dodaj to na końcu
    stock setColor(string[], len)
    {
    if (contain(string, "!t") != -1 || contain(string, "!g") != -1 || contain(string,"!n") != -1)
    {
    //Some nice shiny colors ^^
    replace_all(string, len, "!t", "^x03");
    replace_all(string, len, "!n", "^x01");
    replace_all(string, len, "!g", "^x04");

    //Work away a stupid bug
    format(string, len, "^x01%s", string);
    }
    }

    stock getString(mode, type, string[], len, one, two = 0)
    {
    //server_print("mode: %d type: %d len: %d one: %d two %d", mode, type, len, one, two);

    //Uses the fact that a string is passed by reference
    if(mode == COND)
    {
    if(type == NORM_AD)
    {
    copy(string, len, normConditions[one][two]);
    } else//if(type = SAY_AD)
    {
    copy(string, len, sayConditions[one][two]);
    }
    } else//if(mode == STORE)
    {
    if(type == NORM_AD)
    {
    copy(string, len, normStore[one]);
    } else//if(type == SAY_AD)
    {
    copy(string, len, sayStore[one][two]);
    }
    }
    }

    stock setString(mode, type, string[], one, two = 0)
    {
    if(mode == COND)
    {
    if(type == NORM_AD)
    {
    copy(normConditions[one][two], 31, string);
    } else//if(type = SAY_AD)
    {
    copy(sayConditions[one][two], 31, string);
    }
    } else//if(mode == STORE)
    {
    if(type == NORM_AD)
    {
    copy(normStore[one], 127, string);
    } else//if(type == SAY_AD)
    {
    copy(sayStore[one][two], 127, string);
    }
    }
    }
    Nie jestem pewien czy to całość. Powinno działać.


    btw
    /data/lang/plik.ini
    ma być
    /data/lang/plik.txt
    Ostatnio edytowane przez naven ; 11-04-2010 o 13:54
    Najlepszy hosting www tutaj
    Konfiguracja amxx, instalacja pluginów, pisanie pluginów AMXX. Więcej info na www.naven.com.pl
    Jebać steama.
     

Podobne wątki

  1. Kolorowy
    By kolorowylos in forum Archwium #Szukam Klanu CS 1.6
    Odpowiedzi: 0
    Ostatni post / autor: 05-01-2011, 20:13
  2. [Steam & Non Steam] Kolorowy tekst [Bind]
    By kumib in forum Problemy z CS 1.6
    Odpowiedzi: 5
    Ostatni post / autor: 05-10-2010, 21:43
  3. [Steam] Problem z głównym menu, kolorowy obraz
    By seniu92 in forum Problemy z CS 1.6
    Odpowiedzi: 2
    Ostatni post / autor: 04-02-2010, 00:29
  4. [Steam & Non Steam] Nie widać cs tylko jakiś kolorowy ekran...
    By kuN` in forum Problemy z CS 1.6
    Odpowiedzi: 4
    Ostatni post / autor: 03-02-2010, 11:32
  5. Kolorowy admin chat
    By bluSkay.aka in forum Szukam pluginu AMX/AMXX
    Odpowiedzi: 2
    Ostatni post / autor: 13-12-2009, 09:01
  6. Kolorowy nick w warcraft III
    By AluCarD in forum Dyskusje, problemy, pomoc odnośnie gier
    Odpowiedzi: 0
    Ostatni post / autor: 05-11-2009, 14:14
  7. Colored Flashbang- kolorowy flash
    By naven in forum Przydatne pluginy AMX i AMXX
    Odpowiedzi: 0
    Ostatni post / autor: 24-10-2009, 21:06
  8. Jak zrobic kolorowy napis wna forum ??
    By KostekPL in forum OffTopic - Counter Strike
    Odpowiedzi: 4
    Ostatni post / autor: 04-05-2009, 18:23
  9. kolorowy nick Admina
    By Marcinhoo in forum Szukam pluginu AMX/AMXX
    Odpowiedzi: 3
    Ostatni post / autor: 02-06-2008, 14:14

Odwiedzający znaleźli tę stronę szukając:

jak zrobic ini

kolorowy tekst cs plugin

Uprawnienia umieszczania postów
  • Nie możesz zakładać nowych tematów
  • Nie możesz pisać wiadomości
  • Nie możesz dodawać załączników
  • Nie możesz edytować swoich postów
  •