Raised This Month: $32 Target: $400
 8% 

Auto-Ban after reaching a frag limit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 07-12-2020 , 13:40   Auto-Ban after reaching a frag limit
Reply With Quote #1

Hello Everyone!

Can some one share a plugin which automatically bans a player (not admin, admins with a specific flag will not get banned by the plugin say ADMIN_ACCESS 'B') when the player reaches the flag limit?

Like When a player reaches 50 limit, he will get banned for some hours say 1-2 hours.
This plugin won't affect admin if they have a specific flag.

Also IF POSSIBLE, can we make 2 cvars with :
flag_limit: maximum number of flags after that non-admin player will get auto ban.
ban_time: number of hours for which the person will get banned.

Thanks for the help.
I have already considered few posts on these forums but didn't got what I want. Also their was some bugs in these codes and that posts were quite earlier (say 2006) so no one would like to continue.

Thanks!
__________________
SELLING COUNTER STRIKE SERVERS!! [email protected]

Website: https://namanvrati.cf/
Cheap Rates/ Renting also available.
Introducing myself: This is Naman Vrati, call me NamVr! I am a web developer and Counter Strike Server Manager, I own a server.

Piano Is My Life
allroundernaman is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 07-12-2020 , 14:15   Re: Auto-Ban after reaching a frag limit
Reply With Quote #2

Do you have amxbans?
4ever16 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-12-2020 , 14:26   Re: Auto-Ban after reaching a frag limit
Reply With Quote #3

Remind me again what is the point of this plugin?
Set the ban command on line 10.

Code:
#include <amxmodx> #if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif new g_pFragLimit, g_iFragLimit new g_pAdminFlag, g_iAdminFlag // Modify the ban command to your needs // Default: amx_ban <minutes> <userid> <reason> #define BAN_COMMAND "amx_ban 120 #%i ^"frag limit reached^"" new g_iFrags[MAX_PLAYERS + 1] public plugin_init() {     register_plugin("Frag Limit Ban", "1.1", "OciXCrom")     register_event("DeathMsg", "OnPlayerKilled", "a")     g_pFragLimit = register_cvar("flb_frag_limit", "50")     g_pAdminFlag = register_cvar("flb_admin_flag", "s") } public plugin_cfg() {     g_iFragLimit = get_pcvar_num(g_pFragLimit)     new szFlag[2]     get_pcvar_string(g_pAdminFlag, szFlag, charsmax(szFlag))     g_iAdminFlag = read_flags(szFlag) } public client_putinserver(id) {     g_iFrags[id] = 0 } public OnPlayerKilled() {     new iAttacker = read_data(1)     if(is_user_connected(iAttacker) && iAttacker != read_data(2) && !(get_user_flags(iAttacker) & g_iAdminFlag))     {         if(++g_iFrags[iAttacker] == g_iFragLimit)         {             server_cmd(BAN_COMMAND, get_user_userid(iAttacker))         }     } }
__________________

Last edited by OciXCrom; 07-19-2020 at 07:58.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 07-14-2020 , 13:14   Re: Auto-Ban after reaching a frag limit
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Remind me again what is the point of this plugin?
Set the ban command on line 10.

Code:
#include <amxmodx> #if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif const FRAG_LIMIT = 50 // Modify the ban command to your needs // Default: amx_ban <minutes> <userid> <reason> #define BAN_COMMAND "amx_ban 120 #%i ^"frag limit reached^"" new g_iFrags[MAX_PLAYERS + 1] public plugin_init() {     register_plugin("Frag Limit Ban", "1.0", "OciXCrom")     register_event("DeathMsg", "OnPlayerKilled", "a") } public client_putinserver(id) {     g_iFrags[id] = 0 } public OnPlayerKilled() {     new iAttacker = read_data(1)     if(is_user_connected(iAttacker) && iAttacker != read_data(2))     {         if(++g_iFrags[iAttacker] == FRAG_LIMIT)         {             server_cmd(BAN_COMMAND, get_user_userid(iAttacker))         }     } }
Thanks for this. But I would like to ask you that does this ban admins too? As I was a admin I was banned. Is your plugin banning admins too? Thanks for the help.
Also if this is made not to ban admins, let me know I will check what's wrong with my users.ini file.

