This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

AMXX Gag v1.4.9 - Menu, Reconnect support


Post New Thread Reply   
 
Thread Tools Display Modes
Kryzu
Senior Member
Join Date: Feb 2009
Old 09-07-2009 , 09:15   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #61

The plugin saves the gagged players STEAMID for gagged_time. So even if he disconnects and connects back after 5 minutes he is still gagged(default gag time is 10minutes)


LOOKING for menu
__________________

Last edited by Kryzu; 09-07-2009 at 09:16. Reason: LOOKING for menu:)
Kryzu is offline
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 09-07-2009 , 12:37   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #62

Quote:
Originally Posted by mplayerexe View Post
1. i mean if player write "disconnect" and "connect server" again.. not if he write "retry"

thx
That doesn't matter.
__________________
Bollnas Team - HideNSeek

See all of Bollnas Team's HideNSeek
servers at
http://bollnasteam.se/!

LaineN is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-07-2009 , 13:24   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #63

"Retry" was just an example to explain that it works if players leave and come back, not to say it only works for "retry" command.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-07-2009 , 14:25   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #64

This plugin is well done.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Glist3r
Senior Member
Join Date: Feb 2008
Old 09-13-2009 , 04:31   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #65

Quote:
L 09/13/2009 - 10:409: [AMXX] Displaying debug trace (plugin "amx_gag.amxx")
L 09/13/2009 - 10:409: [AMXX] Run time error 10: native error (native "set_speak")
L 09/13/2009 - 10:409: [AMXX] [0] 48660.attach::client_authorized (line 55)
L 09/13/2009 - 10:409: [ENGINE] Invalid player 24
L 09/13/2009 - 10:409: [AMXX] Displaying debug trace (plugin "amx_gag.amxx")
L 09/13/2009 - 10:409: [AMXX] Run time error 10: native error (native "set_speak")
L 09/13/2009 - 10:409: [AMXX] [0] 48660.attach::client_authorized (line 55)
__________________
Help me with these requests, please!
http://forums.alliedmods.net/showthread.php?t=85287

Glist3r is offline
arnaldo_silva
Member
Join Date: Jun 2008
Old 09-13-2009 , 10:23   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #66

hum and if you put like a vote.

So like amx_votekick how about amx_votegag ?
__________________

arnaldo_silva is offline
Old 09-13-2009, 11:12
fruktkak
This message has been deleted by Roach.
Old 09-13-2009, 11:19
fruktkak
This message has been deleted by Roach.
Glist3r
Senior Member
Join Date: Feb 2008
Old 09-13-2009 , 16:59   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #67

Quote:
L 09/13/2009 - 10:409: [AMXX] Displaying debug trace (plugin "amx_gag.amxx")
L 09/13/2009 - 10:409: [AMXX] Run time error 10: native error (native "set_speak")
L 09/13/2009 - 10:409: [AMXX] [0] 48660.attach::client_authorized (line 55)
L 09/13/2009 - 10:409: [ENGINE] Invalid player 24
L 09/13/2009 - 10:409: [AMXX] Displaying debug trace (plugin "amx_gag.amxx")
L 09/13/2009 - 10:409: [AMXX] Run time error 10: native error (native "set_speak")
L 09/13/2009 - 10:409: [AMXX] [0] 48660.attach::client_authorized (line 55)
Why do I get this?
__________________
Help me with these requests, please!
http://forums.alliedmods.net/showthread.php?t=85287

Glist3r is offline
dorin2oo7
Senior Member
Join Date: Jun 2008
Location: Sibiu, Romania
Old 09-14-2009 , 00:25   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #68

Quote:
Originally Posted by Glist3r View Post
Why do I get this?
I tested with the following script and works fine for me:

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

#define DEFAULT_TIME 600.0 // In Seconds

enum ( <<= ) {
    
GAG_CHAT 1,
    
GAG_TEAMSAY,
    
GAG_VOICE
};

enum _:GagData {
    
GAG_AUTHID20 ],
    
GAG_TIME,
    
GAG_START,
    
GAG_FLAGS
};

new 
g_szAuthid33 ][ 20 ];
new 
g_iThinkerg_iGagged;
new 
Trie:g_tArrayPos, Array:g_aGagData;

public 
plugin_init( ) {
    
register_plugin"AMXX Gag""1.1""xPaw & Exolent" );
    
    
register_clcmd"say",        "CmdSay" );
    
