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

[HELP] Cvar Change Message in Colors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 09-11-2018 , 15:53   [HELP] Cvar Change Message in Colors
Reply With Quote #1

can someone please add colors in this code please. ??

want to color this line :-
PHP Code:
show_activity_id(iidname"%L"i"SET_CVAR_TO"""argcvar_val); 
code :-

PHP Code:
public cmdCvar(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED
    
    
new arg[32], arg2[64]
    
    
read_argv(1arg31)
    
read_argv(2arg263)
    
    new 
pointer;
    
    if (
equal(arg"add") && (get_user_flags(id) & ADMIN_RCON))
    {
        if ((
pointer=get_cvar_pointer(arg2))!=0)
        {
            new 
flags=get_pcvar_flags(pointer);
            
            if (!(
flags FCVAR_PROTECTED))
            {
                
set_pcvar_flags(pointer,flags FCVAR_PROTECTED);
            }
        }
        return 
PLUGIN_HANDLED
    
}
    
    if ((
pointer=get_cvar_pointer(arg))==0)
    {
        
console_print(id"[AMXX] %L"id"UNKNOWN_CVAR"arg)
        return 
PLUGIN_HANDLED
    
}
    
    if (
onlyRcon(arg) && !(get_user_flags(id) & ADMIN_RCON))
    {
        
// Exception for the new onlyRcon rules:
        //   sv_password is allowed to be modified by ADMIN_PASSWORD
        
if (!(equali(arg,"sv_password") && (get_user_flags(id) & ADMIN_PASSWORD)))
        {
            
console_print(id"[AMXX] %L"id"CVAR_NO_ACC")
            return 
PLUGIN_HANDLED
        
}
    }
    
    if (
read_argc() < 3)
    {
        
get_pcvar_string(pointerarg263)
        
console_print(id"[AMXX] %L"id"CVAR_IS"argarg2)
        return 
PLUGIN_HANDLED
    
}

    new 
authid[32], name[32]
    
    
get_user_authid(idauthid31)
    
get_user_name(idname31)
    
    
log_amx("Cmd: ^"%s<%d><%s><>^" set cvar (name ^"%s^") (value ^"%s^")"nameget_user_userid(id), authidargarg2)
    
set_cvar_string(argarg2)
    
    
    
// Display the message to all clients

    
new cvar_val[64];
    new 
maxpl get_maxplayers();
    for (new 
1<= maxpli++)
    {
        if (
is_user_connected(i) && !is_user_bot(i))
        {
            if (
get_pcvar_flags(pointer) & FCVAR_PROTECTED || equali(arg"rcon_password"))
            {
                
formatex(cvar_valcharsmax(cvar_val), "*** %L ***"i"PROTECTED");
            }
            else
            {
                
copy(cvar_valcharsmax(cvar_val), arg2);
            }
            
show_activity_id(iidname"%L"i"SET_CVAR_TO"""argcvar_val);
        }
    }

    
console_print(id"[AMXX] %L"id"CVAR_CHANGED"argarg2)
    
    return 
PLUGIN_HANDLED

Attached Files
File Type: inc cromchat.inc (1.9 KB, 65 views)
File Type: txt admincmd.txt (46.7 KB, 83 views)
File Type: sma Get Plugin or Get Source (admincmd.sma - 350 views - 29.4 KB)

Last edited by shehzad1234; 09-11-2018 at 15:55.
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-11-2018 , 16:07   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #2

Go to show_activity_id function replace the client_print(index, print_chat... Native with your crom include stock.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-11-2018 , 17:03   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #3

No, don't replace anything. Simply add #include <cromchat> to the code and you're done. Just add the color symbols in the language file.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 09-11-2018 , 17:58   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
No, don't replace anything. Simply add #include <cromchat> to the code and you're done. Just add the color symbols in the language file.
PHP Code:
    new cvar_val[64];
    new 
maxpl get_maxplayers();
    for (new 
1<= maxpli++)
    {
        if (
is_user_connected(i) && !is_user_bot(i))
        {
            if (
get_pcvar_flags(pointer) & FCVAR_PROTECTED || equali(arg"rcon_password"))
            {
                
formatex(cvar_valcharsmax(cvar_val), "*** %L ***"i"PROTECTED");
            }
            else
            {
                
copy(cvar_valcharsmax(cvar_val), arg2);
            }
            
CromChat(iidname"%L"i"SET_CVAR_TO"""argcvar_val);
        }
    } 
error
Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Argument type mismatch (argument 2) on line 752

1 Error.
Could not locate output file D:\Steam\steamapps\common\Half-Life\cstrike\addons\amxmodx\scripting\admincmd.amx (compile failed).
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-11-2018 , 18:21   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #5

I said don't change anything in the .sma file.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 09-13-2018 , 16:05   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
I said don't change anything in the .sma file.
can u edit that plugin i really tried to give my best its not working please help brother.
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-13-2018 , 16:16   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #7

I can't say it any clearer - DO NOT EDIT ANYTHING IN THE PLUGIN EXCEPT ADDING #include <cromchat>. Make sure you have the latest cromchat version.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 09-13-2018 , 17:18   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
I can't say it any clearer - DO NOT EDIT ANYTHING IN THE PLUGIN EXCEPT ADDING #include <cromchat>. Make sure you have the latest cromchat version.
if i don't add #include <cromchat> then how i can add colors in plugin ;-;

Last edited by shehzad1234; 09-13-2018 at 17:19.
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-13-2018 , 17:21   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #9

Quote:
Originally Posted by shehzad1234 View Post
if i don't add #include <cromchat> then how i can add colors in plugin ;-;
He told you just to add the include.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-13-2018 , 18:29   Re: [HELP] Cvar Change Message in Colors
Reply With Quote #10

Please open your eyes and read properly. I'm done explaining.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 02:41.


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