Regards,
__________________
SELLING COUNTER STRIKE SERVERS!! [email protected]

Website: https://namanvrati.cf/
Cheap Rates/ Renting also available.
Introducing myself: This is Naman Vrati, call me NamVr! I am a web developer and Counter Strike Server Manager, I own a server.

Piano Is My Life
allroundernaman is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-14-2020 , 14:01   Re: Auto-Ban after reaching a frag limit
Reply With Quote #5

I edited the code.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 07-14-2020, 14:49
allroundernaman
This message has been deleted by allroundernaman. Reason: Solved My Issue
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 07-14-2020 , 15:19   Re: Auto-Ban after reaching a frag limit
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
I edited the code.
Really thanks. Can you teach me how can I convert these variables into cvars?
As I mentioned in the question?
__________________
SELLING COUNTER STRIKE SERVERS!! [email protected]

Website: https://namanvrati.cf/
Cheap Rates/ Renting also available.
Introducing myself: This is Naman Vrati, call me NamVr! I am a web developer and Counter Strike Server Manager, I own a server.

Piano Is My Life
allroundernaman is offline
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 07-18-2020 , 07:10   Re: Auto-Ban after reaching a frag limit
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
I edited the code.
Thanks but in my testing, it didn't did the work what actually I wanted.
It's just blank.
__________________
SELLING COUNTER STRIKE SERVERS!! [email protected]

Website: https://namanvrati.cf/
Cheap Rates/ Renting also available.
Introducing myself: This is Naman Vrati, call me NamVr! I am a web developer and Counter Strike Server Manager, I own a server.

Piano Is My Life
allroundernaman is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-18-2020 , 07:37   Re: Auto-Ban after reaching a frag limit
Reply With Quote #8

What's blank?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 07-18-2020 , 08:34   Re: Auto-Ban after reaching a frag limit
Reply With Quote #9

I mean the plugin is not working.
All modules enabled,
Plugin is enabled via plugins.ini also

My friend reached 10+ in testing but he was not banned.
__________________
SELLING COUNTER STRIKE SERVERS!! [email protected]

Website: https://namanvrati.cf/
Cheap Rates/ Renting also available.
Introducing myself: This is Naman Vrati, call me NamVr! I am a web developer and Counter Strike Server Manager, I own a server.

Piano Is My Life
allroundernaman is offline
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 07-18-2020 , 08:37   Re: Auto-Ban after reaching a frag limit
Reply With Quote #10

Code:
#include <amxmodx> #if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif const FRAG_LIMIT = 10 const ADMIN_FLAG = ADMIN_LEVEL_G // Modify the ban command to your needs // Default: amx_ban <minutes> <userid> <reason> #define BAN_COMMAND "amx_ban 180 #%i ^"Frag Limit Over^"" new g_iFrags[MAX_PLAYERS + 1] public plugin_init() {     register_plugin("Frag Limit Ban", "1.1", "OciXCrom")     register_event("DeathMsg", "OnPlayerKilled", "a") } public client_putinserver(id) {     g_iFrags[id] = 0 } public OnPlayerKilled() {     new iAttacker = read_data(1)     if(is_user_connected(iAttacker) && iAttacker != read_data(2) && !(get_user_flags(iAttacker) & ADMIN_FLAG))     {         if(++g_iFrags[iAttacker] == FRAG_LIMIT)         {             server_cmd(BAN_COMMAND, get_user_userid(iAttacker))         }     } }

Here's the code I am using.
__________________
SELLING COUNTER STRIKE SERVERS!! [email protected]

Website: https://namanvrati.cf/
Cheap Rates/ Renting also available.
Introducing myself: This is Naman Vrati, call me NamVr! I am a web developer and Counter Strike Server Manager, I own a server.

Piano Is My Life

Last edited by allroundernaman; 07-18-2020 at 08:38.
allroundernaman 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 19:54.


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