Raised This Month: $51 Target: $400
 12% 

adminchat.sma help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-18-2021 , 09:35   adminchat.sma help
Reply With Quote #1

Hi Everyone!
Can someone
remove
amx_say
amx_chat
amx_psay
From the default
adminchat.sma

PHP Code:
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
//     https://alliedmods.net/amxmodx-license

//
// Admin Chat Plugin
//

#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 
amx_flood_time;
new 
g_AdminChatFlag ADMIN_CHAT;

new 
Float:g_Flooding[MAX_PLAYERS 1] = {0.0, ...}
new 
g_Flood[MAX_PLAYERS 1] = {0, ...}

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_dictionary("antiflood.txt")
    
register_clcmd("say""cmdSayChat"ADMIN_CHAT"@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message"1// forces FlagManager as it is a say command
    
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"FCVAR_PROTECTED);
    }

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

public 
plugin_cfg()
{
    
// check if cvar amx_flood_time exists (created by antiflood plugin)
    
    
amx_flood_time get_cvar_pointer("amx_flood_time");
    
    if( !
amx_flood_time )
    {
        
// else create it
        
amx_flood_time register_cvar("amx_flood_time""0.75");
    }
}

public 
cmdSayChat(idlevel)
{
    if (!
access(idlevel))
    {
        return 
PLUGIN_CONTINUE
    
}
    
    new 
said[6], 0
    read_argv
(1saidcharsmax(said))
    
    while (
said[i] == '@')
    {
        
i++
    }
    
    if (!
|| 3)
    {
        return 
PLUGIN_CONTINUE
    
}
    
    new 
message[192], 0
    read_args
(messagecharsmax(message))
    
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[MAX_NAME_LENGTH], authid[32], userid
    
    get_user_authid
(idauthidcharsmax(authid))
    
get_user_name(idnamecharsmax(name))
    
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 
players[MAX_PLAYERS], plrsnumpl
            get_players
(playersplrsnum"ch")
            for(new 
jj<plrsnumj++)
            {
                
pl players[j]

                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(1saidcharsmax(said))

    if (
said[0] != '@')
        return 
PLUGIN_CONTINUE

    
new Float:maxChat get_pcvar_float(amx_flood_time)
        
    if (
maxChat)
    {
        new 
Float:nexTime get_gametime()
            
        if (
g_Flooding[id] > nexTime)
        {
            if (
g_Flood[id] >= 3)
            {
                
client_print(idprint_notify"** %L **"id"STOP_FLOOD")
                
g_Flooding[id] = nexTime maxChat 3.0
                
return PLUGIN_HANDLED
            
}
            
g_Flood[id]++
        }
        else if (
g_Flood[id])
        {
            
g_Flood[id]--
        }
        
        
g_Flooding[id] = nexTime maxChat
    
}

    new 
message[192], name[MAX_NAME_LENGTH], authid[32], userid
    
new players[MAX_PLAYERS], inumpl
    
    read_args
(messagecharsmax(message))
    
remove_quotes(message)
    
get_user_authid(idauthidcharsmax(authid))
    
get_user_name(idnamecharsmax(name))
    
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])
    
    
get_players(playersinum"ch")
    
    for (new 
bool:is_sender_admin is_user_admin(id) != 00inum; ++i)
    {
        
pl players[i]

        if (
pl == id || get_user_flags(pl) & g_AdminChatFlag)
        {
            
client_print(plprint_chat"(%l) %s :  %s"is_sender_admin "ADMIN" "PLAYER"namemessage[1])
        }
    }

    return 
PLUGIN_HANDLED
}

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

    
new message[192]
    
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
    
    if (!
message[0])
        return 
PLUGIN_HANDLED
    
    
new name[MAX_NAME_LENGTH], players[MAX_PLAYERS], inumauthid[32], useridpl
    
    get_user_authid
(idauthidcharsmax(authid))
    
get_user_name(idnamecharsmax(name))
    
userid get_user_userid(id)
    
get_players(playersinum"ch")
    
    
log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^""nameuseridauthidmessage)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")"nameuseridauthidmessage)
    
    
format(messagecharsmax(message), "(ADMINS) %s :   %s"namemessage)
    
console_print(id"%s"message)
    
    for (new 
0inum; ++i)
    {
        
pl players[i]
        if (
access(plg_AdminChatFlag))
            
client_print(plprint_chat"%s"message)
    }
    
    return 
