Page 1 of 1

Lang spalvos

Posted: 2013 Nov 22 14:45
by acTesT
Sveiki,

kaip padaryti, kad į lang (hpk.txt) parašius pvz.: \y (geltona) rodytu ją chate, turiu išsiėmęs stock'ą iš GunXP modo

client_printcolor

Code: Select all

client_printcolor(id, "%L",  LANG_SERVER, "PING_IMMUNITY_MSG")
Stockas printcolor

Code: Select all

stock client_printcolor(const id, const input[], any:...){    new count = 1, players[32];    static msg[191];    vformat(msg,190,input,3);    replace_all(msg,190,"/g","^4");// green txt    replace_all(msg,190,"/y","^1");// orange txt    replace_all(msg,190,"/ctr","^3");// team txt    replace_all(msg,190,"/w","^0");// team txt    if (id) players[0] = id; else get_players(players,count,"ch");    for (new i = 0; i < count; i++)        if (is_user_connected(players[i]))        {            message_begin(MSG_ONE_UNRELIABLE, SayTxT, _, players[i]);            write_byte(players[i]);            write_string(msg);            message_end();        }}
Žinutė hpk.txt iš lang

Code: Select all

PING_ANNOUNCE_MSG = \y[AMXX] Zaidejai su %d Ping bus ismesti is serverio!

Re: Lang spalvos

Posted: 2013 Nov 22 15:35
by aaarnas
PING_ANNOUNCE_MSG = \g[AMXX] \yZaidejai su %d Ping bus ismesti is serverio!
Ta prasme taip?
Tada:
client_printcolor(id, "%L", id, "PING_IMMUNITY_MSG")

Re: Lang spalvos

Posted: 2013 Nov 22 16:41
by acTesT
aaarnas wrote:PING_ANNOUNCE_MSG = \g[AMXX] \yZaidejai su %d Ping bus ismesti is serverio!
Ta prasme taip?
Tada:
client_printcolor(id, "%L", id, "PING_IMMUNITY_MSG")
Nepadėjo, žaidime vistiek rodo štai taip
Image

Re: Lang spalvos

Posted: 2013 Nov 22 17:13
by aaarnas
Visai pamiršau.
Anas stock multilangual nepalaiko.

Gali iš Zm vip paimti:
msg_saytext = get_user_msgid("SayText")

Code: Select all

stock client_printcolor(id, const message[], any:...){    static buffer[512], argscount    argscount = numargs()        if (!id) {                static players[32], num, player, i, i2        get_players(players, num , "ch")                    for (i = 0; i < num; i++) {                        player = players[i]                        static changed[5], changedcount            changedcount = 0                        for (i2 = 2; i2 < argscount; i2++)            {                if (getarg(i2) == LANG_PLAYER)                {                    setarg(i2, 0, player)                    changed[changedcount] = i2                    changedcount++                }            }                        vformat(buffer, charsmax(buffer), message, 3)                        replace_all(buffer, charsmax(buffer), "/g", "^4")            replace_all(buffer, charsmax(buffer), "/y", "^1")            replace_all(buffer, charsmax(buffer), "/t", "^3")                    message_begin(MSG_ONE_UNRELIABLE, msg_saytext, _, player)            write_byte(player)            write_string(buffer)            message_end()                        for (i2 = 0; i2 < changedcount; i2++)                setarg(changed[i2], 0, LANG_PLAYER)        }    }    else {                vformat(buffer, charsmax(buffer), message, 3)                replace_all(buffer, charsmax(buffer), "/g", "^4")        replace_all(buffer, charsmax(buffer), "/y", "^1")        replace_all(buffer, charsmax(buffer), "/t", "^3")                message_begin(MSG_ONE_UNRELIABLE, msg_saytext, _, id)        write_byte(id)        write_string(buffer)        message_end()    }}

Re: Lang spalvos

Posted: 2013 Nov 22 18:14
by acTesT
aaarnas wrote:Visai pamiršau.
Anas stock multilangual nepalaiko.

Gali iš Zm vip paimti:
msg_saytext = get_user_msgid("SayText")

Code: Select all

stock client_printcolor&#40;id, const message&#91;&#93;, any:...&#41;&#123;    static buffer&#91;512&#93;, argscount    argscount = numargs&#40;&#41;        if &#40;!id&#41; &#123;                static players&#91;32&#93;, num, player, i, i2        get_players&#40;players, num , "ch"&#41;                    for &#40;i = 0; i < num; i++&#41; &#123;                        player = players&#91;i&#93;                        static changed&#91;5&#93;, changedcount            changedcount = 0                        for &#40;i2 = 2; i2 < argscount; i2++&#41;            &#123;                if &#40;getarg&#40;i2&#41; == LANG_PLAYER&#41;                &#123;                    setarg&#40;i2, 0, player&#41;                    changed&#91;changedcount&#93; = i2                    changedcount++                &#125;            &#125;                        vformat&#40;buffer, charsmax&#40;buffer&#41;, message, 3&#41;                        replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/g", "^4"&#41;            replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/y", "^1"&#41;            replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/t", "^3"&#41;                    message_begin&#40;MSG_ONE_UNRELIABLE, msg_saytext, _, player&#41;            write_byte&#40;player&#41;            write_string&#40;buffer&#41;            message_end&#40;&#41;                        for &#40;i2 = 0; i2 < changedcount; i2++&#41;                setarg&#40;changed&#91;i2&#93;, 0, LANG_PLAYER&#41;        &#125;    &#125;    else &#123;                vformat&#40;buffer, charsmax&#40;buffer&#41;, message, 3&#41;                replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/g", "^4"&#41;        replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/y", "^1"&#41;        replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/t", "^3"&#41;                message_begin&#40;MSG_ONE_UNRELIABLE, msg_saytext, _, id&#41;        write_byte&#40;id&#41;        write_string&#40;buffer&#41;        message_end&#40;&#41;    &#125;&#125;
Nepadėjo :(

Code: Select all

/* AMX Mod script* * (c) 2002-2003, DynAstY* This file is provided as is (no warranties).** Players with immunity won't be checked*//** Full Respect to DynAstY for this little plugin.* Only Added Multilanguage support and changed the disconnect handling.* This is a amx port. engine module isn't needed anymore.* Cheers CRAZyBUg* v.1.2.2 - amxx port, multilanguage support, disconnect handling*/&nbsp;#include <amxmodx>&nbsp;new HIGHPING_MAX = 120 // set maximal acceptable pingnew HIGHPING_TIME = 15 &nbsp;// set in seconds frequency of ping checkingnew HIGHPING_TESTS = 3 // minimal number of checks before doing anything&nbsp;new msg_saytext;&nbsp;new iNumTests&#91;33&#93;&nbsp;public plugin_init&#40;&#41; &#123;&nbsp; &nbsp; register_plugin&#40;"High Ping Kicker","1.2.2","DynAstY"&#41;&nbsp; &nbsp; register_dictionary&#40;"hpk.txt"&#41;&nbsp; &nbsp; msg_saytext = get_user_msgid&#40;"SayText"&#41;&nbsp; &nbsp; return PLUGIN_CONTINUE&#125;&nbsp;&nbsp;public client_disconnect&#40;id&#41; &#123;&nbsp; &nbsp; remove_task&#40;id&#41;&nbsp; &nbsp; return PLUGIN_CONTINUE&#125;&nbsp;public client_putinserver&#40;id&#41; &#123;&nbsp; &nbsp; iNumTests&#91;id&#93; = 0&nbsp; &nbsp; if &#40;!is_user_bot&#40;id&#41;&#41; &#123;&nbsp; &nbsp; &nbsp; &nbsp; new param&#91;1&#93;&nbsp; &nbsp; &nbsp; &nbsp; param&#91;0&#93; = id&nbsp; &nbsp; &nbsp; &nbsp; set_task&#40;30.0, "showWarn", id, param, 1&#41;&nbsp; &nbsp; &#125;&nbsp; &nbsp; return PLUGIN_CONTINUE&#125;&nbsp;kickPlayer&#40;id&#41; &#123;&nbsp; &nbsp; new name&#91;32&#93;&nbsp; &nbsp; get_user_name&#40;id, name, 31&#41;&nbsp; &nbsp; new uID = get_user_userid&#40;id&#41;&nbsp; &nbsp; server_cmd&#40;"banid 1 #%d", uID&#41;&nbsp; &nbsp; server_cmd&#40;"kick #%d %L", uID, id, "PING_KICK_PLAYER_MSG"&#41;//&nbsp; client_cmd(id, "echo ^"%L ^"; disconnect", id, "PING_KICK_PLAYER_MSG")&nbsp; &nbsp; client_printcolor&#40;0, "%L", LANG_PLAYER, "PING_KICK_PUBLIC_MSG", name&#41;&nbsp; &nbsp; return PLUGIN_CONTINUE&#125; &nbsp;public checkPing&#40;param&#91;&#93;&#41; &#123;&nbsp; &nbsp; new id = param&#91;0&#93;&nbsp; &nbsp; if &#40; get_user_flags&#40;id&#41; & &#40; ADMIN_RESERVATION | ADMIN_LEVEL_A &#41; &#41; &#123;&nbsp; &nbsp; &nbsp; &nbsp; remove_task&#40;id&#41;&nbsp; &nbsp; &nbsp; &nbsp; client_printcolor&#40;id, "%L", id, "PING_IMMUNITY_MSG"&#41;&nbsp; &nbsp; &nbsp; &nbsp; return PLUGIN_CONTINUE&nbsp; &nbsp; &#125;&nbsp; &nbsp; new p, l&nbsp; &nbsp; get_user_ping&#40;id, p, l&#41;&nbsp; &nbsp; if &#40;p > HIGHPING_MAX&#41;&nbsp; &nbsp; &nbsp; &nbsp; ++iNumTests&#91;id&#93;&nbsp; &nbsp; else&nbsp; &nbsp; &nbsp; &nbsp; if &#40;iNumTests&#91;id&#93; > 0&#41; --iNumTests&#91;id&#93;&nbsp; &nbsp; if &#40;iNumTests&#91;id&#93; > HIGHPING_TESTS&#41;&nbsp; &nbsp; &nbsp; &nbsp; kickPlayer&#40;id&#41;&nbsp; &nbsp; return PLUGIN_CONTINUE&#125;&nbsp;public showWarn&#40;param&#91;&#93;&#41; &#123;&nbsp; &nbsp; client_print&#40;param&#91;0&#93;, print_chat, "%L", param&#91;0&#93;, "PING_ANNOUNCE_MSG", HIGHPING_MAX&#41;&nbsp; &nbsp; set_task&#40;float&#40;HIGHPING_TIME&#41;, "checkPing", param&#91;0&#93;, param, 1, "b"&#41;&nbsp; &nbsp; return PLUGIN_CONTINUE&#125;&nbsp;stock client_printcolor&#40;id, const message&#91;&#93;, any:...&#41;&#123;&nbsp; &nbsp; static buffer&#91;512&#93;, argscount&nbsp; &nbsp; argscount = numargs&#40;&#41;&nbsp; &nbsp;&nbsp; &nbsp; if &#40;!id&#41; &#123;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; static players&#91;32&#93;, num, player, i, i2&nbsp; &nbsp; &nbsp; &nbsp; get_players&#40;players, num , "ch"&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; for &#40;i = 0; i < num; i++&#41; &#123;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player = players&#91;i&#93;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; static changed&#91;5&#93;, changedcount&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changedcount = 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for &#40;i2 = 2; i2 < argscount; i2++&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#123;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if &#40;getarg&#40;i2&#41; == LANG_PLAYER&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#123;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setarg&#40;i2, 0, player&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changed&#91;changedcount&#93; = i2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changedcount++&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#125;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#125;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vformat&#40;buffer, charsmax&#40;buffer&#41;, message, 3&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/g", "^4"&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/y", "^1"&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/t", "^3"&#41;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message_begin&#40;MSG_ONE_UNRELIABLE, msg_saytext, _, player&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write_byte&#40;player&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write_string&#40;buffer&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message_end&#40;&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for &#40;i2 = 0; i2 < changedcount; i2++&#41;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setarg&#40;changed&#91;i2&#93;, 0, LANG_PLAYER&#41;&nbsp; &nbsp; &nbsp; &nbsp; &#125;&nbsp; &nbsp; &#125;&nbsp; &nbsp; else &#123;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; vformat&#40;buffer, charsmax&#40;buffer&#41;, message, 3&#41;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/g", "^4"&#41;&nbsp; &nbsp; &nbsp; &nbsp; replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/y", "^1"&#41;&nbsp; &nbsp; &nbsp; &nbsp; replace_all&#40;buffer, charsmax&#40;buffer&#41;, "/t", "^3"&#41;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; message_begin&#40;MSG_ONE_UNRELIABLE, msg_saytext, _, id&#41;&nbsp; &nbsp; &nbsp; &nbsp; write_byte&#40;id&#41;&nbsp; &nbsp; &nbsp; &nbsp; write_string&#40;buffer&#41;&nbsp; &nbsp; &nbsp; &nbsp; message_end&#40;&#41;&nbsp; &nbsp; &#125;&#125;&nbsp;
-- 2013 Lap 24 13:57 --

Bump!