Raised This Month: $ Target: $400
 0% 

multi language colors..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Adomaz1
Senior Member
Join Date: Feb 2014
Old 01-30-2015 , 10:46   multi language colors..
Reply With Quote #1

hello, I searched and foud a lot of results but none of them worked for me.. I want something like this, just colored like here:



I added that client_print_color stuff and replace_all and it doesnt do any effect.. It just shows !gText..
Adomaz1 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-30-2015 , 10:49   Re: multi language colors..
Reply With Quote #2

What method are you using? Also please post the piece of code, that you are trying to change. From what I'm know you need to include Colorchat.inc for !g, !n and !t to work in ML files.

You have already replaced the client_print with client_print_color, so all you need to do is add the snip at top of your plugins.


Code:
#include <chatcolor>


Grab the include file from this link.

https://forums.alliedmods.net/showthread.php?t=94960

Last edited by Spirit_12; 01-30-2015 at 10:54.
Spirit_12 is offline
Adomaz1
Senior Member
Join Date: Feb 2014
Old 01-30-2015 , 11:09   Re: multi language colors..
Reply With Quote #3

I have the include, when I type !g it shows !gText, and it has no effect..

Quote:
#include <amxmodx>
#include <chatcolor>

#define DISPLAY_MSG // Comment to disable message on join
#define HELPAMOUNT 10 // Number of commands per page

public plugin_init()
{
register_plugin("Admin Help", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("adminhelp.txt")
register_concmd("amx_help", "cmdHelp", 0, "<page> [nr of cmds (only for server)] - displays this help")
}

#if defined DISPLAY_MSG
public client_putinserver(id)
{
if (is_user_bot(id))
return

set_task(15.0, "dispInfo", id)
}

public client_disconnect(id)
{
remove_task(id)
}
#endif

public cmdHelp(id, level, cid)
{
new arg1[8], flags = get_user_flags(id)
new start = read_argv(1, arg1, 7) ? str_to_num(arg1) : 1
new lHelpAmount = HELPAMOUNT

// HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
if (flags > 0 && !(flags & ADMIN_USER))
{
flags |= ADMIN_ADMIN;
}

if (id == 0 && read_argc() == 3)
lHelpAmount = read_argv(2, arg1, 7) ? str_to_num(arg1) : HELPAMOUNT

if (--start < 0)
start = 0

new clcmdsnum = get_concmdsnum(flags, id)

if (start >= clcmdsnum)
start = clcmdsnum - 1

console_print(id, "^n----- %L -----", id, "HELP_COMS")

new info[128], cmd[32], eflags
new end = start + lHelpAmount // HELPAMOUNT

if (end > clcmdsnum)
end = clcmdsnum

for (new i = start; i < end; i++)
{
get_concmd(i, cmd, 31, eflags, info, 127, flags, id)
console_print(id, "%3d: %s %s", i + 1, cmd, info)
}

console_print(id, "----- %L -----", id, "HELP_ENTRIES", start + 1, end, clcmdsnum)

if (end < clcmdsnum)
console_print(id, "----- %L -----", id, "HELP_USE_MORE", end + 1)
else
console_print(id, "----- %L -----", id, "HELP_USE_BEGIN")

return PLUGIN_HANDLED
}

#if defined DISPLAY_MSG
public dispInfo(id)
{
client_print_color(id, print_chat, "%L", id, "TYPE_HELP")

new nextmap[32]
get_cvar_string("amx_nextmap", nextmap, 31)

if (get_cvar_float("mp_timelimit"))
{
new timeleft = get_timeleft()

if (timeleft > 0)
{
client_print_color(id, print_chat, "%L", id, "TIME_INFO_1", timeleft / 60, timeleft % 60, nextmap)
} else {
client_print_color(id, print_chat, "%L", id, "TIME_INFO_2", nextmap)

}
}
}
#endif

Last edited by Adomaz1; 01-30-2015 at 11:09.
Adomaz1 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 02-01-2015 , 10:19   Re: multi language colors..
Reply With Quote #4

Where is the language file with edits ?
Spirit_12 is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 02-02-2015 , 02:51   Re: multi language colors..
Reply With Quote #5

Here We Go
what i changed register_ dictionary to register_dictionary_colored and added include <ColorChat>
I have attached colorchat include also
Code:
use this in to change colors !g = green , !t = team color !n = normal
edit adminhelp.txt lang file
U need to compile it locally

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

#define DISPLAY_MSG // Comment to disable message on join
#define HELPAMOUNT 10 // Number of commands per page

public plugin_init()
{
register_plugin("Admin Help"AMXX_VERSION_STR"AMXX Dev Team")
register_dictionary_colored("adminhelp.txt"
register_concmd("amx_help""cmdHelp"0"<page> [nr of cmds (only for server)] - displays this help")
}

#if defined DISPLAY_MSG
public client_putinserver(id)
{
if (
is_user_bot(id))
return

set_task(15.0"dispInfo"id)
}

public 
client_disconnect(id)
{
remove_task(id)
}
#endif

public cmdHelp(idlevelcid)
{
new 
arg1[8], flags get_user_flags(id)
new 
start read_argv(1arg17) ? str_to_num(arg1) : 1
new lHelpAmount HELPAMOUNT

// HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
if (flags && !(flags ADMIN_USER))
{
flags |= ADMIN_ADMIN;
}

if (
id == && read_argc() == 3)
lHelpAmount read_argv(2arg17) ? str_to_num(arg1) : HELPAMOUNT

if (--start 0)
start 0

new clcmdsnum get_concmdsnum(flagsid)

if (
start >= clcmdsnum)
start clcmdsnum 1

console_print
(id"^n----- %L -----"id"HELP_COMS")

new 
info[128], cmd[32], eflags
new end start lHelpAmount // HELPAMOUNT

if (end clcmdsnum)
end clcmdsnum

for (new startendi++)
{
get_concmd(icmd31eflagsinfo127flagsid)
console_print(id"%3d: %s %s"1cmdinfo)
}

console_print(id"----- %L -----"id"HELP_ENTRIES"start 1endclcmdsnum)

if (
end clcmdsnum)
console_print(id"----- %L -----"id"HELP_USE_MORE"end 1)
else
console_print(id"----- %L -----"id"HELP_USE_BEGIN")

return 
PLUGIN_HANDLED
}

#if defined DISPLAY_MSG
public dispInfo(id)
{
client_print_color(idprint_chat"%L"id"TYPE_HELP")

new 
nextmap[32]
get_cvar_string("amx_nextmap"nextmap31)

if (
get_cvar_float("mp_timelimit"))
{
new 
timeleft get_timeleft()

if (
timeleft 0)
{
client_print_color(idprint_chat"%L"id"TIME_INFO_1"timeleft 60timeleft 60nextmap)
} else {
client_print_color(idprint_chat"%L"id"TIME_INFO_2"nextmap)

}
}
}
#endif 
Attached Files
File Type: sma Get Plugin or Get Source (adminhelp.sma - 559 views - 2.2 KB)
File Type: inc colorchat.inc (4.9 KB, 157 views)

Last edited by tousif; 02-02-2015 at 02:52.
tousif is offline
Reply



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 21:31.


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