register_clcmd"say_team",   "CmdTeamSay" );
    
    
register_concmd"amx_gag",   "CmdGagPlayer",   ADMIN_KICK"<nick or #userid> <time> <a|b|c>" );
    
register_concmd"amx_ungag""CmdUnGagPlayer"ADMIN_KICK"<nick or #userid>" );
    
    
register_messageget_user_msgid"SayText" ), "MessageSayText" );
    
    new 
szClassname[ ] = "gag_thinker";
    
    
register_thinkszClassname"FwdThink" );
    
    
g_tArrayPos TrieCreate( );
    
g_aGagData  ArrayCreateGagData );
    
    
g_iThinker  create_entity"info_target" );
    
entity_set_stringg_iThinkerEV_SZ_classnameszClassname );
}

public 
plugin_end( ) {
    
TrieDestroyg_tArrayPos );
    
ArrayDestroyg_aGagData );
}

public 
client_authorizedid ) {
    
get_user_authididg_szAuthidid ], 19 );
    
    if( 
CheckGagFlagidGAG_VOICE ) )
        
set_speakidSPEAK_MUTED );
}

public 
client_disconnectid ) {
    if( 
TrieKeyExistsg_tArrayPosg_szAuthidid ] ) ) {
        static 
szName32 ];
        
get_user_nameidszName31 );
        
        static 
iPlayers32 ], iNumid;
        
get_playersiPlayersiNum"ch" );
        
        for( new 
iiNumi++ ) {
            
id iPlayers];
            
            if( 
get_user_flagsid ) & ADMIN_KICK )
                
client_printidprint_chat"[AMXX] Gagged player ^"%s<%s>^" has disconnected!"szNameg_szAuthidid ] );
        }
    }
    
    
g_szAuthidid ][ ] = '^0';
}

public 
client_infochangedid ) {
    if( !
CheckGagFlagid, ( GAG_CHAT GAG_TEAMSAY ) ) )
        return;
    
    static const 
name[ ] = "name";
    
    static 
szNewName32 ], szOldName32 ];
    
get_user_infoidnameszNewName31 );
    
get_user_nameidszOldName31 );
    
    if( !
equalszNewNameszOldName ) ) {
        
client_printidprint_chat"[AMXX] Gagged players cannot change their names!" );
        
        
set_user_infoidnameszOldName );
    }
}

public 
MessageSayTextiMsgIdiDestiReceiver ) {
    static const 
Cstrike_Name_Change[ ] = "#Cstrike_Name_Change";
    
    static 
szMessagesizeofCstrike_Name_Change ) + ];
    
get_msg_arg_string2szMessagesizeofszMessage ) - );
    
    if( 
equalszMessageCstrike_Name_Change ) ) {
        static 
szName32 ], id;
        for( new 
3<= 4i++ ) {
            
get_msg_arg_stringiszName31 );
            
            
id get_user_indexszName );
            
            if( 
is_user_connectedid ) ) {
                if( 
CheckGagFlagid, ( GAG_CHAT GAG_TEAMSAY ) ) )
                    return 
PLUGIN_HANDLED;
                
                break;
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
FwdThinkiEntity ) {
    if( !
g_iGagged )
        return;
    
    new 
Float:fGametime;
    
fGametime get_gametime( );
    
    new 
dataGagData ], idszName32 ];
    for( new 
0g_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
        if( ( 
Float:dataGAG_START ] + Float:dataGAG_TIME ] - 0.5 ) <= fGametime ) {
            
id find_player"c"dataGAG_AUTHID ] );
            
            if( 
is_user_connectedid ) ) {
                
get_user_nameidszName31 );
                
                
client_print0print_chat"[AMXX] Player ^"%s^" is no longer gagged."szName );
            }
            
            
DeleteGag);
            
            
i--;
        }
    }
    
    if( !
g_iGagged )
        return;
    
    new 
Float:flNextTime 999999.9;
    for( new 
0g_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
        
flNextTime floatminflNextTimeFloat:dataGAG_START ] + Float:dataGAG_TIME ] );
    }
    
    
entity_set_floatiEntityEV_FL_nextthinkflNextTime );
}

public 
CmdSayid 
    return 
CheckSayid);

public 
CmdTeamSayid 
    return 
CheckSayid);

CheckSayidbTeam ) {
    static 
iArrayPos;
    if( 
TrieGetCellg_tArrayPosg_szAuthidid ], iArrayPos ) ) {
        static 
dataGagData ];
        