PLUGIN_HANDLED
}

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

    
new message[192], name[MAX_NAME_LENGTH], authid[32], userid
    
    read_args
(messagecharsmax(message))
    
remove_quotes(message)
    
get_user_authid(idauthidcharsmax(authid))
    
get_user_name(idnamecharsmax(name))
    
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[MAX_NAME_LENGTH]
    
read_argv(1namecharsmax(name))
    new 
priv cmd_target(idname0)

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

    
new message[192], name2[MAX_NAME_LENGTH], authid[32], authid2[32], useriduserid2
    
    get_user_authid
(idauthidcharsmax(authid))
    
get_user_name(idname2charsmax(name2))
    
userid get_user_userid(id)
    
read_args(messagecharsmax(message))
    
    if (
message[0] == '"' && message[length] == '"'// HLSW fix
    
{
        
message[0] = ' '
        
message[length] = ' '
        
length += 2
    
}
    
    
remove_quotes(message[length])
    
get_user_name(privnamecharsmax(name))
    
    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(privauthid2charsmax(authid2))
    
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[MAX_NAME_LENGTH], authid[32], userid 0
    
    read_argv
(0cmdcharsmax(cmd))
    new 
bool:tsay = (tolower(cmd[4]) == 't')
    
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
    
parse(messagecolorcharsmax(color))
    
    new 
found 00
    
new lang[3], langnum get_langsnum()

    for (new 
0MAX_CLR; ++i)
    {
        for (new 
0langnumj++)
        {
            
get_lang(jlang)
            
formatex(color2charsmax(color2), "%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
(idauthidcharsmax(authid))
    
get_user_name(idnamecharsmax(name))
    
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 
players[MAX_PLAYERS], plrsnumpl
            get_players
(playersplrsnum"ch")
            for(new 
ii<plrsnumi++)
            {
                
pl players[i]
                
                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

__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-18-2021 , 13:01   Re: adminchat.sma help
Reply With Quote #2

Simply place a // in front of the respective register_clcmd() or register_concmd() and recompile. For amx_chat, you may need to also add // before get_concmd().
__________________

Last edited by fysiks; 12-18-2021 at 13:11.
fysiks is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-18-2021 , 13:02   Re: adminchat.sma help
Reply With Quote #3

Simply remove the "register_concmd" lines for those commands.

Or simply change their admin access flag to something nobody has. Why would you even want to remove those?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-18-2021 , 13:44   Re: adminchat.sma help
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Simply remove the "register_concmd" lines for those commands.

Or simply change their admin access flag to something nobody has. Why would you even want to remove those?
Cuz i using this
Std Admin Chat
And only amx_say :
amx_chat Tells admin :



And want remove this say & chat from adminchat.sma
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-18-2021 , 14:23   Re: adminchat.sma help
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
Simply place a // in front of the respective register_clcmd() or register_concmd() and recompile. For amx_chat, you may need to also add // before get_concmd().
Got some errors bro
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-18-2021 , 14:24   Re: adminchat.sma help
Reply With Quote #6

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "MAX_PLAYERS" on line 16
Error: Undefined symbol "MAX_PLAYERS" on line 17
Error: Undefined symbol "MAX_NAME_LENGTH" on line 107
Error: Invalid expression, assumed zero on line 107
Error: Undefined symbol "authid" on line 107
Error: Too many error messages on one line on line 107

Compilation aborted.
6 Errors.
Could not locate output file C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\Admin Chats.amx (compile failed).
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-18-2021 , 14:57   Re: adminchat.sma help
Reply With Quote #7

The plugin you posted is for AMX Mod X 1.9.0 so you need to use AMX Mod X 1.9.0 to use it.
__________________
fysiks is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-18-2021 , 15:25   Re: adminchat.sma help
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
The plugin you posted is for AMX Mod X 1.9.0 so you need to use AMX Mod X 1.9.0 to use it.
wtf ?
can u make it for 1.8.2 ?
Just remove
amx_say
amx_chat
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-18-2021 , 17:49   Re: adminchat.sma help
Reply With Quote #9

The version that comes with AMX Mod X 1.8.2 can be found here. Same procedure described above for your request applies.
__________________
fysiks is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-18-2021 , 17:52   Re: adminchat.sma help
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
The version that comes with AMX Mod X 1.8.2 can be found here. Same procedure described above for your request applies.
Ty
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/
SHIFT0 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 06:26.


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