Raised This Month: $109 Target: $400
 27% 

Coloring Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AlexandruODT
Member
Join Date: May 2020
Old 08-01-2020 , 12:43   Coloring Plugin
Reply With Quote #1

Can anyone help me color the messages in this plugin?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

public plugin_init() 
{   
    
register_plugin("SH CVARS",  "1.2",  "Andy")   
    
    
register_concmd("amx_timelimit","timeleft",ADMIN_KICK,"<minutes>")    
    
register_concmd("amx_freezetime","freezetime",ADMIN_KICK,"<seconds>")        
    
register_concmd("amx_unlag","unlag",ADMIN_KICK,"<value>")
    
register_concmd("amx_svrestart","svrestart",ADMIN_KICK,"<value>")
}
public 
timeleft(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("mp_timelimit"str_to_num(arg1))        
         
client_print(0,print_chat,"ADMIN %s: seteaza valoarea cvar mp_timelimit pe %d"namestr_to_num(arg1))         
    return 
PLUGIN_HANDLED 
}
public 
freezetime(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("mp_freezetime"str_to_num(arg1))        
         
client_print(0,print_chat,"ADMIN %s: seteaza valoarea cvar mp_freezetime pe %d"namestr_to_num(arg1))         
    return 
PLUGIN_HANDLED 
}

public 
unlag(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("sv_unlag"str_to_num(arg1))        
         
client_print(0,print_chat,"ADMIN %s: seteaza valoarea cvar sv_unlag pe %d"namestr_to_num(arg1))         
    return 
PLUGIN_HANDLED 
}

public 
svrestart(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("sv_restart"str_to_num(arg1))        
         
client_print(0,print_chat,"ADMIN %s: seteaza valoarea cvar sv_restart pe %d"namestr_to_num(arg1))         
    return 
PLUGIN_HANDLED 

AlexandruODT is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-01-2020 , 14:16   Re: Coloring Plugin
Reply With Quote #2

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
tom .
Junior Member
Join Date: May 2016
Old 08-01-2020 , 14:41   Re: Coloring Plugin
Reply With Quote #3

Hi/salut
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

public plugin_init() 
{   
    
register_plugin("SH CVARS",  "1.2",  "Andy")   
    
    
register_concmd("amx_timelimit","timeleft",ADMIN_KICK,"<minutes>")    
    
register_concmd("amx_freezetime","freezetime",ADMIN_KICK,"<seconds>")        
    
register_concmd("amx_unlag","unlag",ADMIN_KICK,"<value>")
    
register_concmd("amx_svrestart","svrestart",ADMIN_KICK,"<value>")
}
public 
timeleft(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("mp_timelimit"str_to_num(arg1))        
        
colorchat_CC(0"!nADMIN !v%s!n: seteaza valoarea cvar !vmp_timelimit !npe !v%d"namestr_to_num(arg1))   
    return 
PLUGIN_HANDLED 
}
public 
freezetime(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("mp_freezetime"str_to_num(arg1))        
        
colorchat_CC(0"!nADMIN !v%s!n: seteaza valoarea cvar !vmp_freezetime !npe !v%d"namestr_to_num(arg1))            
    return 
PLUGIN_HANDLED 
}

public 
unlag(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("sv_unlag"str_to_num(arg1))        
        
colorchat_CC(0"!nADMIN !v%s!n: seteaza valoarea cvar !vsv_unlag !npe !v%d"namestr_to_num(arg1))        
    return 
PLUGIN_HANDLED 
}

public 
svrestart(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("sv_restart"str_to_num(arg1))        
        
colorchat_CC(0"!nADMIN !v%s!n: seteaza valoarea cvar !vsv_restart !npe !v%d"namestr_to_num(arg1))    
    return 
PLUGIN_HANDLED 


// STOCK CULOARE
stock colorchat_CC(const id, const input[], any:...)
{
    new 
count 1Jucatori[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!v""^4"// Culoarea Verde
    
replace_all(msg190"!n""^1"// Culoarea Normala a Chat-ului (galben)
    
replace_all(msg190"!t""^3"// Culoarea Echipei : CT = Albastru | T = Rosu.
    
    
if (idJucatori[0] = id; else get_players(Jucatoricount"ch")
    {
     for (new 
0countY++)
        {
        if (
is_user_connected(Jucatori[Y]))
               {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _Jucatori[Y])
            
write_byte(Jucatori[Y]);
            
write_string(msg);
            
message_end();
            }
        }
    }

tom . is offline
AlexandruODT
Member
Join Date: May 2020
Old 08-03-2020 , 13:53   Re: Coloring Plugin
Reply With Quote #4

Quote:
Originally Posted by tom . View Post
Hi/salut
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

public plugin_init() 
{   
    
register_plugin("SH CVARS",  "1.2",  "Andy")   
    
    
register_concmd("amx_timelimit","timeleft",ADMIN_KICK,"<minutes>")    
    
register_concmd("amx_freezetime","freezetime",ADMIN_KICK,"<seconds>")        
    
register_concmd("amx_unlag","unlag",ADMIN_KICK,"<value>")
    
register_concmd("amx_svrestart","svrestart",ADMIN_KICK,"<value>")
}
public 
timeleft(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("mp_timelimit"str_to_num(arg1))        
        
colorchat_CC(0"!nADMIN !v%s!n: seteaza valoarea cvar !vmp_timelimit !npe !v%d"namestr_to_num(arg1))   
    return 
PLUGIN_HANDLED 
}
public 
freezetime(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("mp_freezetime"str_to_num(arg1))        
        
colorchat_CC(0"!nADMIN !v%s!n: seteaza valoarea cvar !vmp_freezetime !npe !v%d"namestr_to_num(arg1))            
    return 
PLUGIN_HANDLED 
}

public 
unlag(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("sv_unlag"str_to_num(arg1))        
        
colorchat_CC(0"!nADMIN !v%s!n: seteaza valoarea cvar !vsv_unlag !npe !v%d"namestr_to_num(arg1))        
    return 
PLUGIN_HANDLED 
}

public 
svrestart(id,level,cid
{      
    if(!
cmd_access(idlevelcid1))    
    {        
        return 
PLUGIN_HANDLED    
    
}    
    
    new 
arg1[32], name[32]    
    
read_argv(1arg131)        
         
get_user_name(idname31)    
    
set_cvar_num("sv_restart"str_to_num(arg1))        
        
colorchat_CC(0"!nADMIN !v%s!n: seteaza valoarea cvar !vsv_restart !npe !v%d"namestr_to_num(arg1))    
    return 
PLUGIN_HANDLED 


// STOCK CULOARE
stock colorchat_CC(const id, const input[], any:...)
{
    new 
count 1Jucatori[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!v""^4"// Culoarea Verde
    
replace_all(msg190"!n""^1"// Culoarea Normala a Chat-ului (galben)
    
replace_all(msg190"!t""^3"// Culoarea Echipei : CT = Albastru | T = Rosu.
    
    
if (idJucatori[0] = id; else get_players(Jucatoricount"ch")
    {
     for (new 
0countY++)
        {
        if (
is_user_connected(Jucatori[Y]))
               {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _Jucatori[Y])
            
write_byte(Jucatori[Y]);
            
write_string(msg);
            
message_end();
            }
        }
    }

Mersi / Thanks
AlexandruODT 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 15:48.


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