ArrayGetArrayg_aGagDataiArrayPosdata );
        
        static const 
iFlags[ ] = { GAG_CHATGAG_TEAMSAY };
        
        if( 
dataGAG_FLAGS ] & iFlagsbTeam ] ) {
            static const 
szTeam[ ][ ] = { """ team" };
            
client_printidprint_center"** You are gagged from%s chat! **"szTeambTeam ] );
            
            
PrintLeftTimeidFloat:dataGAG_TIME ], Float:dataGAG_START ] );
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

PrintLeftTimeidFloat:flGagTimeFloat:flGaggedAt ) {
    new 
szInfo32 ], iLeniTime floatround( ( flGaggedAt flGagTime ) - get_gametime( ) ), iMinutes iTime 60iSeconds iTime 60;
    
    if( 
iMinutes )
        
iLen formatexszInfo31"%i minute%s"iMinutesiMinutes == "" "s" );
    if( 
iSeconds )
        
formatexszInfoiLen ], 31 iLen"%s%i second%s"iLen " and " ""iSecondsiSeconds == "" "s" );
    
    
client_printidprint_chat"[AMXX] %s left before your ungag!"szInfo );
}

public 
CmdGagPlayeridiLeveliCid ) {
    if( !
cmd_accessidiLeveliCid) ) {
        
console_printid"Flags: a - Chat | b - Team Chat | c - Voice communications" );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szArg32 ];
    
read_argv1szArg31 );
    
    new 
iPlayer cmd_targetidszArgCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS );
    
    if( !
iPlayer )
        return 
PLUGIN_HANDLED;
    
    new 
szName20 ];
    
get_user_nameiPlayerszName19 );
    
    if( 
TrieKeyExistsg_tArrayPosg_szAuthidiPlayer ] ) ) {
        
console_printid"User ^"%s^" is already gagged!"szName );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szFlags], Float:flGagTime;
    
read_argv2szArg31 );
    
    if( !
szArg] ) { // No time entered
        
flGagTime DEFAULT_TIME;
        
        
formatexszFlags3"abc" );
    } else {
        if( 
is_str_numszArg ) ) { // Seconds entered
            
flGagTime floatstrszArg );
            
            if( 
flGagTime 86400.0 )
                
flGagTime 86400.0;
        } else {
            
console_printid"The value must be in seconds!" );
            
            return 
PLUGIN_HANDLED;
        }
        
        
read_argv3szArg31 );
        
        if( !
szArg] ) // No flag entered
            
formatexszFlags3"abc" );
        else
            
formatexszFlags3szArg );
    }
    
    new 
iFlags read_flagsszFlags );
    
    new 
dataGagData ];
    
dataGAG_START ] = _:get_gametime( );
    
dataGAG_TIME ] = _:flGagTime;
    
dataGAG_FLAGS ] = iFlags;
    
copydataGAG_AUTHID ], 19g_szAuthidiPlayer ] );
    
    
TrieSetCellg_tArrayPosg_szAuthidiPlayer ], g_iGagged );
    
ArrayPushArrayg_aGagDatadata );
    
    new 
szFrom64 ];
    
    if( 
iFlags GAG_CHAT )
        
formatexszFrom63"say" );
    
    if( 
iFlags GAG_TEAMSAY ) {
        if( !
szFrom] )
            
formatexszFrom63"say_team" );
        else
            
formatszFrom63"%s / say_team"szFrom );
    }
    
    if( 
iFlags GAG_VOICE ) {
        
set_speakiPlayerSPEAK_MUTED );
        
        if( !
szFrom] )
            
formatexszFrom63"voicecomm" );
        else
            
formatszFrom63"%s / voicecomm"szFrom );
    }
    
    
g_iGagged++;
    
    new 
Float:flGametime get_gametime( ), Float:flNextThink;
    
flNextThink entity_get_floatg_iThinkerEV_FL_nextthink );
    
    if( !
flNextThink || flNextThink > ( flGametime flGagTime ) )
        
entity_set_floatg_iThinkerEV_FL_nextthinkflGametime flGagTime );
    
    new 
szInfo32 ], szAdmin20 ], iTime floatroundflGagTime ), iMinutes iTime 60iSeconds iTime 60;
    
get_user_nameidszAdmin19 );
    
    if( !
iMinutes )
        
formatexszInfo31"%i second%s"iSecondsiSeconds == "" "s" );
    else
        
formatexszInfo31"%i minute%s"iMinutesiMinutes == "" "s" );
    
    
show_activityidszAdmin"Has gagged %s from speaking for %s! (%s)"szNameszInfoszFrom );
    
    
console_printid"You have gagged ^"%s^" (%s) !"szNameszFrom );
    
    
log_amx"Gag: ^"%s<%s>^" has gagged ^"%s<%s>^" for %i minutes. (%s)"szAdming_szAuthidid ], szNameg_szAuthidiPlayer ], floatroundflGagTime 60 ), szFrom );
    
    return 
PLUGIN_HANDLED;
}

public 
CmdUnGagPlayeridiLeveliCid ) {
    if( !
cmd_accessidiLeveliCid) )
        return 
PLUGIN_HANDLED;
    
    new 
szArg32 ];
    
read_argv1szArg31 );
    
    if( 
equaliszArg"@all" ) ) {
        if( !
g_iGagged ) {
            
console_printid"No gagged players!" );
            
            return 
PLUGIN_HANDLED;
        }
        
        while( 
g_iGagged DeleteGag); // Excellent by Exolent
        
        
if( entity_get_floatg_iThinkerEV_FL_nextthink ) > 0.0 )
            
entity_set_floatg_iThinkerEV_FL_nextthink0.0 );
        
        
console_printid"You have ungagged all players!" );
        
        new 
szAdmin32 ];
        
get_user_nameidszAdmin31 );
        
        
show_activityidszAdmin"Has ungagged all players." );
        
        
log_amx"UnGag: ^"%s<%s>^" has ungagged all players."szAdming_szAuthidid ] );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
iPlayer cmd_targetidszArgCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS );
    
    if( !
iPlayer )
        return 
PLUGIN_HANDLED;
    
    new 
szName32 ];
    
get_user_nameiPlayerszName31 );
    
    new 
iArrayPos;
    if( !
TrieGetCellg_tArrayPosg_szAuthidiPlayer ], iArrayPos ) ) {
        
console_printid"User ^"%s^" is not gagged!"szName );
        
        return 
PLUGIN_HANDLED;
    }
    
    
DeleteGagiArrayPos );
    
    new 
szAdmin32 ];
    
get_user_nameidszAdmin31 );
    
    
show_activityidszAdmin"Has ungagged %s."szName );
    
    
console_printid"You have ungagged ^"%s^" !"szName );
    
    
log_amx"UnGag: ^"%s<%s>^" has ungagged ^"%s<%s>^""szAdming_szAuthidid ], szNameg_szAuthidiPlayer ] );
    
    return 
PLUGIN_HANDLED;
}

CheckGagFlag( const id, const iFlag ) {
    static 
iArrayPos;
    if( 
TrieGetCellg_tArrayPosg_szAuthidid ], iArrayPos ) ) {
        static 
dataGagData ];
        
ArrayGetArrayg_aGagDataiArrayPosdata );
        
        return ( 
dataGAG_FLAGS ] & iFlag );
    }
    
    return 
0;
}

DeleteGagiArrayPos ) {
    static 
dataGagData ];
    
ArrayGetArrayg_aGagDataiArrayPosdata );
    
    if( 
dataGAG_FLAGS ] & GAG_VOICE ) {
        new 
iPlayer find_player"c"dataGAG_AUTHID ] );
        if( 
is_user_connectediPlayer ) )
            
set_speakiPlayerSPEAK_NORMAL );
    }
    
    
TrieDeleteKeyg_tArrayPosdataGAG_AUTHID ] );
    
ArrayDeleteItemg_aGagDataiArrayPos );
    
g_iGagged--;
    
    for( new 
iArrayPosg_iGaggedi++ ) {
        
ArrayGetArrayg_aGagDataidata );
        
TrieSetCellg_tArrayPosdataGAG_AUTHID ], );
    }

__________________
dorin2oo7 is offline
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 09-14-2009 , 19:41   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #69

nice

any chance too save mutes even after mapchanges?

Last edited by Ejziponken; 09-14-2009 at 21:04.
Ejziponken is offline
blue2kx
Member
Join Date: Mar 2009
Old 09-19-2009 , 19:21   Re: AMXX Gag v1.1 [ Retry support ]
Reply With Quote #70

Hey, is it just me or when I gag someone, it doesn't always work. Also, when they disconnect, it shows my steamID instead of theirs
__________________
boohoo
blue2kx is offline
Reply



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 01:32.


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