Raised This Month: $ Target: $400
 0% 

AMXX GAG Color Chat


Post New Thread Reply   
 
Thread Tools Display Modes
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Algeria
Old 11-02-2021 , 18:30   Re: AMXX GAG Color Chat
Reply With Quote #11

I Dont know xd
SHIFT0 is offline
yRemootz
Junior Member
Join Date: Aug 2021
Location: Sao Paulo, Brazil
Old 11-02-2021 , 18:31   Re: AMXX GAG Color Chat
Reply With Quote #12

Quote:
Originally Posted by SHIFT0 View Post
i will try xd
Thanks.
yRemootz is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Algeria
Old 11-02-2021 , 18:33   Re: AMXX GAG Color Chat
Reply With Quote #13

Bro idk xd
SHIFT0 is offline
yRemootz
Junior Member
Join Date: Aug 2021
Location: Sao Paulo, Brazil
Old 11-02-2021 , 18:33   Re: AMXX GAG Color Chat
Reply With Quote #14

Quote:
Originally Posted by SHIFT0 View Post
I Dont know xd
1. Go to https://forums.alliedmods.net/editpo...postid=2762326.

2. Click in Title:;

3. Put Solved.

4. Save changes.

Last edited by yRemootz; 11-02-2021 at 18:37. Reason: fixing my grammar and errors
yRemootz is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Algeria
Old 11-04-2021 , 08:52   Solved: AMXX GAG Color Chat
Reply With Quote #15

Quote:
Originally Posted by SHIFT0 View Post
Hi guys i want this AMXX GAG
Add to it Color
!g[GAG] !gADMIN !g%Name: !tGAGGED !yPlayer !yName !tFor !g%Time.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

// time in minutes
#define DEFAULT_GAG_TIME 10
#define DEFAULT_MUTE_TIME 10

// level to use amx_gag and amx_ungag
#define ADMIN_GAG ADMIN_LEVEL_A

new bool:g_AllowNameChange[33];

// text
new const g_TextGagTag[] = "[GAG]";
new 
bool:g_TextGagged[33];
new 
Float:g_TextGagTime[33];
new 
Float:g_PermTextGagged[100];
new 
g_TextGaggedAuthid[100][35];
new 
g_TotalTextGagLeaves;

// mute
new const g_MutedTag[] = "[MUTE]";
new 
bool:g_Muted[33];
new 
Float:g_MutedTime[33];
new 
Float:g_PermMuted[100];
new 
g_MutedAuthid[100][35];
new 
g_TotalMutedLeaves;

public 
plugin_init()
{
    
register_plugin("AMX Gag Menu""1.0""null.");
    
register_concmd("amx_gag""concmd_Gag"ADMIN_GAG"<nick, #userid, authid> <time> -- leave time empty for rest of map");
    
register_concmd("amx_ungag""concmd_Ungag"ADMIN_GAG"<nick, #userid, authid>");
    
register_concmd("amx_mute""concmd_Mute"ADMIN_GAG"<nick, #userid, authid> <time> -- leave empty for rest of map");
    
register_concmd("amx_unmute""concmd_Unmute"ADMIN_GAG"<nick, #userid, authid>");
    
register_clcmd("say""clcmd_Say");
    
register_clcmd("say_team""clcmd_Say");
}

