Raised This Month: $ Target: $400
 0% 

[REQ]amx_chat,amx_psay colored


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Clowb
Junior Member
Join Date: Feb 2014
Old 12-05-2014 , 10:52   [REQ]amx_chat,amx_psay colored
Reply With Quote #1

Hi i was looking for a plugin to put some color to the adminchat.amxx. amx_psay amx_chat all that kind of chat that are = to the normal chat

I used the Search Function but i found nothing

Thanks for you help

Last edited by The Clowb; 12-05-2014 at 10:53.
The Clowb is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 12-05-2014 , 15:36   Re: [REQ]amx_chat,amx_psay colored
Reply With Quote #2

Quote:
Originally Posted by The Clowb View Post
I used the Search Function but i found nothing
then try using it corectly .
__________________
ANTICHRISTUS is offline
The Clowb
Junior Member
Join Date: Feb 2014
Old 12-06-2014 , 16:06   Re: [REQ]amx_chat,amx_psay colored
Reply With Quote #3

As i said. I used the search function....

This is the code of the adminchat.amxx
Is a deafult plugin.

It has the command amx_chat(say_team @)
amx_psay
and amx_say
I just need to put some colors

PHP Code:
/* AMX Mod X
*   Admin Chat Plugin
*
* by the AMX Mod X Development Team
*  originally developed by OLO
*
* 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>

new g_msgChannel

#define MAX_CLR 10

new g_Colors[MAX_CLR][] = {"COL_WHITE""COL_RED""COL_GREEN""COL_BLUE""COL_YELLOW""COL_MAGENTA""COL_CYAN""COL_ORANGE""COL_OCEAN""COL_MAROON"}
new 
g_Values[MAX_CLR][] = {{255255255}, {25500}, {02550}, {00255}, {2552550}, {2550255}, {0255255}, {227968}, {4589116}, {1034438}}
new 
Float:g_Pos[4][] = {{0.00.0}, {0.050.55}, {-1.00.2}, {-1.00.7}}

new 
amx_show_activity;
new 
g_AdminChatFlag ADMIN_CHAT;

public 
plugin_init()
{
    new 
admin_chat_id

    register_plugin
("Admin Chat"AMXX_VERSION_STR"AMXX Dev Team")
    
register_dictionary("adminchat.txt")
    
register_dictionary("common.txt")
    
register_clcmd("say""cmdSayChat"ADMIN_CHAT"@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
    
register_clcmd("say_team""cmdSayAdmin"0"@<text> - displays message to admins")
    
register_concmd("amx_say""cmdSay"ADMIN_CHAT"<message> - sends message to all players")
    
admin_chat_id register_concmd("amx_chat""cmdChat"ADMIN_CHAT"<message> - sends message to admins")
    
register_concmd("amx_psay""cmdPsay"ADMIN_CHAT"<name or #userid> <message> - sends private message")
    
register_concmd("amx_tsay""cmdTsay"ADMIN_CHAT"<color> <message> - sends left side hud message to all players")
    
register_concmd("amx_csay""cmdTsay"ADMIN_CHAT"<color> <message> - sends center hud message to all players")
    
    
amx_show_activity get_cvar_pointer("amx_show_activity");
    
    if (
amx_show_activity == 0)
    {
        
amx_show_activity register_cvar("amx_show_activity""2");
    }

    new 
str[1]
    
get_concmd(admin_chat_idstr0g_AdminChatFlagstr0, -1)
}

public 
cmdSayChat(id)
{
    if (!
access(idg_AdminChatFlag))
    {
        return 
PLUGIN_CONTINUE
    
}
    
    new 
said[6], 0
    read_argv
(1said5)
    
    while (
said[i] == '@')
    {
        
i++
    }
    
    if (!
|| 3)
    {
        return 
PLUGIN_CONTINUE
    
}
    
    new 
message[192], 0
    read_args
(message191)
    
remove_quotes(message)
    
    switch (
said[i])
    {
        case 
'r'1
        
case 'g'2
        
case 'b'3
        
case 'y'4
        
case 'm'5
        
case 'c'6
        
case 'o'7
    
}
    
    new 
ni
    
if (a)
    {
        
n++
        
s++
    }
    while (
said[s] && isspace(said[s]))
    {
        
n++
        
s++
    }
    

    new 
name[32], authid[32], userid
    
    get_user_authid
(idauthid31)
    
get_user_name(idname31)
    
userid get_user_userid(id)
    
    
log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^""nameuseridauthidmessage[n])
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")"nameuseridauthidmessage[n], "en"g_Colors[a])
    
    if (++
g_msgChannel || g_msgChannel 3)
    {
        
g_msgChannel 3
    
}
    
    new 
Float:verpos g_Pos[i][1] + float(g_msgChannel) / 35.0
    
    set_hudmessage
(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos06.06.00.50.15, -1)

    switch ( 
get_pcvar_num(amx_show_activity) )
    {
        case 
34:
        {
            new 
maxpl get_maxplayers();
            for (new 
pl 1pl <= maxplpl++)
            {
                if (
is_user_connected(pl) && !is_user_bot(pl))
                {
                    if (
is_user_admin(pl))
                    {
                        
show_hudmessage(pl"%s :   %s"namemessage[n])
                        
client_print(plprint_notify"%s :   %s"namemessage[n])
                    }
                    else
                    {
                        
show_hudmessage(pl"%s"message[n])
                        
client_print(plprint_notify"%s"message[n])
                    }
                }
            }
        }
        case 
2:
        {
            
show_hudmessage(0"%s :   %s"namemessage[n])
            
client_print(0print_notify"%s :   %s"namemessage[n])
        }
        default:
        {
            
show_hudmessage(0"%s"message[n])
            
client_print(0print_notify"%s"message[n])
        }
    }

    return 
PLUGIN_HANDLED
}

public 
cmdSayAdmin(id)
{
    new 
said[2]
    
read_argv(1said1)
    
    if (
said[0] != '@')
        return 
PLUGIN_CONTINUE
    
    
new message[192], name[32], authid[32], userid
    
new players[32], inum
    
    read_args
(message191)
    
remove_quotes(message)
    
get_user_authid(idauthid31)
    
get_user_name(idname31)
    
userid get_user_userid(id)
    
    
log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^""nameuseridauthidmessage[1])
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")"nameuseridauthidmessage[1])
    
    if (
is_user_admin(id))
        
format(message191"(%L) %s :  %s"id"ADMIN"namemessage[1])
    else
        
format(message191"(%L) %s :  %s"id"PLAYER"namemessage[1])

    
get_players(playersinum)
    
    for (new 
0inum; ++i)
    {
        
// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
        
if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
            
client_print(players[i], print_chat"%s"message)
    }
    
    
client_print(idprint_chat"%s"message)
    
    return 
PLUGIN_HANDLED
}

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

    
new message[192], name[32], players[32], inumauthid[32], userid
    
    read_args
(message191)
    
remove_quotes(message)
    
get_user_authid(idauthid31)
    
get_user_name(idname31)
    
userid get_user_userid(id)
    
get_players(playersinum)
    
    
log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^""nameuseridauthidmessage)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")"nameuseridauthidmessage)
    
    
format(message191"(ADMINS) %s :   %s"namemessage)
    
console_print(id"%s"message)
    
    for (new 
0inum; ++i)
    {
        if (
access(players[i], g_AdminChatFlag))
            
client_print(players[i], print_chat"%s"message)
    }
    
    return 
PLUGIN_HANDLED
}

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

    
new message[192], name[32], authid[32], userid
    
    read_args
(message191)
    
remove_quotes(message)
    
get_user_authid(idauthid31)
    
get_user_name(idname31)
    
userid get_user_userid(id)
    
client_print(0print_chat"%L"LANG_PLAYER"PRINT_ALL"namemessage)
    
console_print(id"%L"LANG_PLAYER"PRINT_ALL"namemessage)
    
    
log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^""nameuseridauthidmessage)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")"nameuseridauthidmessage)
    
    return 
PLUGIN_HANDLED
}

public 
cmdPsay(idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED
    
    
new name[32]
    
read_argv(1name31)
    new 
priv cmd_target(idname0)

    if (!
priv)
        return 
PLUGIN_HANDLED
    
    
new length strlen(name) + 1

    get_user_name
(privname31); 
    
    new 
message[192], name2[32], authid[32], authid2[32], useriduserid2
    
    get_user_authid
(idauthid31)
    
get_user_name(idname231)
    
userid get_user_userid(id)
    
read_args(message191)
    
    if (
message[0] == '"' && message[length] == '"'// HLSW fix
    
{
        
message[0] = ' '
        
message[length] = ' '
        
length += 2
    
}
    
    
remove_quotes(message[length])
    
get_user_name(privname31)
    
    if (
id && id != priv)
        
client_print(idprint_chat"(%s) %s :   %s"namename2message[length])
    
    
client_print(privprint_chat"(%s) %s :   %s"namename2message[length])
    
console_print(id"(%s) %s :   %s"namename2message[length])
    
get_user_authid(privauthid231)
    
userid2 get_user_userid(priv)
    
    
log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^""name2useridauthidnameuserid2authid2message[length])
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")"name2useridauthidnameuserid2authid2message[length])
    
    return 
PLUGIN_HANDLED
}

public 
cmdTsay(idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED
    
    
new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid 0
    
    read_argv
(0cmd15)
    new 
bool:tsay = (tolower(cmd[4]) == 't')
    
    
read_args(message191)
    
remove_quotes(message)
    
parse(messagecolor15)
    
    new 
found 00
    
new lang[3], langnum get_langsnum()

    for (new 
0MAX_CLR; ++i)
    {
        for (new 
0langnumj++)
        {
            
get_lang(jlang)
            
format(color215"%L"langg_Colors[i])
            
            if (
equali(colorcolor2))
            {
                
i
                found 
1
                
break
            }
        }
        if (
found == 1)
            break
    }
    
    new 
length found ? (strlen(color) + 1) : 0
    
    
if (++g_msgChannel || g_msgChannel 3)
        
g_msgChannel 3

    
new Float:verpos = (tsay 0.55 0.1) + float(g_msgChannel) / 35.0
    
    get_user_authid
(idauthid31)
    
get_user_name(idname31)
    
userid get_user_userid(id)
    
set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay 0.05 : -1.0verpos06.06.00.50.15, -1)

    switch ( 
get_pcvar_num(amx_show_activity) )
    {
        case 
34:
        {
            new 
maxpl get_maxplayers();
            for (new 
pl 1pl <= maxplpl++)
            {
                if (
is_user_connected(pl) && !is_user_bot(pl))
                {
                    if (
is_user_admin(pl))
                    {
                        
show_hudmessage(pl"%s :   %s"namemessage[length])
                        
client_print(plprint_notify"%s :   %s"namemessage[length])
                    }
                    else
                    {
                        
show_hudmessage(pl"%s"message[length])
                        
client_print(plprint_notify"%s"message[length])
                    }
                }
            }
            
console_print(id"%s :  %s"namemessage[length])
        }
        case 
2:
        {
            
show_hudmessage(0"%s :   %s"namemessage[length])
            
client_print(0print_notify"%s :   %s"namemessage[length])
            
console_print(id"%s :  %s"namemessage[length])
        }
        default:
        {
            
show_hudmessage(0"%s"message[length])
            
client_print(0print_notify"%s"message[length])
            
console_print(id"%s"message[length])
        }
    }

    
log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^""nameuseridauthidcmd[4], message[length])
    
log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")"nameuseridauthidcmdmessage[length], color2)

    return 
PLUGIN_HANDLED

The Clowb 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 22:45.


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