AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Limted admin Slap / Slay / Ban / Kick (https://forums.alliedmods.net/showthread.php?t=78035)

Kitami 09-26-2008 07:36

Limted admin Slap / Slay / Ban / Kick
 
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.

grimvh2 09-26-2008 16:03

Re: Limtied admin Slap / Slay / Ban / Kick
 
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 .

Kitami 10-06-2008 18:16

Re: Limtied admin Slap / Slay / Ban / Kick
 
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 :)

Lee 10-06-2008 20:31

Re: Limtied admin Slap / Slay / Ban / Kick
 
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; }

Kitami 12-08-2008 04:29

Re: Limtied admin Slap / Slay / Ban / Kick
 
thanks so much lee, so whats the delay time between bans? or how many per seconds etc.

Kitami 12-08-2008 04:32

Re: Limtied admin Slap / Slay / Ban / Kick
 
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(18) : erro
r 029: invalid expression, assumed zero
// M:\meta.amxx\amxmodx-1.8.1-base\addons\amxmodx\scripting\limit.sma(18) : 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
// ----------------------------------------

SnoW 12-08-2008 06:03

Re: Limtied admin Slap / Slay / Ban / Kick
 
http://forums.alliedmods.net/showthr...9261&highlight

Lee 12-13-2008 12:15

Re: Limtied admin Slap / Slay / Ban / Kick
 
1 Attachment(s)
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.

danielkza 12-13-2008 12:52

Re: Limtied admin Slap / Slay / Ban / Kick
 
Quote:

Originally Posted by SnoW (Post 724160)

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

Kitami 12-20-2008 00:50

Re: Limtied admin Slap / Slay / Ban / Kick
 
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 :)


All times are GMT -4. The time now is 23:10.

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