Raised This Month: $32 Target: $400
 8% 

Solved How to remove amx_tsay for ALL


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lantimilan
Senior Member
Join Date: May 2016
Old 04-21-2020 , 14:44   How to remove amx_tsay for ALL
Reply With Quote #1

Hello one my friend have problem with tsay he dont like tsay he want to remove totally adminat cant use amx_tsay or y@ to write with tsay
PHP Code:
/***********************************************************************
 * amx_ejl_adminchat.sma     version 1.7      January 30/2002
 *  By:  Eric Lidman    Alias: Ludwig van      [email protected]
 *  Upgrade: http://lidmanmusic.com/cs/plugins.html
 *
 *  This is a replacement for the default aadminchat plugin. All credit
 *   for orginal coding goes to OLO below. I simply added a few features
 *   to make this "Deluxe Admin Chat".
 *
 * Commands:
 *
 *   amx_say <message>
 *   amx_chat <message>
 *   amx_psay <player> <message>
 *   amx_tsay <optional color> message
 *   amx_csay <optional color> message
 *   amx_fsay <x postion> <y postion> <optional color> message
 *   amx_scrollsay <optional color> message
 *   amx_myhudcolor
 *
 *   Also supports clanmod method of issuing these types of hudmessages
 *   from the chat:
 *
 *   say @@@ <optional color> <message>   is amx_scrollsay from chat
 *   say @@ <optional color> <message>     is amx_csay from chat
 *   say @ <optional color> <message>     is amx_tsay from chat
 *   say ## <message>                     is amx_chat from chat
 *   say # <player> <message>             is amx_psay from chat
 *
 *  Some of those feaures include new commands like fsay and scrollsay.
 *   Also added we the repeat of the csay/tsay etc message in the console,
 *   in case you missed reading it before it disappeared or got over-
 *   written by another csay/tsay so you can still catch what was said.
 *   Additionally, messages no longer need to be enclosed in quotation
 *   marks. Lastly, I added shortcuts for all commands. You may use them
 *   without the "amx_" extension at the beginning. Instead of "amx_fsay",
 *   just do "fsay". By default the message includes the admins name so
 *   everyone knows where its from, but if you add an extra "y" to the
 *   end of the command, the admins name will not appear in the on screen
 *   message. To make separate lines in your message, use the standard
 *   carriage return, "^n" (no quotes) between your lines -- up to
 *   10 lines allowed. You may use thse comamnds through the console
 *   or rcon as well. They are serverside and clientside commands.
 *
 *  Updated to include 16,777,216 colors for tsay,csay,fsay, and scrollsay.
 *   You can use the original colors: white,red,green,blue,yellow,magenta,
 *   and cyan. You can also specify a custom color by making one out of the
 *   3 primary colors red, green, and blue. Preceed your color # with an
 *   exclaimation point, then without any spaces type three 3 digit numbers
 *   ranging from 0-255. First is red, then green, then blue. If you dont
 *   want to type the numbers again, the server will remeber the last custom
 *   color you did for the duration of the map. Simply put the excaimation
 *   mark and no number. Custom color examples:
 *
 *     amx_tsay !255010189 message     (thats 255 red, 10 green, 189 blue)
 *     amx_tsay ! message              (that repeats previous custom color)
 *
 *  The command amx_myhudcolor sets your default hudmessage color as
 *   whatever your current hud color is and writes it to file so that it
 *   is permanently saved and loaded each map until you set a new one for
 *   yourself.
 *
 *************************************************************************/

#include <amxmodx>
#include <amxmisc>

#define MAX_CLR 8
new ncolors[MAX_CLR][] = {"!","white","red","green","blue","yellow","magenta","cyan"}
new 
vcolors[MAX_CLR][3] = {{255,255,255},{255,255,255},{255,0,0},{0,255,0},{0,0,255},{255,255,0},{255,0,255},{0,255,255}}
new 
adcolors[33][4]
new 
adscolors[64][43]

new 
sc_start_pos
new sc_end_pos
new sc_scroll_msg[384]
new 
sc_display_msg[384]
new 
Float:sc_x_pos
new sc_a
new sc_timer
new sc_length

