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

Limted admin Slap / Slay / Ban / Kick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 09-26-2008 , 07:36   Limted admin Slap / Slay / Ban / Kick
Reply With Quote #1

I've bad problems in the past when giving away admin on my server that some children would get upset and decided that it was there duty to ban everyone in the server before they left.

Now that doesn't happen anymore, but people still abuse the slay/slap/kick commands when I'm not around, I'm sure others have the same problem with their admins.

Basically I want a plugin that will limit admins from being able to slap/kick/slay/ban constantly. So an admin with flag "p" can only use those commands twice a minute. So 2 bans/slays/slaps/kicks per minute. This way if they want to ban everyone they have to wait 1 minute. It would be nice to have cvars for the amount of times an admin has and the time between the next period.


Idle would probably be 3Bans per 5 minutes. 5 Kicks per 5 minutes. 3 Slaps per minute. 1 Slay per minute.
__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.

Last edited by Kitami; 01-06-2009 at 13:19.
Kitami is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 09-26-2008 , 16:03   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #2

I "could" make this , but this problem wont appear when you only give admin to people you really know and trust . Ill see if I make it .
__________________
I am out of order!
grimvh2 is offline
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 10-06-2008 , 18:16   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #3

Well I mean Its happened to me even when admin was given to a select view people that where loyal / trust worthy but this is the internet and people do crazy things, so its better to be save then sorry you know what I mean?

Thanks for giving it a go
__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.
Kitami is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 10-06-2008 , 20:31   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #4

I don't think I need to reset the count when people disconnect. It rather depends on how high you set the cvars.

You need to place this plugin's file name above admincmd.amxx in plugins.ini.

Code:
#include <amxmodx> #pragma semicolon 1 #define SLAP 0 #define SLAY 1 #define KICK 2 #define BAN 3 new pcvars[4]; public plugin_init() {     register_plugin("Command Limits", "1.0", "Lee");         register_clcmd("amx_slap", "cmdSlap", ADMIN_LEVEL_D);     register_clcmd("amx_slay", "cmdSlay", ADMIN_LEVEL_D);     register_clcmd("amx_kick", "cmdKick", ADMIN_LEVEL_D);     register_clcmd("amx_ban", "cmdBan", ADMIN_LEVEL_D);         pcvars[SLAP] = register_cvar("amx_slap_usage", "30");     pcvars[SLAY] = register_cvar("amx_slay_usage", "30");     pcvars[KICK] = register_cvar("amx_kick_usage", "30");     pcvars[BAN] = register_cvar("amx_ban_usage", "30"); } public cmdSlap(playerID, accessLevel) {     return get_user_flags(playerID) & accessLevel ? canUseCommand(playerID, SLAP) : PLUGIN_CONTINUE; } public cmdSlay(playerID, accessLevel) {     return get_user_flags(playerID) & accessLevel ? canUseCommand(playerID, SLAY) : PLUGIN_CONTINUE; } public cmdKick(playerID, accessLevel) {     return get_user_flags(playerID) & accessLevel ? canUseCommand(playerID, KICK) : PLUGIN_CONTINUE; } public cmdBan(playerID, accessLevel) {     return get_user_flags(playerID) & accessLevel ? canUseCommand(playerID, BAN) : PLUGIN_CONTINUE; } canUseCommand(playerID, commandIssued) {     static lastUseTime[33][4];         new currentTime = get_systime();     new nextUse = lastUseTime[playerID][commandIssued] - currentTime + get_pcvar_num(pcvars[commandIssued]);         if(nextUse > 0)     {         client_print(playerID, print_console, "Error: You cannot use this command for another %d second%s.",             nextUse, nextUse > 1 ? "s" : "");                     return PLUGIN_HANDLED;     }         lastUseTime[playerID][commandIssued] = currentTime;         return PLUGIN_CONTINUE; }
__________________
No support via PM.
Lee is offline
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 12-08-2008 , 04:29   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #5

thanks so much lee, so whats the delay time between bans? or how many per seconds etc.
__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.
Kitami is offline
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 12-08-2008 , 04:32   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #6

Quote:
//// limit.sma
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(14) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(14) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(15) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(15) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(16) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(16) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(17) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(17) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(1 : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(1 : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(19) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(19) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(20) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(20) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(21) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(21) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(22) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(22) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(23) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(23) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(24) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(24) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(29) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(29) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(29) : warn
ing 215: expression has no effect
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(29) : erro
r 001: expected token: ";", but found "return"
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(29) : fata
l error 107: too many error messages on one line
//
// Compilation aborted.
// 26 Errors.
// Could not locate output file compiled\limit.amx (compile failed).
//
// Compilation Time: 0.06 sec
// ----------------------------------------
__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.
Kitami is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 12-08-2008 , 06:03   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #7

http://forums.alliedmods.net/showthr...9261&highlight
SnoW is offline
Send a message via MSN to SnoW
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 12-13-2008 , 12:15   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #8

There are four cvars, amx_slap_usage, amx_slay_usage, amx_kick_usage and amx_ban_usage that are all set to 30 (seconds) by default. There are no errors in my code; there is a Firefox bug that strips line breaks when copying the entirety of a code box. I've attached it for your convenience. Alternatively you could use the general purpose plugin SnoW posted.
Attached Files
File Type: sma Get Plugin or Get Source (icanhascommandlimiterplugin.sma - 832 views - 1.8 KB)
__________________
No support via PM.

Last edited by Lee; 12-13-2008 at 12:23.
Lee is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-13-2008 , 12:52   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #9

If you feel you need any extra features for it to fit your needs, ask and I'll implement them.
__________________

Community / No support through PM
danielkza is offline
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 12-20-2008 , 00:50   Re: Limtied admin Slap / Slay / Ban / Kick
Reply With Quote #10

Thanks so much its perfect and works perfectly. If there is anything I will surely give you a shout, do you mind looking at another post I made?

http://forums.alliedmods.net/showthread.php?t=75993

Thanks again
Much <3 sweety.

ps. may I suggest posting your code with PHP tags as that can be copied properly by Firefox
__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.

Last edited by Kitami; 12-20-2008 at 00:52.
Kitami 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 13:25.


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