public 
client_putinserver(id)
{
    
g_TextGagged[id] = false;
    
g_TextGagTime[id] = 0.0;
    
g_Muted[id] = false;
    
g_MutedTime[id] = 0.0;
    
    new 
authid[35], bool:text falsemute false;
    if(
g_TotalTextGagLeaves 0)
    {
        
get_user_authid(idauthid34);
        for(new 
i=0100i++)
        {
            if(
equali(authidg_TextGaggedAuthid[i]))
            {
                
g_TextGagged[id] = true;
                
                if(
g_PermTextGagged[i] > -1.0)
                    
set_task(g_PermTextGagged[i], "task_UngagPlayer"id 112233);
                
                
g_TextGagTime[id] = g_PermTextGagged[i];
                
g_PermTextGagged[i] = 0.0;
                
g_TextGaggedAuthid[i][0] = '^0';
                
g_TotalTextGagLeaves--;
                
                
text true;
                break;
            }
        }
    }
    if(
g_TotalMutedLeaves 0)
    {
        if(!
strlen(authid))
            
get_user_authid(idauthid34);
        
        for(new 
i=0100i++)
        {
            if(
equali(authidg_MutedAuthid[i]))
            {
                
g_Muted[id] = true;
                
                if(
g_PermMuted[i] > -1.0)
                    
set_task(g_PermMuted[i], "task_UnmutePlayer"id 223344);
                
                
g_MutedTime[id] = g_PermMuted[i];
                
g_PermMuted[i] = 0.0;
                
g_MutedAuthid[i][0] = '^0';
                
g_TotalMutedLeaves--;
                
                
mute true;
                break;
            }
        }
    }
    if(
text || mute)
    {
        new 
name[32], ip[64];
        
get_user_name(idname31);
        
get_user_ip(idip630);
        if(
text && mute)
        {
            
client_print(0print_chat"!g[GAG] A GAGGED & Muted player has returned! %s"name);
            
format(name31"%s%s%s"g_TextGagTagg_MutedTagname);
        }
        else if(
text)
        {
            
client_print(0print_chat"!g[GAG] A GAGGED player has returned! %s"name);
            
format(name31"%s%s"g_TextGagTagname);
        }
        else if(
mute)
        {
            
client_print(0print_chat"!g[GAG] A muted player has returned! %s"name);
            
format(name31"%s%s"g_MutedTagname);
        }
        
client_print(0print_chat"!g[GAG] !tIP: !y%s"ip);
        
g_AllowNameChange[id] = true;
        
set_user_name(idname);
    }
    if(!
mute)
        
set_speak(idSPEAK_NORMAL);
    else
        
set_speak(idSPEAK_MUTED);
}

public 
client_disconnect(id)
{
    if(!
g_TextGagged[id] && !g_Muted[id])
        return;
    
    new 
authid[35], bool:text g_TextGagged[id], mute g_Muted[id];
    
get_user_authid(idauthid34);
    if(
g_TextGagged[id])
    {
        for(new 
i=0100i++)
        {
            if(!
strlen(g_TextGaggedAuthid[i]))
            {
                
g_TextGagged[id] = false;
                
g_PermTextGagged[i] = g_TextGagTime[id];
                
formatex(g_TextGaggedAuthid[i], 34authid);
                
g_TotalTextGagLeaves++;
                
                
text true;
                
                if(
task_exists(id 112233))
                    
remove_task(id 112233);
                
                break;
            }
        }
    }
    if(
g_Muted[id])
    {
        for(new 
i=0100i++)
        {
            if(!
strlen(g_MutedAuthid[i]))
            {
                
g_Muted[id] = false;
                
g_PermMuted[i] = g_MutedTime[id];
                
formatex(g_MutedAuthid[i], 34authid);
                
g_TotalMutedLeaves++;
                
                
mute true;
                
                if(
task_exists(id 223344))
                    
remove_task(id 223344);
                
                break;
            }
        }
    }
    if(
text || mute)
    {
        new 
name[32], ip[64];
        
get_user_name(idname31);
        
get_user_ip(idip630);
        if(
text && mute)
        {
            
deletei(nameg_TextGagTag);
            
deletei(nameg_MutedTag);
            
client_print(0print_chat"!g[GAG] A GAGGED & muted player has left! %s"name);
        }
        else if(
text)
        {
            
deletei(nameg_TextGagTag);
            
client_print(0print_chat"!g[GAG] A GAGGED player has left! %s"name);
        }
        else if(
mute)
        {
            
deletei(nameg_MutedTag);
            
client_print(0print_chat"!g[GAG] A muted player has left! %s"name);
        }
        
client_print(0print_chat"!g[GAG] !tIP: !y%s"ip);
    }
}

public 
client_infochanged(id)
{
    if(!
g_TextGagged[id] && !g_Muted[id])
        return;
    
    if(
g_AllowNameChange[id])
    {
        
g_AllowNameChange[id] = false;
        return;
    }
    
    new 
newname[32], oldname[32];
    
get_user_name(idoldname31);
    
get_user_info(id"name"newname31);
    if(!
equali(newnameoldname))
    {
        
g_AllowNameChange[id] = true;
        
set_user_name(idoldname);
    }
}

public 
concmd_Gag(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    new 
arg[35];
    
read_argv(1arg34);
    new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY);
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    if(
g_TextGagged[player])
    {
        
client_print(idprint_console"!g[GAG] !tClient is already GAGGED!");
        return 
PLUGIN_HANDLED;
    }
    
    new 
