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

CS 1.6 Ban Ct


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shyloo
Member
Join Date: Jan 2022
Old 03-26-2022 , 16:12   CS 1.6 Ban Ct
Reply With Quote #1

Howdy all , I'm looking for a plugin contain command "amx_banct" wich ban a player that on a Cts team , and for unban "amx_unbanct"
Shyloo is offline
Shyloo
Member
Join Date: Jan 2022
Old 04-01-2022 , 12:54   Re: CS 1.6 Ban Ct
Reply With Quote #2

BUMP
Shyloo is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-01-2022 , 13:48   Re: CS 1.6 Ban Ct
Reply With Quote #3

Quote:
Originally Posted by Shyloo View Post
Howdy all , I'm looking for a plugin contain command "amx_banct" wich ban a player that on a Cts team , and for unban "amx_unbanct"
I can create this but i dont understand how should amx_unbanct work, it should unban all players these are banned using amx_banct or unban all players or what!!
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 04-01-2022 , 14:06   Re: CS 1.6 Ban Ct
Reply With Quote #4

You don't need to create a ban system, just rip one thats already made and modify the command name, ban log file and add an if condition to check whether the player you're about to ban is a CT.
bigdaddy424 is offline
Shyloo
Member
Join Date: Jan 2022
Old 04-01-2022 , 15:17   Re: CS 1.6 Ban Ct
Reply With Quote #5

Quote:
Originally Posted by Supremache View Post
I can create this but i dont understand how should amx_unbanct work, it should unban all players these are banned using amx_banct or unban all players or what!!
it works with time , for example if i want ban someone from ct permanently , i write "amx_banct "name "0" for permanent time , and if i want to remove the ban ct from this player i write "amx_unbanct "name" that have been banned from ct
Shyloo is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-01-2022 , 15:33   Re: CS 1.6 Ban Ct
Reply With Quote #6

Quote:
Originally Posted by Shyloo View Post
it works with time , for example if i want ban someone from ct permanently , i write "amx_banct "name "0" for permanent time , and if i want to remove the ban ct from this player i write "amx_unbanct "name" that have been banned from ct
I will create a sub plugin using the current ban system that on your server 'client_cmd( "amx_ban .... )', but how should i unban 'CT' players, as you know banned players are not on the server so can't check them but if i created a file that save them data like steamid, ip, name so when using "amx_unbanct" will unban all players these are banned by that command.
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 04-01-2022 at 15:34.
Supremache is offline
Shyloo
Member
Join Date: Jan 2022
Old 04-01-2022 , 15:53   Re: CS 1.6 Ban Ct
Reply With Quote #7

Quote:
Originally Posted by Supremache View Post
I will create a sub plugin using the current ban system that on your server 'client_cmd( "amx_ban .... )', but how should i unban 'CT' players, as you know banned players are not on the server so can't check them but if i created a file that save them data like steamid, ip, name so when using "amx_unbanct" will unban all players these are banned by that command.
is there any possibility for unban someone fot CT by steam id , not unban all players at the same time

Last edited by Shyloo; 04-01-2022 at 16:08.
Shyloo is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-01-2022 , 16:23   Re: CS 1.6 Ban Ct
Reply With Quote #8

Quote:
Originally Posted by Shyloo View Post
is there any possibility for unban someone fot CT by steam id , not unban all players at the same time
how !!!, The player already banned how you can find him!

Try this
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #if !defined MAX_AUTHID_LENGTH const MAX_AUTHID_LENGTH = 64 #endif #if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif new Array:g_aBanTeam public plugin_init( ) {     register_plugin( "AMX Ban Team", "1.0", "Supremache" )     register_cvar("AMXBanTeam", "1.0", FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED )         g_aBanTeam = ArrayCreate( MAX_AUTHID_LENGTH );         register_concmd( "amx_banct", "@BanTeam");     register_concmd( "amx_bant", "@BanTeam" );     register_concmd( "amx_unbanct", "@UnBanTeam" );     register_concmd( "amx_unbant", "@UnBanTeam" ); } public plugin_end( ) {     ArrayDestroy( g_aBanTeam ); } @BanTeam( id ) {     new szCommand[ 10 ], szTeam[ 10 ], szValue[ 3 ], iPlayers[ MAX_PLAYERS ], iPnum;     read_argv( 0, szCommand, charsmax( szCommand ) )     read_argv( 1, szValue, charsmax( szValue ) )     copy( szTeam, charsmax( szTeam ), szCommand[ 7 ] == 'c' ? "CT" : "TERRORIST" )         get_players( iPlayers, iPnum, "e", szTeam )             for( new i, iPlayer; i < iPnum; i++ )     {         iPlayer = iPlayers[ i ];         client_cmd( id, "amx_ban ^"#%d^" ^"%i^"", get_user_userid( iPlayer ), str_to_num( szValue ) )         ReadFile( iPlayer, szTeam, 1 )         client_print( id, print_chat, "banned" )     }         return PLUGIN_HANDLED; } @UnBanTeam( id ) {         static szSteamID[ MAX_AUTHID_LENGTH ], szCommand[ 10 ], szTeam[ 10 ];     read_argv( 0, szCommand, charsmax( szCommand ) )     copy( szTeam, charsmax( szTeam ), szCommand[ 9 ] == 'c' ? "CT" : "TERRORIST" )         ReadFile( 0, szTeam )         for( new i; i < ArraySize( g_aBanTeam ); i++ )     {         ArrayGetString( g_aBanTeam, i, szSteamID, charsmax( szSteamID ) );                 client_cmd( id, "amx_unban ^"%s^"", szSteamID )         ReadFile( 0, szTeam, 2 )         client_print( id, print_chat, "unbanned" )     }         return PLUGIN_HANDLED; } ReadFile( id = -1, const szTeam[ ] = "", iType = 0) {     new szConfigs[ 64 ], szFile[ 96 ], szData[ MAX_AUTHID_LENGTH ], iFile;     get_configsdir( szConfigs, charsmax( szConfigs ) )     formatex( szFile, charsmax( szFile ), "%s/BanList_%s.ini", szConfigs, szTeam )         switch( iType )     {         case 0:         {             iFile = fopen( szFile, "rt" );                 if( iFile )             {                 while( fgets( iFile, szData, charsmax( szData ) ) )                 {                        trim( szData );                                      switch( szData[ 0 ] )                     {                         case EOS, ';', '#', '/': continue;                         default: ArrayPushString( g_aBanTeam, szData );                     }                 }                 fclose( iFile );             }         }                 case 1:         {             iFile = fopen( szFile, "wt")                     if( iFile && pev_valid( id ) )             {                       get_user_authid( id, szData, charsmax( szData ) )                 fprintf( iFile, "%s^n", szData )                 fclose( iFile );             }         }         case 2: delete_file( szConfigs );     } }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 04-03-2022 at 23:31.
Supremache is offline
Shyloo
Member
Join Date: Jan 2022
Old 04-03-2022 , 13:39   Re: CS 1.6 Ban Ct
Reply With Quote #9

Hi again , when i tried to compile it , i've found 6 errors :
i found 2 errors on the same line :
ArrayGetString( g_aBanTeam, i, szSteamID, charsmax(szSteamID));
and 4 errors on the same line 78 :
new szConfigs[ 64 ], szFile[ 96 ], szData[ MAX_AUTHID_LENGTH ], iFile
Shyloo is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-03-2022 , 16:40   Re: CS 1.6 Ban Ct
Reply With Quote #10

MAX_PLAYERS, MAX_AUTHID_LENGTH
try it now
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache 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 03:30.


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