Raised This Month: $7 Target: $400
 1% 

AMXX GAG Color Chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-01-2021 , 14:32   AMXX GAG Color Chat
Reply With Quote #1

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
yRemootz
Junior Member
Join Date: Aug 2021
Location: Sao Paulo, Brazil
Old 11-01-2021 , 18:56   Re: AMXX GAG Color Chat
Reply With Quote #2

Try:
PHP Code:
    client_print_color(0print_team_default"^4[GAG] A GAGGED & muted player has left! %s^1"name); // add the client_print_color and print_team_default for use ^3 
And another is:
PHP Code:
     client_print_color(idprint_team_default"^4[GAG]^1 ^3Client is already muted!^1"); 

Last edited by yRemootz; 11-01-2021 at 18:57.
yRemootz is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-02-2021 , 07:41   Re: AMXX GAG Color Chat
Reply With Quote #3

Bro i want see exemple when gagged someone
!g[GAG] !gADMIN !g%Name: !tGAGGED !yPlayer !yName !tFor !g%Time.
I want delete the mute

Last edited by SHIFT0; 11-02-2021 at 07:45. Reason: Failed
SHIFT0 is offline
yRemootz
Junior Member
Join Date: Aug 2021
Location: Sao Paulo, Brazil
Old 11-02-2021 , 14:43   Re: AMXX GAG Color Chat
Reply With Quote #4

Quote:
Originally Posted by SHIFT0 View Post
Bro i want see exemple when gagged someone
!g[GAG] !gADMIN !g%Name: !tGAGGED !yPlayer !yName !tFor !g%Time.
I want delete the mute
Try it:
PHP Code:
     client_print_color(idprint_team_default"^4[GAG]^1 ^4ADMIN^1 ^4%Name:^1 ^3GAGGED^1 Player Name ^3For^1 ^4%Time.^1"); 
yRemootz is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-02-2021 , 16:00   Re: AMXX GAG Color Chat
Reply With Quote #5

Ty Bro <3
SHIFT0 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-02-2021 , 16:04   Re: AMXX GAG Color Chat
Reply With Quote #6

Quote:
Originally Posted by yRemootz View Post
Try it:
PHP Code:
     client_print_color(idprint_team_default"^4[GAG]^1 ^4ADMIN^1 ^4%Name:^1 ^3GAGGED^1 Player Name ^3For^1 ^4%Time.^1"); 
bro where i can place this ?
can u place it in the PHP and send me it now pls ?
SHIFT0 is offline
yRemootz
Junior Member
Join Date: Aug 2021
Location: Sao Paulo, Brazil
Old 11-02-2021 , 16:13   Re: AMXX GAG Color Chat
Reply With Quote #7

Quote:
Originally Posted by SHIFT0 View Post
bro where i can place this ?
can u place it in the PHP and send me it now pls ?
Like you said, you need place it in the PHP Code.
yRemootz is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-02-2021 , 17:02   Re: AMXX GAG Color Chat
Reply With Quote #8

[SOLVED]
SHIFT0 is offline
yRemootz
Junior Member
Join Date: Aug 2021
Location: Sao Paulo, Brazil
Old 11-02-2021 , 18:26   Re: AMXX GAG Color Chat
Reply With Quote #9

Quote:
Originally Posted by SHIFT0 View Post
[SOLVED]
Change the prefix of the your Thread to Solved, if you don't know how do it, tell me and I'll explain for you.

Last edited by yRemootz; 11-02-2021 at 18:30.
yRemootz is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 11-02-2021 , 18:30   Re: AMXX GAG Color Chat
Reply With Quote #10

i will try xd
SHIFT0 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 07:45.


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