Float:gagtime;
    if(
read_argc() > 2)
    {
        
read_argv(2arg31);
        
gagtime str_to_float(arg) * 60.0;
        if(
gagtime 60.0)
            
gagtime DEFAULT_GAG_TIME 60.0;
    }
    else
        
gagtime = -1.0;
    
    new 
gagtype[32];
    if(!(
gagtime > -1.0))
        
formatex(gagtype31"until next map");
    else
    {
        
formatex(gagtype31"for %.2f minutes"gagtime);
        
set_task(gagtime"task_UngagPlayer"id 112233);
    }
    
    new 
name_a[32], name_p[32];
    new 
authid_a[35], authid_p[35];
    
get_user_name(idname_a31);
    
get_user_name(playername_p31);
    
get_user_authid(idauthid_a35);
    
get_user_authid(idauthid_p35);
    
show_activity(idname_a"gagged %s %s!"name_pgagtype);
    
log_amx("%s <%s> gagged %s <%s> %s"name_aauthid_aname_pauthid_pgagtype);
    
    
format(name_p31"%s%s"g_TextGagTagname_p);
    
g_AllowNameChange[player] = true;
    
set_user_name(playername_p);
    
    
g_TextGagged[player] = true;
    
g_TextGagTime[player] = gagtime;
    return 
PLUGIN_HANDLED;
}

public 
concmd_Ungag(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    new 
arg[35];
    
read_argv(1arg31);
    new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY);
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    if(!
g_TextGagged[player])
    {
        
client_print(idprint_console"!g[GAG] !tClient was not gagged!");
        return 
PLUGIN_HANDLED;
    }
    
    new 
name_a[32], name_p[32];
    new 
authid_a[35], authid_p[35];
    
get_user_name(idname_a31);
    
get_user_name(playername_p31);
    
get_user_authid(idauthid_a35);
    
get_user_authid(idauthid_p35);
    
deletei(name_pg_TextGagTag);
    
show_activity(idname_a"ungagged %s!"name_p);
    
log_amx("%s <%s> ungagged %s <%s>"name_aauthid_aname_pauthid_p);
    
    
g_AllowNameChange[player] = true;
    
set_user_name(playername_p);
    
    
g_TextGagged[player] = false;
    
g_TextGagTime[player] = 0.0;
    if(
task_exists(player 112233))
        
remove_task(player 112233);
    
    return 
PLUGIN_HANDLED;
}

public 
concmd_Mute(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    new 
arg[35];
    
read_argv(1arg34);
    new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY);
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    if(
g_Muted[player])
    {
        
client_print(idprint_console"!g[GAG] !tClient is already muted!");
        return 
PLUGIN_HANDLED;
    }
    
    new 
Float:mutetime;
    if(
read_argc() > 2)
    {
        
read_argv(2arg31);
        
mutetime str_to_float(arg) * 60.0;
        if(
mutetime 60.0)
            
mutetime DEFAULT_MUTE_TIME 60.0;
    }
    else
        
mutetime = -1.0;
    
    new 
mutetype[32];
    if(!(
mutetime > -1.0))
        
formatex(mutetype31"until next map");
    else
    {
        
formatex(mutetype31"for %.2f minutes"mutetime);
        
set_task(mutetime"task_UnmutePlayer"id 223344);
    }
    
    new 
name_a[32], name_p[32];
    new 
authid_a[35], authid_p[35];
    
get_user_name(idname_a31);
    
get_user_name(playername_p31);
    
get_user_authid(idauthid_a35);
    
get_user_authid(idauthid_p35);
    
show_activity(idname_a"muted %s %s!"name_pmutetype);
    
log_amx("%s <%s> muted %s <%s> %s"name_aauthid_aname_pauthid_pmutetype);
    
    
format(name_p31"%s%s"g_MutedTagname_p);
    
g_AllowNameChange[player] = true;
    
set_user_name(playername_p);
    
    
g_Muted[player] = true;
    
g_MutedTime[player] = mutetime;
    
set_speak(playerSPEAK_MUTED);
    return 
PLUGIN_HANDLED;
}

public 
concmd_Unmute(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    new 
arg[35];
    
read_argv(1arg31);
    new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY);
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    if(!
g_Muted[player])
    {
        
client_print(idprint_console"!g[GAG] !tClient was not muted!");
        return 
PLUGIN_HANDLED;
    }
    
    new 