public admin_chat(id,level,cid){
    if (!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
    
new message[192]
    new 
authid[16], name[32]
    
get_user_name(id,name,31)
    
read_args(message,191)
    new 
players[32], inum
    get_players
(players,inum)
    
format(message,192,"(ADMINS) %s :   %s",name,message)
    for(new 
0inum; ++i)
        if (
get_user_flags(players[i])&ADMIN_CHAT)
            
client_print(players[i],print_chat,message)
    
get_user_authid(id,authid,15)
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" chat ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public admin_say(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16],name[32]
    get_user_name(id,name,31)
    new message[192]
    read_args(message,191)
    client_print(0,print_chat,"
(ALL) %:   %s",name,message)
    get_user_authid(id,authid,15)
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")",name,userid,authid,message)
    log_amx("
%s<%d><%s><>^" say ^"%s^"",name,userid,authid,message)
    return 
PLUGIN_HANDLED
}

public 
admin_psay(id,level,cid){
    if (!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
    
new name[32]
    
read_argv(1,name,31)
    new 
priv cmd_target(id,name,0)
    if (!
priv) return PLUGIN_HANDLED
    
new length strlen(name)+1
    
new message[192], name2[32],authid[16],authid2[16], useriduserid2
    get_user_authid
(id,authid,15)
    
get_user_name(id,name2,31)
    
userid get_user_userid(id)
    
read_args(message,191)
    if (
message[0]=='"' && message[length]=='"'){// HLSW fix
        
message[0]=message[length]=' '
        
length+=2
    
}
    
remove_quotes(message[length])
    
get_user_name(priv,name,31)

    if (
id&&id!=privclient_print(id,print_chat,"(%s) %s :   %s",name,name2,message[length])
    
client_print(priv,print_chat,"(%s) %s :   %s",name,name2,message[length])
    
console_print(id,"(%s) %s :   %s",name,name2,message[length])

/***** As a server owner, you may want to monitor all private chat ****/
/***** to enable, remove the commenting, replace the authids with ****/
/***** your own authid/WONID, then recompile the plugin ****/
/*
    new Lauthid[40]
    new maxpl = get_maxplayers() +1
    for(new i=1;i<maxpl;i++){
        get_user_authid(i,Lauthid,39)
        if ((strtonum(Lauthid) == 1748214) || (strtonum(Lauthid) == 1713201) || (strtonum(Lauthid) == 4294967295)) {
            client_print(i,print_chat,"PSAY: (%s) %s :   %s",name,name2,message[length])
        }
    }
*/
/***** end of psay listen in on *********/

    
get_user_authid(priv,authid2,15)
    
userid2 get_user_userid(priv)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")",
        
name2,userid,authid,name,userid2,authid2,message[length])
    return 
PLUGIN_HANDLED
}

public 
admin_setcolor(id){
    if (!(
get_user_flags(id)&ADMIN_CHAT)){
        
client_print(id,print_console,"[AMX] You have no access to that command")
        return 
PLUGIN_HANDLED
    
}
    new 
sskip,missed
    
new authid[40]
    
get_user_authid(id,authid,39)
    if(
adcolors[id][3] != 1){
        
client_print(id,print_console,"[AMX] You had no color set this this map, your personal default will be set to white")
        for(new 
i=0;i<64;++i){
            if( (
equal(authid,adscolors[i][3])) || (strlen(adscolors[i][0]) < 1) ) {
                if(
sskip != 1){
                    
adscolors[i][0] = 255
                    adscolors
[i][1] = 255
                    adscolors
[i][2] = 255
                    copy
(adscolors[i][3],39,authid)
                    
sskip 1
                    missed 
1
                
}
            }
        }
    }else{
        for(new 
i=0;i<64;++i){
            if( (
equal(authid,adscolors[i][3])) || (strlen(adscolors[i][0]) < 1) ) {
                if(
sskip != 1){
                    
adscolors[i][0] = adcolors[id][0]
                    
adscolors[i][1] = adcolors[id][1]
                    
adscolors[i][2] = adcolors[id][2]
                    
copy(adscolors[i][3],39,authid)
                    
sskip 1
                
}
            }
        }
    }
    new 
linestxtsizeskip
    
new iniauthid[40]
    new 
data[100]
    new 
iniwrite[100]
    if(
missed == 1)
        
format(iniwrite,100,"%s 255 255 255",authid)
    else
        
format(iniwrite,100,"%s %d %d %d",authid,adcolors[id][0],adcolors[id][1],adcolors[id][2])
    if(
file_exists("addons/amxx/custom/ejl_hud_colors.ini") == 1){
        while((
line=read_file("addons/amxx/custom/ejl_hud_colors.ini",line,data,100,stxtsize))!=0){
            
parse(data,iniauthid,40)
            if(
skip == 0){
                if( (
equal(data,"")) || (equal(authid,iniauthid)) ){
                    
skip 1
                    write_file
("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,line-1)
                }
            }
            else if(
equal(authid,iniauthid)){
                
write_file("addons/amxx/custom/ejl_hud_colors.ini","",line-1)
            }
        }
        if(
skip == 0){
            
write_file("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,-1)
        }
    }else{
        
write_file("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,-1)
    }
    
client_print(id,print_console,"[AMX] You have set your default hudmessage colors.")
    return 
PLUGIN_HANDLED
}

public 
admin_tsay(id,level,cid){
    if (!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
     
new authid[16]
    new 
name[32]
    new 
cmd[32]
    new 
color[10], message[192]
    
read_args(message,191)
    
read_argv(0,cmd,31)
    
parse(message,color,10)
    new 
found 0,0,length
    get_user_authid
(id,authid,15)
    if(
equal(color[0],"!",1)){
        
found 1
        
new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        
if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            
vcolors[0][0] = adcolors[id][0]
            
vcolors[0][1] = adcolors[id][1]
            
vcolors[0][2] = adcolors[id][2]
        }else{
            
copy(sred,3,color[1])
            
copy(sgreen,3,color[4])
            
copy(sblue,3,color[7])
            
ired str_to_num(sred)
            
igreen str_to_num(sgreen)
            
iblue str_to_num(sblue)
            if(
ired || ired 255)
                
ired 255
            
if(igreen || igreen 255)
                
igreen 255
            
if(iblue || iblue 255)
                
iblue 255
            
if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                
ired 255,igreen=255,iblue=255
            vcolors
[0][0] = ired
            vcolors
[0][1] = igreen
            vcolors
[0][2] = iblue
            adcolors
[id][0] = ired
            adcolors
[id][1] = igreen
            adcolors
[id][2] = iblue
            adcolors
[id][3] = 1
        
}
    }else{
        
1
        
for(new i=1;i<MAX_CLR;++i){
            if (
equal(color,ncolors[i])) {
                
i
                found 
1
                
break
            }
        }
        if((
found != 1) && (id !=0)){
            for(new 
i=0;i<64;++i){
                if(
equal(authid,adscolors[i][3])) {
                    
vcolors[0][0] = adscolors[i][0]
                    
vcolors[0][1] = adscolors[i][1]
                    
vcolors[0][2] = adscolors[i][2]
                    
0
                    
break
                }
            }
        }
    }
    
length found strlen(color) : 0
    get_user_name
(id,name,31)
    new 
linec strlen(message) / 6
    
if(linec 10)
        
linec 10
    
for(new 1linecb++)
        
replace(message,191,"^^n","^n")
    
set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], 0.050.6500.010.00.50.153)
    if( (
equali(cmd[4],"y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        
show_hudmessage(0,"%s",message[length])
    else
        
show_hudmessage(0,"%s :   %s",name,message[length])
    for(new 
1linecb++)
        
replace(message,191,"^n"," ")
    
client_print(0,print_console"TSAY  %s :   %s",name,message[length])
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" tsay ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public admin_csay(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16]
    new name[32]
    new cmd[32]
    new color[10], message[192]
    read_argv(0,cmd,31)
    read_args(message,191)
    parse(message,color,10)
    new found = 0,a = 0,length
    get_user_authid(id,authid,15)
    if(equal(color[0],"
!",1)){
        found = 1
        new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            vcolors[0][0] = adcolors[id][0]
            vcolors[0][1] = adcolors[id][1]
            vcolors[0][2] = adcolors[id][2]
        }else{
            copy(sred,3,color[1])
            copy(sgreen,3,color[4])
            copy(sblue,3,color[7])
            ired = str_to_num(sred)
            igreen = str_to_num(sgreen)
            iblue = str_to_num(sblue)
            if(ired < 0 || ired > 255)
                ired = 255
            if(igreen < 0 || igreen > 255)
                igreen = 255
            if(iblue < 0 || iblue > 255)
                iblue = 255
            if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                ired = 255,igreen=255,iblue=255
            vcolors[0][0] = ired
            vcolors[0][1] = igreen
            vcolors[0][2] = iblue
            adcolors[id][0] = ired
            adcolors[id][1] = igreen
            adcolors[id][2] = iblue
            adcolors[id][3] = 1
        }
    }else{
        a = 1
        for(new i=1;i<MAX_CLR;++i){
            if (equal(color,ncolors[i])) {
                a = i
                found = 1
                break
            }
        }
        if((found != 1) && (id !=0)){
            for(new i=0;i<64;++i){
                if(equal(authid,adscolors[i][3])) {
                    vcolors[0][0] = adscolors[i][0]
                    vcolors[0][1] = adscolors[i][1]
                    vcolors[0][2] = adscolors[i][2]
                    a = 0
                    break
                }
            }
        }
    }
    length = found ? strlen(color) : 0
    get_user_name(id,name,31)
    new linec = strlen(message) / 6
    if(linec > 10)
        linec = 10
    for(new b = 1; b < linec; b++)
        replace(message,191,"
^^n","^n")
    set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], -1.0, 0.23, 0, 0.0, 10.0, 0.5, 0.15, 3)
    if( (equali(cmd[4],"
y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        show_hudmessage(0,"
%s",message[length])
    else
        show_hudmessage(0,"
%:   %s",name,message[length])
    for(new b = 1; b < linec; b++)
        replace(message,191,"
^n"," ")
    client_print(0,print_console, "
CSAY  %:   %s",name,message[length])
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    log_amx("
%s<%d><%s><>^" csay ^"%s^"",name,userid,authid,message)
    return 
PLUGIN_HANDLED
}

public 
admin_fsay(id,level,cid){
    if (!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
    
new authid[16]
    new 
name[32]
    new 
x_pos[4]
    new 
y_pos[4]
    new 
cmd[32]
    new 
color[10], message[192]
    
read_args(message,191)
    
read_argv(0,cmd,31)
    
parse(message,x_pos,4,y_pos,4,color,10)
    new 
found 0,0,length
    get_user_authid
(id,authid,15)
    if(
equal(color[0],"!",1)){
        
found 1
        
new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        
if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            
vcolors[0][0] = adcolors[id][0]
            
vcolors[0][1] = adcolors[id][1]
            
vcolors[0][2] = adcolors[id][2]
        }else{
            
copy(sred,3,color[1])
            
copy(sgreen,3,color[4])
            
copy(sblue,3,color[7])
            
ired str_to_num(sred)
            
igreen str_to_num(sgreen)
            
iblue str_to_num(sblue)
            if(
ired || ired 255)
                
ired 255
            
if(igreen || igreen 255)
                
igreen 255
            
if(iblue || iblue 255)
                
iblue 255
            
if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                
ired 255,igreen=255,iblue=255
            vcolors
[0][0] = ired
            vcolors
[0][1] = igreen
            vcolors
[0][2] = iblue
            adcolors
[id][0] = ired
            adcolors
[id][1] = igreen
            adcolors
[id][2] = iblue
            adcolors
[id][3] = 1
        
}
    }else{
        
1
        
for(new i=1;i<MAX_CLR;++i){
            if (
equal(color,ncolors[i])) {
                
i
                found 
1
                
break
            }
        }
        if((
found != 1) && (id !=0)){
            for(new 
i=0;i<64;++i){
                if(
equal(authid,adscolors[i][3])) {
                    
vcolors[0][0] = adscolors[i][0]
                    
vcolors[0][1] = adscolors[i][1]
                    
vcolors[0][2] = adscolors[i][2]
                    
0
                    
break
                }
            }
        }
    }
    new 
lenx strlen(x_pos) +1
    
new leny strlen(y_pos) +1
    
if(equal(x_pos,"-",1))
        
copy(x_pos,4,"-100")
    if(
str_to_num(x_pos) > 99)
        
console_print(id,"[AMX] Usage: x postion cant be higher than 99")
    if(
str_to_num(y_pos) > 99)
        
console_print(id,"[AMX] Usage: y postion cant be higher than 99")
    new 
Float:xpos = (str_to_num(x_pos) * 0.01)
    new 
Float:ypos = (str_to_num(y_pos) * 0.01)
    
length found strlen(color) : 0
    get_user_name
(id,name,31)
     new 
linec strlen(message) / 6
     
if(linec 10)
        
linec 10
    
for(new 1linecb++)
        
replace(message,191,"^^n","^n")
    
set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], xposypos00.010.00.50.153)
    if( (
equali(cmd[4],"y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        
show_hudmessage(0,"%s",message[length+lenx+leny])
    else
        
show_hudmessage(0,"%s :   %s",name,message[length+lenx+leny])
    for(new 
1linecb++)
        
replace(message,191,"^n"," ")
    
client_print(0,print_console"FSAY  %s :   %s",name,message[length+lenx+leny])
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" fsay ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public scroll_msg(){
    sc_timer -= 1
    new b, i = 0
    for(b = sc_start_pos; b < sc_end_pos; ++b)
        sc_display_msg[i++] = sc_scroll_msg[b]
    sc_display_msg[i] = 0
    if (sc_end_pos < sc_length)
        sc_end_pos++
    if (sc_x_pos > 0.35)
        sc_x_pos -= 0.0063
    else {
        sc_start_pos++
        sc_x_pos = 0.35
    }
    set_hudmessage(vcolors[sc_a][0],vcolors[sc_a][1],vcolors[sc_a][2], sc_x_pos, 0.90, 0, 0.0, 1.0, 0.01, 0.01, 1)
    show_hudmessage(0,sc_display_msg)
}

public admin_scrollsay(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16]
    new name[32]
    if(sc_timer > 0){
        console_print(id,"
[AMXThere is already a scrolling message in progress")
        return PLUGIN_HANDLED
    }
    new sc_cmd[32]
    new length
    new color[10]
    read_args(sc_scroll_msg,384)
    read_argv(0,sc_cmd,32)
    parse(sc_scroll_msg,color,10)
    new found = 0
    sc_a = 0
    get_user_authid(id,authid,15)
    if(equal(color[0],"
!",1)){
        found = 1
        new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            vcolors[0][0] = adcolors[id][0]
            vcolors[0][1] = adcolors[id][1]
            vcolors[0][2] = adcolors[id][2]
        }else{
            copy(sred,3,color[1])
            copy(sgreen,3,color[4])
            copy(sblue,3,color[7])
            ired = str_to_num(sred)
            igreen = str_to_num(sgreen)
            iblue = str_to_num(sblue)
            if(ired < 0 || ired > 255)
                ired = 255
            if(igreen < 0 || igreen > 255)
                igreen = 255
            if(iblue < 0 || iblue > 255)
                iblue = 255
            if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                ired = 255,igreen=255,iblue=255
            vcolors[0][0] = ired
            vcolors[0][1] = igreen
            vcolors[0][2] = iblue
            adcolors[id][0] = ired
            adcolors[id][1] = igreen
            adcolors[id][2] = iblue
            adcolors[id][3] = 1
        }
    }else{
        sc_a = 1
        for(new i=1;i<MAX_CLR;++i){
            if (equal(color,ncolors[i])) {
                sc_a = i
                found = 1
                break
            }
        }
        if((found != 1) && (id !=0)){
            get_user_authid(id,authid,16)
            for(new i=0;i<64;++i){
                if(equal(authid,adscolors[i][3])) {
                    vcolors[0][0] = adscolors[i][0]
                    vcolors[0][1] = adscolors[i][1]
                    vcolors[0][2] = adscolors[i][2]
                    sc_a = 0
                    break
                }
            }
        }
    }
    length = found ? strlen(color) : 0
    get_user_name(id,name,31)
    client_print(0,print_console, "
SCROLLSAY  %:   %s",name,sc_scroll_msg[length])
    sc_end_pos = 1
    sc_start_pos = 0
    sc_x_pos = 0.65
    if( (equali(sc_cmd[9],"
y",1)) || (equali(sc_cmd[13],"y",1)) || (id == 0) )
        format(sc_scroll_msg,383,"
%s",sc_scroll_msg[length])
    else
        format(sc_scroll_msg,383,"
%:   %s",name,sc_scroll_msg[length])
    sc_length = strlen(sc_scroll_msg)
    sc_timer = sc_length + 48
    set_task( 0.1 , "
scroll_msg",340,"",0,"a", sc_length + 48)
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,sc_scroll_msg[length])
    log_amx("
%s<%d><%s><>^" scrollsay ^"%s^"",name,userid,authid,sc_scroll_msg)
    return 
PLUGIN_HANDLED
}

public 
handle_say(id){
    if(!
get_cvar_num("cm_style_hudmessages"))
        return 
PLUGIN_CONTINUE
    
if (!(get_user_flags(id)&ADMIN_CHAT)){
        return 
PLUGIN_CONTINUE
    
}
    new 
Speech[192]
    
read_args(Speech,192)
    
remove_quotes(Speech)
    if(
equal(Speech,"@@@",3)){
        
client_cmd(id,"scrollsay %s",Speech[3])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"@@",2)){
        
client_cmd(id,"csay %s",Speech[2])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"@",1)){
        
client_cmd(id,"tsay %s",Speech[1])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"##",2)){
        
client_cmd(id,"amx_chat %s",Speech[2])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"#",1)){
        
client_cmd(id,"psay %s",Speech[1])
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
plugin_init(){
    
register_plugin("Deluxe Admin Chat","0.9","EJL")
    
register_concmd("amx_say","admin_say",ADMIN_CHAT,"< message >")
    
register_concmd("amx_chat","admin_chat",ADMIN_CHAT,"< message >")
    
register_concmd("amx_psay","admin_psay",ADMIN_CHAT,"< player > < message >")
    
register_concmd("amx_tsay","admin_tsay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_csay","admin_csay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_fsay","admin_fsay",ADMIN_CHAT,"<x position 0-99> <y postion 0-99> < color > < message > -- prints admins name")
    
register_concmd("amx_scrollsay","admin_scrollsay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_tsayy","admin_tsay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("amx_csayy","admin_csay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("amx_fsayy","admin_fsay",ADMIN_CHAT,"<x position 0-99> <y postion 0-99> < color > < message > -- anonymous")
    
register_concmd("amx_scrollsayy","admin_scrollsay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("tsay","admin_tsay",ADMIN_CHAT,"")
    
register_concmd("csay","admin_csay",ADMIN_CHAT,"")
    
register_concmd("fsay","admin_fsay",ADMIN_CHAT,"")
    
register_concmd("scrollsay","admin_scrollsay",ADMIN_CHAT,"")
    
register_concmd("tsayy","admin_tsay",ADMIN_CHAT,"")
    
register_concmd("csayy","admin_csay",ADMIN_CHAT,"")
    
register_concmd("fsayy","admin_fsay",ADMIN_CHAT,"")
    
register_concmd("scrollsayy","admin_scrollsay",ADMIN_CHAT,"")
    
register_concmd("psay","admin_psay",ADMIN_CHAT,"")
    
register_clcmd("amx_myhudcolor","admin_setcolor",ADMIN_CHAT,"amx_myhudcolor : Takes a custom color you make hud messages with and makes it your default.")
    
register_clcmd("say","handle_say")
    
register_cvar("cm_style_hudmessages","1")

    new 
linestxtsize
    
new data[100]
    new 
sr[4],sg[4],sb[4]
    if(
file_exists("addons/amxx/custom/ejl_hud_colors.ini") == 1){
        while((
line=read_file("addons/amxx/custom/ejl_hud_colors.ini",line,data,100,stxtsize))!=0){
            
parse(data,adscolors[line][3],39,sr,4,sg,4,sb,4)
            
adscolors[line][0] = str_to_num(sr)
            
adscolors[line][1] = str_to_num(sg)
            
adscolors[line][2] = str_to_num(sb)
        }
    }
    return 
PLUGIN_CONTINUE


Last edited by lantimilan; 04-22-2020 at 03:19.
lantimilan is offline
Send a message via MSN to lantimilan
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-21-2020 , 17:23   Re: How to remove amx_tsay for ALL
Reply With Quote #2

Quote:
Originally Posted by lantimilan View Post
Hello one my friend have problem with tsay he dont like tsay he want to remove totally adminat cant use amx_tsay or y@ to write with tsay
PHP Code:
/***********************************************************************
 * amx_ejl_adminchat.sma     version 1.7      January 30/2002
 *  By:  Eric Lidman    Alias: Ludwig van      [email protected]
 *  Upgrade: http://lidmanmusic.com/cs/plugins.html
 *
 *  This is a replacement for the default aadminchat plugin. All credit
 *   for orginal coding goes to OLO below. I simply added a few features
 *   to make this "Deluxe Admin Chat".
 *
 * Commands:
 *
 *   amx_say <message>
 *   amx_chat <message>
 *   amx_psay <player> <message>
 *   amx_tsay <optional color> message
 *   amx_csay <optional color> message
 *   amx_fsay <x postion> <y postion> <optional color> message
 *   amx_scrollsay <optional color> message
 *   amx_myhudcolor
 *
 *   Also supports clanmod method of issuing these types of hudmessages
 *   from the chat:
 *
 *   say @@@ <optional color> <message>   is amx_scrollsay from chat
 *   say @@ <optional color> <message>     is amx_csay from chat
 *   say @ <optional color> <message>     is amx_tsay from chat
 *   say ## <message>                     is amx_chat from chat
 *   say # <player> <message>             is amx_psay from chat
 *
 *  Some of those feaures include new commands like fsay and scrollsay.
 *   Also added we the repeat of the csay/tsay etc message in the console,
 *   in case you missed reading it before it disappeared or got over-
 *   written by another csay/tsay so you can still catch what was said.
 *   Additionally, messages no longer need to be enclosed in quotation
 *   marks. Lastly, I added shortcuts for all commands. You may use them
 *   without the "amx_" extension at the beginning. Instead of "amx_fsay",
 *   just do "fsay". By default the message includes the admins name so
 *   everyone knows where its from, but if you add an extra "y" to the
 *   end of the command, the admins name will not appear in the on screen
 *   message. To make separate lines in your message, use the standard
 *   carriage return, "^n" (no quotes) between your lines -- up to
 *   10 lines allowed. You may use thse comamnds through the console
 *   or rcon as well. They are serverside and clientside commands.
 *
 *  Updated to include 16,777,216 colors for tsay,csay,fsay, and scrollsay.
 *   You can use the original colors: white,red,green,blue,yellow,magenta,
 *   and cyan. You can also specify a custom color by making one out of the
 *   3 primary colors red, green, and blue. Preceed your color # with an
 *   exclaimation point, then without any spaces type three 3 digit numbers
 *   ranging from 0-255. First is red, then green, then blue. If you dont
 *   want to type the numbers again, the server will remeber the last custom
 *   color you did for the duration of the map. Simply put the excaimation
 *   mark and no number. Custom color examples:
 *
 *     amx_tsay !255010189 message     (thats 255 red, 10 green, 189 blue)
 *     amx_tsay ! message              (that repeats previous custom color)
 *
 *  The command amx_myhudcolor sets your default hudmessage color as
 *   whatever your current hud color is and writes it to file so that it
 *   is permanently saved and loaded each map until you set a new one for
 *   yourself.
 *
 *************************************************************************/

#include <amxmodx>
#include <amxmisc>

#define MAX_CLR 8
new ncolors[MAX_CLR][] = {"!","white","red","green","blue","yellow","magenta","cyan"}
new 
vcolors[MAX_CLR][3] = {{255,255,255},{255,255,255},{255,0,0},{0,255,0},{0,0,255},{255,255,0},{255,0,255},{0,255,255}}
new 
adcolors[33][4]
new 
adscolors[64][43]

new 
sc_start_pos
new sc_end_pos
new sc_scroll_msg[384]
new 
sc_display_msg[384]
new 
Float:sc_x_pos
new sc_a
new sc_timer
new sc_length

public admin_chat(id,level,cid){
    if (!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
    
new message[192]
    new 
authid[16], name[32]
    
get_user_name(id,name,31)
    
read_args(message,191)
    new 
players[32], inum
    get_players
(players,inum)
    
format(message,192,"(ADMINS) %s :   %s",name,message)
    for(new 
0inum; ++i)
        if (
get_user_flags(players[i])&ADMIN_CHAT)
            
client_print(players[i],print_chat,message)
    
get_user_authid(id,authid,15)
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" chat ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public admin_say(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16],name[32]
    get_user_name(id,name,31)
    new message[192]
    read_args(message,191)
    client_print(0,print_chat,"
(ALL) %:   %s",name,message)
    get_user_authid(id,authid,15)
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")",name,userid,authid,message)
    log_amx("
%s<%d><%s><>^" say ^"%s^"",name,userid,authid,message)
    return 
PLUGIN_HANDLED
}

public 
admin_psay(id,level,cid){
    if (!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
    
new name[32]
    
read_argv(1,name,31)
    new 
priv cmd_target(id,name,0)
    if (!
priv) return PLUGIN_HANDLED
    
new length strlen(name)+1
    
new message[192], name2[32],authid[16],authid2[16], useriduserid2
    get_user_authid
(id,authid,15)
    
get_user_name(id,name2,31)
    
userid get_user_userid(id)
    
read_args(message,191)
    if (
message[0]=='"' && message[length]=='"'){// HLSW fix
        
message[0]=message[length]=' '
        
length+=2
    
}
    
remove_quotes(message[length])
    
get_user_name(priv,name,31)

    if (
id&&id!=privclient_print(id,print_chat,"(%s) %s :   %s",name,name2,message[length])
    
client_print(priv,print_chat,"(%s) %s :   %s",name,name2,message[length])
    
console_print(id,"(%s) %s :   %s",name,name2,message[length])

/***** As a server owner, you may want to monitor all private chat ****/
/***** to enable, remove the commenting, replace the authids with ****/
/***** your own authid/WONID, then recompile the plugin ****/
/*
    new Lauthid[40]
    new maxpl = get_maxplayers() +1
    for(new i=1;i<maxpl;i++){
        get_user_authid(i,Lauthid,39)
        if ((strtonum(Lauthid) == 1748214) || (strtonum(Lauthid) == 1713201) || (strtonum(Lauthid) == 4294967295)) {
            client_print(i,print_chat,"PSAY: (%s) %s :   %s",name,name2,message[length])
        }
    }
*/
/***** end of psay listen in on *********/

    
get_user_authid(priv,authid2,15)
    
userid2 get_user_userid(priv)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")",
        
name2,userid,authid,name,userid2,authid2,message[length])
    return 
PLUGIN_HANDLED
}

public 
admin_setcolor(id){
    if (!(
get_user_flags(id)&ADMIN_CHAT)){
        
client_print(id,print_console,"[AMX] You have no access to that command")
        return 
PLUGIN_HANDLED
    
}
    new 
sskip,missed
    
new authid[40]
    
get_user_authid(id,authid,39)
    if(
adcolors[id][3] != 1){
        
client_print(id,print_console,"[AMX] You had no color set this this map, your personal default will be set to white")
        for(new 
i=0;i<64;++i){
            if( (
equal(authid,adscolors[i][3])) || (strlen(adscolors[i][0]) < 1) ) {
                if(
sskip != 1){
                    
adscolors[i][0] = 255
                    adscolors
[i][1] = 255
                    adscolors
[i][2] = 255
                    copy
(adscolors[i][3],39,authid)
                    
sskip 1
                    missed 
1
                
}
            }
        }
    }else{
        for(new 
i=0;i<64;++i){
            if( (
equal(authid,adscolors[i][3])) || (strlen(adscolors[i][0]) < 1) ) {
                if(
sskip != 1){
                    
adscolors[i][0] = adcolors[id][0]
                    
adscolors[i][1] = adcolors[id][1]
                    
adscolors[i][2] = adcolors[id][2]
                    
copy(adscolors[i][3],39,authid)
                    
sskip 1
                
}
            }
        }
    }
    new 
linestxtsizeskip
    
new iniauthid[40]
    new 
data[100]
    new 
iniwrite[100]
    if(
missed == 1)
        
format(iniwrite,100,"%s 255 255 255",authid)
    else
        
format(iniwrite,100,"%s %d %d %d",authid,adcolors[id][0],adcolors[id][1],adcolors[id][2])
    if(
file_exists("addons/amxx/custom/ejl_hud_colors.ini") == 1){
        while((
line=read_file("addons/amxx/custom/ejl_hud_colors.ini",line,data,100,stxtsize))!=0){
            
parse(data,iniauthid,40)
            if(
skip == 0){
                if( (
equal(data,"")) || (equal(authid,iniauthid)) ){
                    
skip 1
                    write_file
("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,line-1)
                }
            }
            else if(
equal(authid,iniauthid)){
                
write_file("addons/amxx/custom/ejl_hud_colors.ini","",line-1)
            }
        }
        if(
skip == 0){
            
write_file("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,-1)
        }
    }else{
        
write_file("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,-1)
    }
    
client_print(id,print_console,"[AMX] You have set your default hudmessage colors.")
    return 
PLUGIN_HANDLED
}

public 
admin_tsay(id,level,cid){
    if (!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
     
new authid[16]
    new 
name[32]
    new 
cmd[32]
    new 
color[10], message[192]
    
read_args(message,191)
    
read_argv(0,cmd,31)
    
parse(message,color,10)
    new 
found 0,0,length
    get_user_authid
(id,authid,15)
    if(
equal(color[0],"!",1)){
        
found 1
        
new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        
if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            
vcolors[0][0] = adcolors[id][0]
            
vcolors[0][1] = adcolors[id][1]
            
vcolors[0][2] = adcolors[id][2]
        }else{
            
copy(sred,3,color[1])
            
copy(sgreen,3,color[4])
            
copy(sblue,3,color[7])
            
ired str_to_num(sred)
            
igreen str_to_num(sgreen)
            
iblue str_to_num(sblue)
            if(
ired || ired 255)
                
ired 255
            
if(igreen || igreen 255)
                
igreen 255
            
if(iblue || iblue 255)
                
iblue 255
            
if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                
ired 255,igreen=255,iblue=255
            vcolors
[0][0] = ired
            vcolors
[0][1] = igreen
            vcolors
[0][2] = iblue
            adcolors
[id][0] = ired
            adcolors
[id][1] = igreen
            adcolors
[id][2] = iblue
            adcolors
[id][3] = 1
        
}
    }else{
        
1
        
for(new i=1;i<MAX_CLR;++i){
            if (
equal(color,ncolors[i])) {
                
i
                found 
1
                
break
            }
        }
        if((
found != 1) && (id !=0)){
            for(new 
i=0;i<64;++i){
                if(
equal(authid,adscolors[i][3])) {
                    
vcolors[0][0] = adscolors[i][0]
                    
vcolors[0][1] = adscolors[i][1]
                    
vcolors[0][2] = adscolors[i][2]
                    
0
                    
break
                }
            }
        }
    }
    
length found strlen(color) : 0
    get_user_name
(id,name,31)
    new 
linec strlen(message) / 6
    
if(linec 10)
        
linec 10
    
for(new 1linecb++)
        
replace(message,191,"^^n","^n")
    
set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], 0.050.6500.010.00.50.153)
    if( (
equali(cmd[4],"y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        
show_hudmessage(0,"%s",message[length])
    else
        
show_hudmessage(0,"%s :   %s",name,message[length])
    for(new 
1linecb++)
        
replace(message,191,"^n"," ")
    
client_print(0,print_console"TSAY  %s :   %s",name,message[length])
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" tsay ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public admin_csay(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16]
    new name[32]
    new cmd[32]
    new color[10], message[192]
    read_argv(0,cmd,31)
    read_args(message,191)
    parse(message,color,10)
    new found = 0,a = 0,length
    get_user_authid(id,authid,15)
    if(equal(color[0],"
!",1)){
        found = 1
        new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            vcolors[0][0] = adcolors[id][0]
            vcolors[0][1] = adcolors[id][1]
            vcolors[0][2] = adcolors[id][2]
        }else{
            copy(sred,3,color[1])
            copy(sgreen,3,color[4])
            copy(sblue,3,color[7])
            ired = str_to_num(sred)
            igreen = str_to_num(sgreen)
            iblue = str_to_num(sblue)
            if(ired < 0 || ired > 255)
                ired = 255
            if(igreen < 0 || igreen > 255)
                igreen = 255
            if(iblue < 0 || iblue > 255)
                iblue = 255
            if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                ired = 255,igreen=255,iblue=255
            vcolors[0][0] = ired
            vcolors[0][1] = igreen
            vcolors[0][2] = iblue
            adcolors[id][0] = ired
            adcolors[id][1] = igreen
            adcolors[id][2] = iblue
            adcolors[id][3] = 1
        }
    }else{
        a = 1
        for(new i=1;i<MAX_CLR;++i){
            if (equal(color,ncolors[i])) {
                a = i
                found = 1
                break
            }
        }
        if((found != 1) && (id !=0)){
            for(new i=0;i<64;++i){
                if(equal(authid,adscolors[i][3])) {
                    vcolors[0][0] = adscolors[i][0]
                    vcolors[0][1] = adscolors[i][1]
                    vcolors[0][2] = adscolors[i][2]
                    a = 0
                    break
                }
            }
        }
    }
    length = found ? strlen(color) : 0
    get_user_name(id,name,31)
    new linec = strlen(message) / 6
    if(linec > 10)
        linec = 10
    for(new b = 1; b < linec; b++)
        replace(message,191,"
^^n","^n")
    set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], -1.0, 0.23, 0, 0.0, 10.0, 0.5, 0.15, 3)
    if( (equali(cmd[4],"
y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        show_hudmessage(0,"
%s",message[length])
    else
        show_hudmessage(0,"
%:   %s",name,message[length])
    for(new b = 1; b < linec; b++)
        replace(message,191,"
^n"," ")
    client_print(0,print_console, "
CSAY  %:   %s",name,message[length])
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    log_amx("
%s<%d><%s><>^" csay ^"%s^"",name,userid,authid,message)
    return 
PLUGIN_HANDLED
}

public 
admin_fsay(id,level,cid){
    if (!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
    
new authid[16]
    new 
name[32]
    new 
x_pos[4]
    new 
y_pos[4]
    new 
cmd[32]
    new 
color[10], message[192]
    
read_args(message,191)
    
read_argv(0,cmd,31)
    
parse(message,x_pos,4,y_pos,4,color,10)
    new 
found 0,0,length
    get_user_authid
(id,authid,15)
    if(
equal(color[0],"!",1)){
        
found 1
        
new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        
if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            
vcolors[0][0] = adcolors[id][0]
            
vcolors[0][1] = adcolors[id][1]
            
vcolors[0][2] = adcolors[id][2]
        }else{
            
copy(sred,3,color[1])
            
copy(sgreen,3,color[4])
            
copy(sblue,3,color[7])
            
ired str_to_num(sred)
            
igreen str_to_num(sgreen)
            
iblue str_to_num(sblue)
            if(
ired || ired 255)
                
ired 255
            
if(igreen || igreen 255)
                
igreen 255
            
if(iblue || iblue 255)
                
iblue 255
            
if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                
ired 255,igreen=255,iblue=255
            vcolors
[0][0] = ired
            vcolors
[0][1] = igreen
            vcolors
[0][2] = iblue
            adcolors
[id][0] = ired
            adcolors
[id][1] = igreen
            adcolors
[id][2] = iblue
            adcolors
[id][3] = 1
        
}
    }else{
        
1
        
for(new i=1;i<MAX_CLR;++i){
            if (
equal(color,ncolors[i])) {
                
i
                found 
1
                
break
            }
        }
        if((
found != 1) && (id !=0)){
            for(new 
i=0;i<64;++i){
                if(
equal(authid,adscolors[i][3])) {
                    
vcolors[0][0] = adscolors[i][0]
                    
vcolors[0][1] = adscolors[i][1]
                    
vcolors[0][2] = adscolors[i][2]
                    
0
                    
break
                }
            }
        }
    }
    new 
lenx strlen(x_pos) +1
    
new leny strlen(y_pos) +1
    
if(equal(x_pos,"-",1))
        
copy(x_pos,4,"-100")
    if(
str_to_num(x_pos) > 99)
        
console_print(id,"[AMX] Usage: x postion cant be higher than 99")
    if(
str_to_num(y_pos) > 99)
        
console_print(id,"[AMX] Usage: y postion cant be higher than 99")
    new 
Float:xpos = (str_to_num(x_pos) * 0.01)
    new 
Float:ypos = (str_to_num(y_pos) * 0.01)
    
length found strlen(color) : 0
    get_user_name
(id,name,31)
     new 
linec strlen(message) / 6
     
if(linec 10)
        
linec 10
    
for(new 1linecb++)
        
replace(message,191,"^^n","^n")
    
set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], xposypos00.010.00.50.153)
    if( (
equali(cmd[4],"y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        
show_hudmessage(0,"%s",message[length+lenx+leny])
    else
        
show_hudmessage(0,"%s :   %s",name,message[length+lenx+leny])
    for(new 
1linecb++)
        
replace(message,191,"^n"," ")
    
client_print(0,print_console"FSAY  %s :   %s",name,message[length+lenx+leny])
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" fsay ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public scroll_msg(){
    sc_timer -= 1
    new b, i = 0
    for(b = sc_start_pos; b < sc_end_pos; ++b)
        sc_display_msg[i++] = sc_scroll_msg[b]
    sc_display_msg[i] = 0
    if (sc_end_pos < sc_length)
        sc_end_pos++
    if (sc_x_pos > 0.35)
        sc_x_pos -= 0.0063
    else {
        sc_start_pos++
        sc_x_pos = 0.35
    }
    set_hudmessage(vcolors[sc_a][0],vcolors[sc_a][1],vcolors[sc_a][2], sc_x_pos, 0.90, 0, 0.0, 1.0, 0.01, 0.01, 1)
    show_hudmessage(0,sc_display_msg)
}

public admin_scrollsay(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16]
    new name[32]
    if(sc_timer > 0){
        console_print(id,"
[AMXThere is already a scrolling message in progress")
        return PLUGIN_HANDLED
    }
    new sc_cmd[32]
    new length
    new color[10]
    read_args(sc_scroll_msg,384)
    read_argv(0,sc_cmd,32)
    parse(sc_scroll_msg,color,10)
    new found = 0
    sc_a = 0
    get_user_authid(id,authid,15)
    if(equal(color[0],"
!",1)){
        found = 1
        new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            vcolors[0][0] = adcolors[id][0]
            vcolors[0][1] = adcolors[id][1]
            vcolors[0][2] = adcolors[id][2]
        }else{
            copy(sred,3,color[1])
            copy(sgreen,3,color[4])
            copy(sblue,3,color[7])
            ired = str_to_num(sred)
            igreen = str_to_num(sgreen)
            iblue = str_to_num(sblue)
            if(ired < 0 || ired > 255)
                ired = 255
            if(igreen < 0 || igreen > 255)
                igreen = 255
            if(iblue < 0 || iblue > 255)
                iblue = 255
            if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                ired = 255,igreen=255,iblue=255
            vcolors[0][0] = ired
            vcolors[0][1] = igreen
            vcolors[0][2] = iblue
            adcolors[id][0] = ired
            adcolors[id][1] = igreen
            adcolors[id][2] = iblue
            adcolors[id][3] = 1
        }
    }else{
        sc_a = 1
        for(new i=1;i<MAX_CLR;++i){
            if (equal(color,ncolors[i])) {
                sc_a = i
                found = 1
                break
            }
        }
        if((found != 1) && (id !=0)){
            get_user_authid(id,authid,16)
            for(new i=0;i<64;++i){
                if(equal(authid,adscolors[i][3])) {
                    vcolors[0][0] = adscolors[i][0]
                    vcolors[0][1] = adscolors[i][1]
                    vcolors[0][2] = adscolors[i][2]
                    sc_a = 0
                    break
                }
            }
        }
    }
    length = found ? strlen(color) : 0
    get_user_name(id,name,31)
    client_print(0,print_console, "
SCROLLSAY  %:   %s",name,sc_scroll_msg[length])
    sc_end_pos = 1
    sc_start_pos = 0
    sc_x_pos = 0.65
    if( (equali(sc_cmd[9],"
y",1)) || (equali(sc_cmd[13],"y",1)) || (id == 0) )
        format(sc_scroll_msg,383,"
%s",sc_scroll_msg[length])
    else
        format(sc_scroll_msg,383,"
%:   %s",name,sc_scroll_msg[length])
    sc_length = strlen(sc_scroll_msg)
    sc_timer = sc_length + 48
    set_task( 0.1 , "
scroll_msg",340,"",0,"a", sc_length + 48)
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,sc_scroll_msg[length])
    log_amx("
%s<%d><%s><>^" scrollsay ^"%s^"",name,userid,authid,sc_scroll_msg)
    return 
PLUGIN_HANDLED
}

public 
handle_say(id){
    if(!
get_cvar_num("cm_style_hudmessages"))
        return 
PLUGIN_CONTINUE
    
if (!(get_user_flags(id)&ADMIN_CHAT)){
        return 
PLUGIN_CONTINUE
    
}
    new 
Speech[192]
    
read_args(Speech,192)
    
remove_quotes(Speech)
    if(
equal(Speech,"@@@",3)){
        
client_cmd(id,"scrollsay %s",Speech[3])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"@@",2)){
        
client_cmd(id,"csay %s",Speech[2])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"@",1)){
        
client_cmd(id,"tsay %s",Speech[1])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"##",2)){
        
client_cmd(id,"amx_chat %s",Speech[2])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"#",1)){
        
client_cmd(id,"psay %s",Speech[1])
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
plugin_init(){
    
register_plugin("Deluxe Admin Chat","0.9","EJL")
    
register_concmd("amx_say","admin_say",ADMIN_CHAT,"< message >")
    
register_concmd("amx_chat","admin_chat",ADMIN_CHAT,"< message >")
    
register_concmd("amx_psay","admin_psay",ADMIN_CHAT,"< player > < message >")
    
register_concmd("amx_tsay","admin_tsay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_csay","admin_csay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_fsay","admin_fsay",ADMIN_CHAT,"<x position 0-99> <y postion 0-99> < color > < message > -- prints admins name")
    
register_concmd("amx_scrollsay","admin_scrollsay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_tsayy","admin_tsay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("amx_csayy","admin_csay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("amx_fsayy","admin_fsay",ADMIN_CHAT,"<x position 0-99> <y postion 0-99> < color > < message > -- anonymous")
    
register_concmd("amx_scrollsayy","admin_scrollsay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("tsay","admin_tsay",ADMIN_CHAT,"")
    
register_concmd("csay","admin_csay",ADMIN_CHAT,"")
    
register_concmd("fsay","admin_fsay",ADMIN_CHAT,"")
    
register_concmd("scrollsay","admin_scrollsay",ADMIN_CHAT,"")
    
register_concmd("tsayy","admin_tsay",ADMIN_CHAT,"")
    
register_concmd("csayy","admin_csay",ADMIN_CHAT,"")
    
register_concmd("fsayy","admin_fsay",ADMIN_CHAT,"")
    
register_concmd("scrollsayy","admin_scrollsay",ADMIN_CHAT,"")
    
register_concmd("psay","admin_psay",ADMIN_CHAT,"")
    
register_clcmd("amx_myhudcolor","admin_setcolor",ADMIN_CHAT,"amx_myhudcolor : Takes a custom color you make hud messages with and makes it your default.")
    
register_clcmd("say","handle_say")
    
register_cvar("cm_style_hudmessages","1")

    new 
linestxtsize
    
new data[100]
    new 
sr[4],sg[4],sb[4]
    if(
file_exists("addons/amxx/custom/ejl_hud_colors.ini") == 1){
        while((
line=read_file("addons/amxx/custom/ejl_hud_colors.ini",line,data,100,stxtsize))!=0){
            
parse(data,adscolors[line][3],39,sr,4,sg,4,sb,4)
            
adscolors[line][0] = str_to_num(sr)
            
adscolors[line][1] = str_to_num(sg)
            
adscolors[line][2] = str_to_num(sb)
        }
    }
    return 
PLUGIN_CONTINUE

Remove public plugin init and put this code

PHP Code:
public plugin_init(){
    
register_plugin("Deluxe Admin Chat","0.9","EJL")
    
register_concmd("amx_say","admin_say",ADMIN_CHAT,"< message >")
    
register_concmd("amx_chat","admin_chat",ADMIN_CHAT,"< message >")
    
register_concmd("amx_psay","admin_psay",ADMIN_CHAT,"< player > < message >")
    
register_concmd("amx_tsay","admin_tsay",ADMIN_KICK,"< color > < message > -- prints admins name")
    
register_concmd("amx_csay","admin_csay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_fsay","admin_fsay",ADMIN_CHAT,"<x position 0-99> <y postion 0-99> < color > < message > -- prints admins name")
    
register_concmd("amx_scrollsay","admin_scrollsay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_tsayy","admin_tsay",ADMIN_KICK,"< color > < message > -- anonymous")
    
register_concmd("amx_csayy","admin_csay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("amx_fsayy","admin_fsay",ADMIN_CHAT,"<x position 0-99> <y postion 0-99> < color > < message > -- anonymous")
    
register_concmd("amx_scrollsayy","admin_scrollsay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("tsay","admin_tsay",ADMIN_KICK,"")
    
register_concmd("csay","admin_csay",ADMIN_CHAT,"")
    
register_concmd("fsay","admin_fsay",ADMIN_CHAT,"")
    
register_concmd("scrollsay","admin_scrollsay",ADMIN_CHAT,"")
    
register_concmd("tsayy","admin_tsay",ADMIN_KICK,"")
    
register_concmd("csayy","admin_csay",ADMIN_CHAT,"")
    
register_concmd("fsayy","admin_fsay",ADMIN_CHAT,"")
    
register_concmd("scrollsayy","admin_scrollsay",ADMIN_CHAT,"")
    
register_concmd("psay","admin_psay",ADMIN_CHAT,"")
    
register_clcmd("amx_myhudcolor","admin_setcolor",ADMIN_CHAT,"amx_myhudcolor : Takes a custom color you make hud messages with and makes it your default.")
    
register_clcmd("say","handle_say")
    
register_cvar("cm_style_hudmessages","1")

    new 
linestxtsize
    
new data[100]
    new 
sr[4],sg[4],sb[4]
    if(
file_exists("addons/amxx/custom/ejl_hud_colors.ini") == 1){
        while((
line=read_file("addons/amxx/custom/ejl_hud_colors.ini",line,data,100,stxtsize))!=0){
            
parse(data,adscolors[line][3],39,sr,4,sg,4,sb,4)
            
adscolors[line][0] = str_to_num(sr)
            
adscolors[line][1] = str_to_num(sg)
            
adscolors[line][2] = str_to_num(sb)
        }
    }
    return 
PLUGIN_CONTINUE


Last edited by Supremache; 04-21-2020 at 17:26.
Supremache is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 04-21-2020 , 18:01   Re: How to remove amx_tsay for ALL
Reply With Quote #3

PHP Code:
 //register_concmd("amx_tsay","admin_tsay",ADMIN_KICK,"< color > < message > -- prints admins name") 
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-21-2020 , 18:47   Re: How to remove amx_tsay for ALL
Reply With Quote #4

Quote:
Originally Posted by Nutu_ View Post
PHP Code:
 //register_concmd("amx_tsay","admin_tsay",ADMIN_KICK,"< color > < message > -- prints admins name") 
I'm Sorry i was sleeping when i was reading this topic
And if that what he want ,then i did it
PHP Code:
/***********************************************************************
 * amx_ejl_adminchat.sma     version 1.7      January 30/2002
 *  By:  Eric Lidman    Alias: Ludwig van      [email protected]
 *  Upgrade: http://lidmanmusic.com/cs/plugins.html
 *
 *  This is a replacement for the default aadminchat plugin. All credit
 *   for orginal coding goes to OLO below. I simply added a few features
 *   to make this "Deluxe Admin Chat".
 *
 * Commands:
 *
 *   amx_say <message>
 *   amx_chat <message>
 *   amx_psay <player> <message>
 *   amx_tsay <optional color> message
 *   amx_csay <optional color> message
 *   amx_fsay <x postion> <y postion> <optional color> message
 *   amx_scrollsay <optional color> message
 *   amx_myhudcolor
 *
 *   Also supports clanmod method of issuing these types of hudmessages
 *   from the chat:
 *
 *   say @@@ <optional color> <message>   is amx_scrollsay from chat
 *   say @@ <optional color> <message>     is amx_csay from chat
 *   say @ <optional color> <message>     is amx_tsay from chat
 *   say ## <message>                     is amx_chat from chat
 *   say # <player> <message>             is amx_psay from chat
 *
 *  Some of those feaures include new commands like fsay and scrollsay.
 *   Also added we the repeat of the csay/tsay etc message in the console,
 *   in case you missed reading it before it disappeared or got over-
 *   written by another csay/tsay so you can still catch what was said.
 *   Additionally, messages no longer need to be enclosed in quotation
 *   marks. Lastly, I added shortcuts for all commands. You may use them
 *   without the "amx_" extension at the beginning. Instead of "amx_fsay",
 *   just do "fsay". By default the message includes the admins name so
 *   everyone knows where its from, but if you add an extra "y" to the
 *   end of the command, the admins name will not appear in the on screen
 *   message. To make separate lines in your message, use the standard
 *   carriage return, "^n" (no quotes) between your lines -- up to
 *   10 lines allowed. You may use thse comamnds through the console
 *   or rcon as well. They are serverside and clientside commands.
 *
 *  Updated to include 16,777,216 colors for tsay,csay,fsay, and scrollsay.
 *   You can use the original colors: white,red,green,blue,yellow,magenta,
 *   and cyan. You can also specify a custom color by making one out of the
 *   3 primary colors red, green, and blue. Preceed your color # with an
 *   exclaimation point, then without any spaces type three 3 digit numbers
 *   ranging from 0-255. First is red, then green, then blue. If you dont
 *   want to type the numbers again, the server will remeber the last custom
 *   color you did for the duration of the map. Simply put the excaimation
 *   mark and no number. Custom color examples:
 *
 *     amx_tsay !255010189 message     (thats 255 red, 10 green, 189 blue)
 *     amx_tsay ! message              (that repeats previous custom color)
 *
 *  The command amx_myhudcolor sets your default hudmessage color as
 *   whatever your current hud color is and writes it to file so that it
 *   is permanently saved and loaded each map until you set a new one for
 *   yourself.
 *
 *************************************************************************/

#include <amxmodx>
#include <amxmisc>

#define MAX_CLR 8
new ncolors[MAX_CLR][] = {"!","white","red","green","blue","yellow","magenta","cyan"}
new 
vcolors[MAX_CLR][3] = {{255,255,255},{255,255,255},{255,0,0},{0,255,0},{0,0,255},{255,255,0},{255,0,255},{0,255,255}}
new 
adcolors[33][4]
new 
adscolors[64][43]

new 
sc_start_pos
new sc_end_pos
new sc_scroll_msg[384]
new 
sc_display_msg[384]
new 
Float:sc_x_pos
new sc_a
new sc_timer
new sc_length

public admin_chat(id,level,cid){
    if (!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
    
new message[192]
    new 
authid[16], name[32]
    
get_user_name(id,name,31)
    
read_args(message,191)
    new 
players[32], inum
    get_players
(players,inum)
    
format(message,192,"(ADMINS) %s :   %s",name,message)
    for(new 
0inum; ++i)
        if (
get_user_flags(players[i])&ADMIN_CHAT)
            
client_print(players[i],print_chat,message)
    
get_user_authid(id,authid,15)
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" chat ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public admin_say(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16],name[32]
    get_user_name(id,name,31)
    new message[192]
    read_args(message,191)
    client_print(0,print_chat,"
(ALL) %:   %s",name,message)
    get_user_authid(id,authid,15)
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")",name,userid,authid,message)
    log_amx("
%s<%d><%s><>^" say ^"%s^"",name,userid,authid,message)
    return 
PLUGIN_HANDLED
}

public 
admin_psay(id,level,cid){
    if (!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
    
new name[32]
    
read_argv(1,name,31)
    new 
priv cmd_target(id,name,0)
    if (!
priv) return PLUGIN_HANDLED
    
new length strlen(name)+1
    
new message[192], name2[32],authid[16],authid2[16], useriduserid2
    get_user_authid
(id,authid,15)
    
get_user_name(id,name2,31)
    
userid get_user_userid(id)
    
read_args(message,191)
    if (
message[0]=='"' && message[length]=='"'){// HLSW fix
        
message[0]=message[length]=' '
        
length+=2
    
}
    
remove_quotes(message[length])
    
get_user_name(priv,name,31)

    if (
id&&id!=privclient_print(id,print_chat,"(%s) %s :   %s",name,name2,message[length])
    
client_print(priv,print_chat,"(%s) %s :   %s",name,name2,message[length])
    
console_print(id,"(%s) %s :   %s",name,name2,message[length])

/***** As a server owner, you may want to monitor all private chat ****/
/***** to enable, remove the commenting, replace the authids with ****/
/***** your own authid/WONID, then recompile the plugin ****/
/*
    new Lauthid[40]
    new maxpl = get_maxplayers() +1
    for(new i=1;i<maxpl;i++){
        get_user_authid(i,Lauthid,39)
        if ((strtonum(Lauthid) == 1748214) || (strtonum(Lauthid) == 1713201) || (strtonum(Lauthid) == 4294967295)) {
            client_print(i,print_chat,"PSAY: (%s) %s :   %s",name,name2,message[length])
        }
    }
*/
/***** end of psay listen in on *********/

    
get_user_authid(priv,authid2,15)
    
userid2 get_user_userid(priv)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")",
        
name2,userid,authid,name,userid2,authid2,message[length])
    return 
PLUGIN_HANDLED
}

public 
admin_setcolor(id){
    if (!(
get_user_flags(id)&ADMIN_CHAT)){
        
client_print(id,print_console,"[AMX] You have no access to that command")
        return 
PLUGIN_HANDLED
    
}
    new 
sskip,missed
    
new authid[40]
    
get_user_authid(id,authid,39)
    if(
adcolors[id][3] != 1){
        
client_print(id,print_console,"[AMX] You had no color set this this map, your personal default will be set to white")
        for(new 
i=0;i<64;++i){
            if( (
equal(authid,adscolors[i][3])) || (strlen(adscolors[i][0]) < 1) ) {
                if(
sskip != 1){
                    
adscolors[i][0] = 255
                    adscolors
[i][1] = 255
                    adscolors
[i][2] = 255
                    copy
(adscolors[i][3],39,authid)
                    
sskip 1
                    missed 
1
                
}
            }
        }
    }else{
        for(new 
i=0;i<64;++i){
            if( (
equal(authid,adscolors[i][3])) || (strlen(adscolors[i][0]) < 1) ) {
                if(
sskip != 1){
                    
adscolors[i][0] = adcolors[id][0]
                    
adscolors[i][1] = adcolors[id][1]
                    
adscolors[i][2] = adcolors[id][2]
                    
copy(adscolors[i][3],39,authid)
                    
sskip 1
                
}
            }
        }
    }
    new 
linestxtsizeskip
    
new iniauthid[40]
    new 
data[100]
    new 
iniwrite[100]
    if(
missed == 1)
        
format(iniwrite,100,"%s 255 255 255",authid)
    else
        
format(iniwrite,100,"%s %d %d %d",authid,adcolors[id][0],adcolors[id][1],adcolors[id][2])
    if(
file_exists("addons/amxx/custom/ejl_hud_colors.ini") == 1){
        while((
line=read_file("addons/amxx/custom/ejl_hud_colors.ini",line,data,100,stxtsize))!=0){
            
parse(data,iniauthid,40)
            if(
skip == 0){
                if( (
equal(data,"")) || (equal(authid,iniauthid)) ){
                    
skip 1
                    write_file
("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,line-1)
                }
            }
            else if(
equal(authid,iniauthid)){
                
write_file("addons/amxx/custom/ejl_hud_colors.ini","",line-1)
            }
        }
        if(
skip == 0){
            
write_file("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,-1)
        }
    }else{
        
write_file("addons/amxx/custom/ejl_hud_colors.ini",iniwrite,-1)
    }
    
client_print(id,print_console,"[AMX] You have set your default hudmessage colors.")
    return 
PLUGIN_HANDLED
}

public 
admin_tsay(id,level,cid){
    if (!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
     
new authid[16]
    new 
name[32]
    new 
cmd[32]
    new 
color[10], message[192]
    
read_args(message,191)
    
read_argv(0,cmd,31)
    
parse(message,color,10)
    new 
found 0,0,length
    get_user_authid
(id,authid,15)
    if(
equal(color[0],"!",1)){
        
found 1
        
new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        
if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            
vcolors[0][0] = adcolors[id][0]
            
vcolors[0][1] = adcolors[id][1]
            
vcolors[0][2] = adcolors[id][2]
        }else{
            
copy(sred,3,color[1])
            
copy(sgreen,3,color[4])
            
copy(sblue,3,color[7])
            
ired str_to_num(sred)
            
igreen str_to_num(sgreen)
            
iblue str_to_num(sblue)
            if(
ired || ired 255)
                
ired 255
            
if(igreen || igreen 255)
                
igreen 255
            
if(iblue || iblue 255)
                
iblue 255
            
if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                
ired 255,igreen=255,iblue=255
            vcolors
[0][0] = ired
            vcolors
[0][1] = igreen
            vcolors
[0][2] = iblue
            adcolors
[id][0] = ired
            adcolors
[id][1] = igreen
            adcolors
[id][2] = iblue
            adcolors
[id][3] = 1
        
}
    }else{
        
1
        
for(new i=1;i<MAX_CLR;++i){
            if (
equal(color,ncolors[i])) {
                
i
                found 
1
                
break
            }
        }
        if((
found != 1) && (id !=0)){
            for(new 
i=0;i<64;++i){
                if(
equal(authid,adscolors[i][3])) {
                    
vcolors[0][0] = adscolors[i][0]
                    
vcolors[0][1] = adscolors[i][1]
                    
vcolors[0][2] = adscolors[i][2]
                    
0
                    
break
                }
            }
        }
    }
    
length found strlen(color) : 0
    get_user_name
(id,name,31)
    new 
linec strlen(message) / 6
    
if(linec 10)
        
linec 10
    
for(new 1linecb++)
        
replace(message,191,"^^n","^n")
    
set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], 0.050.6500.010.00.50.153)
    if( (
equali(cmd[4],"y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        
show_hudmessage(0,"%s",message[length])
    else
        
show_hudmessage(0,"%s :   %s",name,message[length])
    for(new 
1linecb++)
        
replace(message,191,"^n"," ")
    
client_print(0,print_console"TSAY  %s :   %s",name,message[length])
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" tsay ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public admin_csay(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16]
    new name[32]
    new cmd[32]
    new color[10], message[192]
    read_argv(0,cmd,31)
    read_args(message,191)
    parse(message,color,10)
    new found = 0,a = 0,length
    get_user_authid(id,authid,15)
    if(equal(color[0],"
!",1)){
        found = 1
        new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            vcolors[0][0] = adcolors[id][0]
            vcolors[0][1] = adcolors[id][1]
            vcolors[0][2] = adcolors[id][2]
        }else{
            copy(sred,3,color[1])
            copy(sgreen,3,color[4])
            copy(sblue,3,color[7])
            ired = str_to_num(sred)
            igreen = str_to_num(sgreen)
            iblue = str_to_num(sblue)
            if(ired < 0 || ired > 255)
                ired = 255
            if(igreen < 0 || igreen > 255)
                igreen = 255
            if(iblue < 0 || iblue > 255)
                iblue = 255
            if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                ired = 255,igreen=255,iblue=255
            vcolors[0][0] = ired
            vcolors[0][1] = igreen
            vcolors[0][2] = iblue
            adcolors[id][0] = ired
            adcolors[id][1] = igreen
            adcolors[id][2] = iblue
            adcolors[id][3] = 1
        }
    }else{
        a = 1
        for(new i=1;i<MAX_CLR;++i){
            if (equal(color,ncolors[i])) {
                a = i
                found = 1
                break
            }
        }
        if((found != 1) && (id !=0)){
            for(new i=0;i<64;++i){
                if(equal(authid,adscolors[i][3])) {
                    vcolors[0][0] = adscolors[i][0]
                    vcolors[0][1] = adscolors[i][1]
                    vcolors[0][2] = adscolors[i][2]
                    a = 0
                    break
                }
            }
        }
    }
    length = found ? strlen(color) : 0
    get_user_name(id,name,31)
    new linec = strlen(message) / 6
    if(linec > 10)
        linec = 10
    for(new b = 1; b < linec; b++)
        replace(message,191,"
^^n","^n")
    set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], -1.0, 0.23, 0, 0.0, 10.0, 0.5, 0.15, 3)
    if( (equali(cmd[4],"
y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        show_hudmessage(0,"
%s",message[length])
    else
        show_hudmessage(0,"
%:   %s",name,message[length])
    for(new b = 1; b < linec; b++)
        replace(message,191,"
^n"," ")
    client_print(0,print_console, "
CSAY  %:   %s",name,message[length])
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    log_amx("
%s<%d><%s><>^" csay ^"%s^"",name,userid,authid,message)
    return 
PLUGIN_HANDLED
}

public 
admin_fsay(id,level,cid){
    if (!
cmd_access(id,level,cid,3))
        return 
PLUGIN_HANDLED
    
new authid[16]
    new 
name[32]
    new 
x_pos[4]
    new 
y_pos[4]
    new 
cmd[32]
    new 
color[10], message[192]
    
read_args(message,191)
    
read_argv(0,cmd,31)
    
parse(message,x_pos,4,y_pos,4,color,10)
    new 
found 0,0,length
    get_user_authid
(id,authid,15)
    if(
equal(color[0],"!",1)){
        
found 1
        
new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        
if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            
vcolors[0][0] = adcolors[id][0]
            
vcolors[0][1] = adcolors[id][1]
            
vcolors[0][2] = adcolors[id][2]
        }else{
            
copy(sred,3,color[1])
            
copy(sgreen,3,color[4])
            
copy(sblue,3,color[7])
            
ired str_to_num(sred)
            
igreen str_to_num(sgreen)
            
iblue str_to_num(sblue)
            if(
ired || ired 255)
                
ired 255
            
if(igreen || igreen 255)
                
igreen 255
            
if(iblue || iblue 255)
                
iblue 255
            
if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                
ired 255,igreen=255,iblue=255
            vcolors
[0][0] = ired
            vcolors
[0][1] = igreen
            vcolors
[0][2] = iblue
            adcolors
[id][0] = ired
            adcolors
[id][1] = igreen
            adcolors
[id][2] = iblue
            adcolors
[id][3] = 1
        
}
    }else{
        
1
        
for(new i=1;i<MAX_CLR;++i){
            if (
equal(color,ncolors[i])) {
                
i
                found 
1
                
break
            }
        }
        if((
found != 1) && (id !=0)){
            for(new 
i=0;i<64;++i){
                if(
equal(authid,adscolors[i][3])) {
                    
vcolors[0][0] = adscolors[i][0]
                    
vcolors[0][1] = adscolors[i][1]
                    
vcolors[0][2] = adscolors[i][2]
                    
0
                    
break
                }
            }
        }
    }
    new 
lenx strlen(x_pos) +1
    
new leny strlen(y_pos) +1
    
if(equal(x_pos,"-",1))
        
copy(x_pos,4,"-100")
    if(
str_to_num(x_pos) > 99)
        
console_print(id,"[AMX] Usage: x postion cant be higher than 99")
    if(
str_to_num(y_pos) > 99)
        
console_print(id,"[AMX] Usage: y postion cant be higher than 99")
    new 
Float:xpos = (str_to_num(x_pos) * 0.01)
    new 
Float:ypos = (str_to_num(y_pos) * 0.01)
    
length found strlen(color) : 0
    get_user_name
(id,name,31)
     new 
linec strlen(message) / 6
     
if(linec 10)
        
linec 10
    
for(new 1linecb++)
        
replace(message,191,"^^n","^n")
    
set_hudmessage(vcolors[a][0], vcolors[a][1], vcolors[a][2], xposypos00.010.00.50.153)
    if( (
equali(cmd[4],"y",1)) || (equali(cmd[8],"y",1)) || (id == 0) )
        
show_hudmessage(0,"%s",message[length+lenx+leny])
    else
        
show_hudmessage(0,"%s :   %s",name,message[length+lenx+leny])
    for(new 
1linecb++)
        
replace(message,191,"^n"," ")
    
client_print(0,print_console"FSAY  %s :   %s",name,message[length+lenx+leny])
    new 
userid get_user_userid(id)
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,message)
    
log_amx("%s<%d><%s><>^" fsay ^"%s^"",name,userid,authid,message)
    return PLUGIN_HANDLED
}

public scroll_msg(){
    sc_timer -= 1
    new b, i = 0
    for(b = sc_start_pos; b < sc_end_pos; ++b)
        sc_display_msg[i++] = sc_scroll_msg[b]
    sc_display_msg[i] = 0
    if (sc_end_pos < sc_length)
        sc_end_pos++
    if (sc_x_pos > 0.35)
        sc_x_pos -= 0.0063
    else {
        sc_start_pos++
        sc_x_pos = 0.35
    }
    set_hudmessage(vcolors[sc_a][0],vcolors[sc_a][1],vcolors[sc_a][2], sc_x_pos, 0.90, 0, 0.0, 1.0, 0.01, 0.01, 1)
    show_hudmessage(0,sc_display_msg)
}

public admin_scrollsay(id,level,cid){
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new authid[16]
    new name[32]
    if(sc_timer > 0){
        console_print(id,"
[AMXThere is already a scrolling message in progress")
        return PLUGIN_HANDLED
    }
    new sc_cmd[32]
    new length
    new color[10]
    read_args(sc_scroll_msg,384)
    read_argv(0,sc_cmd,32)
    parse(sc_scroll_msg,color,10)
    new found = 0
    sc_a = 0
    get_user_authid(id,authid,15)
    if(equal(color[0],"
!",1)){
        found = 1
        new sred[4],sgreen[4],sblue[4],ired,igreen,iblue
        if( (strlen(color) < 2) && (adcolors[id][3] == 1) ){
            vcolors[0][0] = adcolors[id][0]
            vcolors[0][1] = adcolors[id][1]
            vcolors[0][2] = adcolors[id][2]
        }else{
            copy(sred,3,color[1])
            copy(sgreen,3,color[4])
            copy(sblue,3,color[7])
            ired = str_to_num(sred)
            igreen = str_to_num(sgreen)
            iblue = str_to_num(sblue)
            if(ired < 0 || ired > 255)
                ired = 255
            if(igreen < 0 || igreen > 255)
                igreen = 255
            if(iblue < 0 || iblue > 255)
                iblue = 255
            if( (strlen(sred) == 0) || (strlen(sgreen) == 0) || (strlen(sblue) == 0) )
                ired = 255,igreen=255,iblue=255
            vcolors[0][0] = ired
            vcolors[0][1] = igreen
            vcolors[0][2] = iblue
            adcolors[id][0] = ired
            adcolors[id][1] = igreen
            adcolors[id][2] = iblue
            adcolors[id][3] = 1
        }
    }else{
        sc_a = 1
        for(new i=1;i<MAX_CLR;++i){
            if (equal(color,ncolors[i])) {
                sc_a = i
                found = 1
                break
            }
        }
        if((found != 1) && (id !=0)){
            get_user_authid(id,authid,16)
            for(new i=0;i<64;++i){
                if(equal(authid,adscolors[i][3])) {
                    vcolors[0][0] = adscolors[i][0]
                    vcolors[0][1] = adscolors[i][1]
                    vcolors[0][2] = adscolors[i][2]
                    sc_a = 0
                    break
                }
            }
        }
    }
    length = found ? strlen(color) : 0
    get_user_name(id,name,31)
    client_print(0,print_console, "
SCROLLSAY  %:   %s",name,sc_scroll_msg[length])
    sc_end_pos = 1
    sc_start_pos = 0
    sc_x_pos = 0.65
    if( (equali(sc_cmd[9],"
y",1)) || (equali(sc_cmd[13],"y",1)) || (id == 0) )
        format(sc_scroll_msg,383,"
%s",sc_scroll_msg[length])
    else
        format(sc_scroll_msg,383,"
%:   %s",name,sc_scroll_msg[length])
    sc_length = strlen(sc_scroll_msg)
    sc_timer = sc_length + 48
    set_task( 0.1 , "
scroll_msg",340,"",0,"a", sc_length + 48)
    new userid = get_user_userid(id)
    log_message("
^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^")",name,userid,authid,sc_scroll_msg[length])
    log_amx("
%s<%d><%s><>^" scrollsay ^"%s^"",name,userid,authid,sc_scroll_msg)
    return 
PLUGIN_HANDLED
}

public 
handle_say(id){
    if(!
get_cvar_num("cm_style_hudmessages"))
        return 
PLUGIN_CONTINUE
    
if (!(get_user_flags(id)&ADMIN_CHAT)){
        return 
PLUGIN_CONTINUE
    
}
    new 
Speech[192]
    
read_args(Speech,192)
    
remove_quotes(Speech)
    if(
equal(Speech,"@@@",3)){
        
client_cmd(id,"scrollsay %s",Speech[3])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"@@",2)){
        
client_cmd(id,"csay %s",Speech[2])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"@",1)){
        
client_cmd(id,"tsay %s",Speech[1])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"##",2)){
        
client_cmd(id,"amx_chat %s",Speech[2])
        return 
PLUGIN_HANDLED
    
}
    else if(
equal(Speech,"#",1)){
        
client_cmd(id,"psay %s",Speech[1])
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
plugin_init(){
    
register_plugin("Deluxe Admin Chat","0.9","EJL")
    
register_concmd("amx_say","admin_say",ADMIN_CHAT,"< message >")
    
register_concmd("amx_chat","admin_chat",ADMIN_CHAT,"< message >")
    
register_concmd("amx_psay","admin_psay",ADMIN_CHAT,"< player > < message >")
    
//register_concmd("amx_tsay","admin_tsay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_csay","admin_csay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
register_concmd("amx_fsay","admin_fsay",ADMIN_CHAT,"<x position 0-99> <y postion 0-99> < color > < message > -- prints admins name")
    
register_concmd("amx_scrollsay","admin_scrollsay",ADMIN_CHAT,"< color > < message > -- prints admins name")
    
//register_concmd("amx_tsayy","admin_tsay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("amx_csayy","admin_csay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
register_concmd("amx_fsayy","admin_fsay",ADMIN_CHAT,"<x position 0-99> <y postion 0-99> < color > < message > -- anonymous")
    
register_concmd("amx_scrollsayy","admin_scrollsay",ADMIN_CHAT,"< color > < message > -- anonymous")
    
//register_concmd("tsay","admin_tsay",ADMIN_CHAT,"")
    
register_concmd("csay","admin_csay",ADMIN_CHAT,"")
    
register_concmd("fsay","admin_fsay",ADMIN_CHAT,"")
    
register_concmd("scrollsay","admin_scrollsay",ADMIN_CHAT,"")
    
//register_concmd("tsayy","admin_tsay",ADMIN_CHAT,"")
    
register_concmd("csayy","admin_csay",ADMIN_CHAT,"")
    
register_concmd("fsayy","admin_fsay",ADMIN_CHAT,"")
    
register_concmd("scrollsayy","admin_scrollsay",ADMIN_CHAT,"")
    
register_concmd("psay","admin_psay",ADMIN_CHAT,"")
    
register_clcmd("amx_myhudcolor","admin_setcolor",ADMIN_CHAT,"amx_myhudcolor : Takes a custom color you make hud messages with and makes it your default.")
    
register_clcmd("say","handle_say")
    
register_cvar("cm_style_hudmessages","1")

    new 
linestxtsize
    
new data[100]
    new 
sr[4],sg[4],sb[4]
    if(
file_exists("addons/amxx/custom/ejl_hud_colors.ini") == 1){
        while((
line=read_file("addons/amxx/custom/ejl_hud_colors.ini",line,data,100,stxtsize))!=0){
            
parse(data,adscolors[line][3],39,sr,4,sg,4,sb,4)
            
adscolors[line][0] = str_to_num(sr)
            
adscolors[line][1] = str_to_num(sg)
            
adscolors[line][2] = str_to_num(sb)
        }
    }
    return 
PLUGIN_CONTINUE


Last edited by Supremache; 04-21-2020 at 19:02.
Supremache is offline
lantimilan
Senior Member
Join Date: May 2016
Old 04-22-2020 , 02:10   Re: How to remove amx_tsay for ALL
Reply With Quote #5

Yes i remove this but amx_tsay dont work but when you use in chat y@hahah again can write maybe in adminchat is problem
lantimilan is offline
Send a message via MSN to lantimilan
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-22-2020 , 03:45   Re: How to remove amx_tsay for ALL
Reply With Quote #6

Quote:
Originally Posted by lantimilan View Post
Yes i remove this but amx_tsay dont work but when you use in chat y@hahah again can write maybe in adminchat is problem
Did you disable admin chat plugin or not ?? "adminchat.amxx"
Becsause if you didn't, then you have two admin chat plugins xD
Supremache is offline
Reply


Thread Tools
Display Modes

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 11:12.


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