PDA

View Full Version : Single Man Caps


Vet
05-12-2010, 01:09 AM
UPDATED 6-27-10

Inspired by THIS THREAD (http://www.dodplugins.net/forums/showthread.php?t=1941), I wrote this plugin.

This plugin will change the number required to cap an area based on the number of players currently in the game. The number of players trigger is variable via CVar. The trigger has a 'deadband' of 2. In other words, if the trigger is set to 5, it takes 4 or less players to turn ON single caps, and then 6 or more players to turn it back OFF. Setting the trigger to 0 turns OFF the auto-detect.

CVARs:
single_caps_trigger <#> (Number of players to trigger change - default 5, 0 = Disable)
single_caps_notify <0/1> (Display a message about the change? - default 1/ON)
single_caps_ignore_bots <0/1> (Don't count bots as players - default 0/Off)

Command:
dod_single_caps <on|off|auto> Set the plugin's mode of operation.
If ON, all caps are single, no matter what.
If OFF, cap are reset to normal
If AUTO (default), caps are dependent on trigger CVar

Revisions:
1.6 Added ability to ignore bots
1.5 Fixed announce of single-caps when only single-caps existed
1.4 Original release

The plugin is set to check the number of players and set/reset cap areas every 60 seconds.

UPDATED 6-27-10
-

Fysiks
05-12-2010, 03:43 AM
Cool!

format() ==> formatex()

=*MDMILBURN*=
05-16-2010, 01:19 AM
any way to add ignore bots? many maps don't have good way points if at all

Vet
05-26-2010, 08:49 PM
Recommended update. See first post.

bozdw
06-18-2010, 10:34 AM
hi
nice plugin
i have just tried it works well

is there any way i can ignore the bots because i have 6 bots, one real player on! one bot off! so always six players , so i set it to auto caps 5 players but with the bots it wont work
thanks boz

Vet
06-18-2010, 08:53 PM
The plugin could be modified to ignore bots, but I'm afraid of the overhead (in extra code) required to check for them. But I'll look into it.

bozdw
06-19-2010, 05:12 AM
ok many thanks

Vet
06-27-2010, 08:35 PM
Plugin updated to allow it to ignore bots. I was not able to do extensive testing so let me know if there's a problem.

bozdw
06-29-2010, 10:39 AM
fantastic i will give it a try

bozdw
07-02-2010, 07:04 AM
It seems to working very well
many thanks boz ;)

=*MDMILBURN*=
07-11-2010, 02:51 PM
from what i have seen it still includes the bots and i think the notify of the plug is not happening when i turn off bots the plug works and if another player then joins the notify works stating that the caps have been reset and that is the only notification i see

bozdw
07-12-2010, 07:40 AM
hi
ive had it on the server for some time now i have 6 bots running and it works fine telling me single caps enabled (takes about 60 seconds to enable after each map change) then when i have 4 real players it says single caps disabled or something like that
works a treat and there is some happy players who have commented on it

it could be this
dod_single_caps <on|off|auto> Set the plugin's mode of operation. STICK IT ON AUTO

Vet
07-12-2010, 10:30 AM
The option to ignore the bots is OFF by default. Be sure to include the CVar in a config file.

RichNagel
02-01-2012, 07:57 AM
Sorry to dig up this old thread.

I occasionally run a lowly listen server for me and my buddies to play on, along with SturmBots. I also play a LOT of "single-player" (if you could call it that) by starting a listen server, and then playing along with the SturmBots.

I recently installed a bare-bones version of AMXModX, along with this plugin -> http://www.dodplugins.net/forums/showthread.php?t=753 (a modified version of this plugin -> http://www.dodplugins.net/forums/showthread.php?t=294)... as well as the Single Man Caps plugin.

I am able to set all of the CVars, but anytime I attempt to change the plugin's operating mode like this:

dod_single_caps on
dod_single_capsoff
dod_single_capsauto

...I see the error message "Can't set DOD_SingleCaps in multiplayer".

Now, I'm no coder by ANY sense of the term, but I changed the following in the source (and then recompiled the plugin):

"FCVAR_SPONLY" (I removed that entry)

"ADMIN_MAP" (I changed to "ADMIN_ALL")

Now, I don't see that "Can't set DOD_SingleCaps in multiplayer" message anymore, but it doesn't appear that the "dod_single_caps on/off/auto" is doing anything... but rather staying in "auto" mode.

I am able to enable and disable it simply by setting "single_caps_trigger" to an extremely high number (which is sort of like "on" for the "dod_single_caps" command), or to a low number like "1" (which is sort of like "off" for the "dod_single_caps" command), but it would be super if the actual "dod_single_caps" console command would work for me :)

Anyhow, I was simply wondering if anyone knew what could cause this. I have a hunch that it has something to do with the "(cmd_access(id, lvl, cid, 2))" part of the source, but I really have know idea.

Vet
02-02-2012, 10:29 AM
Do other Amxmodx commands work the way their suppose to? I run this plugin a lot with Shrikebot and the commands all work just fine.