name_a[32], name_p[32];
    new 
authid_a[35], authid_p[35];
    
get_user_name(idname_a31);
    
get_user_name(playername_p31);
    
get_user_authid(idauthid_a35);
    
get_user_authid(idauthid_p35);
    
deletei(name_pg_MutedTag);
    
show_activity(idname_a"unmuted %s!"name_p);
    
log_amx("%s <%s> unmuted %s <%s>"name_aauthid_aname_pauthid_p);
    
    
g_AllowNameChange[player] = true;
    
set_user_name(playername_p);
    
    
g_Muted[player] = false;
    
g_MutedTime[player] = 0.0;
    if(
task_exists(player 223344))
        
remove_task(player 223344);
    
    return 
PLUGIN_HANDLED;
}

public 
clcmd_Say(id)
{
    return 
g_TextGagged[id] ? PLUGIN_HANDLED PLUGIN_CONTINUE;
}

public 
task_UngagPlayer(id)
{
    
id -= 112233;
    
    new 
name[32];
    
get_user_name(idname31);
    
client_print(0print_chat"!g[GAG] !t%s is now ungagged!"name);
    
    
g_TextGagged[id] = false;
    
g_TextGagTime[id] = 0.0;
}

public 
task_UnmutePlayer(id)
{
    
id -= 223344;
    
    new 
name[32];
    
get_user_name(idname31);
    
client_print(0print_chat"!g[GAG] !t%s is now unmuted!"name);
    
    
g_Muted[id] = false;
    
g_MutedTime[id] = 0.0;
}

set_user_name(id, const name[])
{
    
set_user_info(id"name"name);
    
client_cmd(id"name ^"%s^""name);
}

deletei(text[], const what[])
{
    new 
pos containi(textwhat);
    new 
leni;
    while(
pos >= 0)
    {
        
len strlen(what);
        
0;
        while(
text[pos+len+i] != 0)
        {
            
text[pos+i] = text[pos+len+i];
            
i++;
        }
        
text[pos+i] = '^0';
        
pos containi(textwhat);
    }
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 
SHIFT0 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Algeria
Old 11-04-2021 , 08:53   Solved: AMXX GAG Color Chat
Reply With Quote #16

Done this is Solved.
SHIFT0 is offline
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 11-04-2021 , 11:51   Re: AMXX GAG Color Chat
Reply With Quote #17

Hmm yes but i do not see that u colored the chat, no ?

Put this at the end.
instead
PHP Code:
client_print(idprint_chat""); 
use this
PHP Code:
ColorChat(id"The text that u want to add"); 

Code:
stock ColorChat(const id, const input[], any:...) 
{
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	replace_all(msg, 190, "!g", "^4"); // Green
	replace_all(msg, 190, "!n", "^1"); // Yellow
	replace_all(msg, 190, "!t", "^3"); // Team
	
	if(id) players[0] = id;
	else get_players(players, count, "ch"); 
	{
		for(new i = 0; i < count; i++) 
		{
			if(is_user_connected(players[i])) 
			{
				message_begin(MSG_ONE_UNRELIABLE, MSGID_SayText, _, players[i]);
				write_byte(players[i]);
				write_string(msg);
				message_end();
			}
		}
	} 
}
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>

Last edited by Yusochan; 11-04-2021 at 11:52.
Yusochan is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Algeria
Old 11-04-2021 , 12:43   Re: AMXX GAG Color Chat
Reply With Quote #18

Yup Ty Done !
Worked
Send me ur discord
SHIFT0 is offline
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 11-04-2021 , 13:35   Re: AMXX GAG Color Chat
Reply With Quote #19

Quote:
Originally Posted by SHIFT0 View Post
Yup Ty Done !
Worked
Send me ur discord
Discord : YusoChan-#0266
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>
Yusochan is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-04-2021 , 13:42   Re: AMXX GAG Color Chat
Reply With Quote #20

I helped this guy out on Discord, that's why there's no solution on here. Answers have been given multiple times on what to do, so posting the full code again would be overkill imo.

What i did is simple: Gave him the cromchat.inc file, added one line in his code that displays the message.
__________________

Last edited by Napoleon_be; 11-04-2021 at 13:43.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 04:01.


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