Team Flag Reset

Expand and mod your server.
Post Reply
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Team Flag Reset

Post by LouMan » Wed Jan 03, 2007 9:28 pm

teamflagreset plugin

Author: LouMan
Description: See below.
Min Version: Latest CVS 2.0 branch code (to compile), bzfs 2.0.8

** NOTE: the plugin is committed to CVS; can be obtained there.

Description:

This is the teamflagreset plugin. It will look at the team flags and see if they have been held by a player and dropped - if so, it will start timing to a limit. If the flag is not picked up again within that time limit the team flag will reset with a message saying which team flag sat idle too long. It will also automatically disable itself for teams with no players and for only 1 team in the match (no opposing teams).

There are 4 administrator commands available with the plugin:

"flagidletime m" this will set timer interval for checking idle flags to m minutes (1-120).

"flagidletimeoff" this will disable the timer.

"flagidletimeon" this will enable the timer.

"flagidletimestatus" this will return the status of the timer (enabled or disabled and time interval).

The plugin will also allow the time limit to be passed to it through the -loadplugin command line with bzfs. The format is as follows:

"-loadplugin <path>teamflagreset,m" where m is the timer value (in minutes) for timed ctf. For example,

"-loadplugin plugins/teamflagreset,2" would start the plugin with the timer set for 2 minutes. Again, the minimum is 1 minute and the maximum is 120 minutes. If no time is specified, the plugin defaults to 5 minutes.
Last edited by LouMan on Wed Jan 31, 2007 8:52 pm, edited 8 times in total.

User avatar
CannonBallGuy
Private First Class
Private First Class
Posts: 2083
Joined: Wed Apr 12, 2006 1:31 am
Contact:

Post by CannonBallGuy » Wed Jan 03, 2007 9:43 pm

I'm not sure if this is much use, but an admin can reset an individual team flag with:
/flag reset R*
for a red flag, for example.

There may be a way to do such a thing in the API.
Image

Merry Christmas!

"Look, if I don't buy booze for the kids, I don't get any incriminating pictures to show to their parents, my business goes down the sink, my girlfriend leaves me and the baby goes on ebay. So help me search..."

"go Play With Toys urself in a dark alley u donkey ******" - Lt-Kirby2007

User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan » Wed Jan 03, 2007 11:19 pm

Not that I am aware of. The documented flag functions are:

BZF_API bool bz_removePlayerFlag ( int playeID );
Removes (zaps) the flag carried by the specified player

BZF_API void bz_resetFlags ( bool onlyUnused );
Removes (zaps) all flags on the map, exactly the same as the /flag reset command

User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan » Tue Jan 09, 2007 3:32 am

Original post updated with new version (2.0) - see description above.

User avatar
Zelgadis
Private First Class
Private First Class
Posts: 638
Joined: Sat Jul 02, 2005 2:31 pm
Location: European Union

Post by Zelgadis » Tue Jan 09, 2007 9:23 am

nice idea, i like it :)
Want to improve your skill? Join the http://guleague.org!

User avatar
macsforme
General
General
Posts: 2033
Joined: Wed Mar 01, 2006 5:43 am

Re: Team Flag Reset

Post by macsforme » Tue Jan 09, 2007 11:45 pm

LouMan wrote:There are 5 administrator commands available with the plugin:

"flagidletime m" this will set timer interval for checking idle flags to m minutes (1-120).

"flagidletimeoff" this will disable the timer.

"flagidletimeon" this will enable the timer.

"flagidletimestatus" this will return the status of the timer (enabled or disabled and time interval).
Perhaps you deleted a command... but is that not only four commands, rather than five?

User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan » Wed Jan 10, 2007 2:04 am

oops :oops: thanks!

User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan » Fri Jan 26, 2007 10:53 pm

This plugin has been upgraded to version 2.1

JeffM2501 added capability to individually reset flags to the API, so I modified code such that only the team flag that sits idle too long resets, instead of a general flag reset.

To use this plugin, you must obtain the latest CVS 2.0 branch code and compile a new bzfs application (and of course the plugin) with this latest branch code.

Post Reply