dod_weaponcontrol
by Hood [10th MD] · 2007-02-26 · 12 replies · 16501 views · 135 downloads
From the first post
nHas been fully tested (all features) on my own server.
nNow uses client disconnect and team messages as the events to check the restrictions.
nAlso, now uses pcvars, and includes new cvars for your convenience.
n
nNote: This plugin controls weapon limits for snipers and MGs by # of people in the server not percentages, etc. (like dod_limit)
n
nCvars:
ndod_wc_num <#> - # of people in server for sniper/mg to be allowed
ndod_wc_snipers <#> - # of snipers to allow per team (when correct # in server)
ndod_wc_mgs <#> - # of mgs to allow per team (when correct # in server)
ndod_wc_britheavy <1/0> - defines whether (1) or not (0) the Bren is considered an MG. If 0, the plugin ignores Bren, if 1, treats like MG.
n
nCommands:
ndod_wc_on <#> - sets # of people in server for weapons allowed, runs the check.
ndod_wc_check - runs check manually to adjust cvars, if you edit your settings middle game, and no one is going to connect or join, this will automatically adjust the cvars.
n
nTo Do: Resolve what happens when snipers allowed goes from 1 to 2 but already have 2 snipers - need to kick the person doing the worst from sniper. That'll be v 1.2
n
nThanks all.
The thread
All 13 posts from 6 people on dod_weaponcontrol, kept as they were written.
Threads: 7
Joined: Nov 2006
Ok, Updated to v 1.2nHas been fully tested (all features) on my own server.nNow uses client disconnect and team messages as the events to check the restrictions.nAlso, now uses pcvars, and includes new cvars for your convenience.nnNote: This plugin controls weapon limits for snipers and MGs by # of people in the server not percentages, etc. (like dod_limit)nnCvars:ndod_wc_num <#> - # of people in server for sniper/mg to be allowedndod_wc_snipers <#> - # of snipers to allow per team (when correct # in server)ndod_wc_mgs <#> - # of mgs to allow per team (when correct # in server)ndod_wc_britheavy <1/0> - defines whether (1) or not (0) the Bren is considered an MG. If 0, the plugin ignores Bren, if 1, treats like MG.nnCommands:ndod_wc_on <#> - sets # of people in server for weapons allowed, runs the check.ndod_wc_check - runs check manually to adjust cvars, if you edit your settings middle game, and no one is going to connect or join, this will automatically adjust the cvars.nnTo Do: Resolve what happens when snipers allowed goes from 1 to 2 but already have 2 snipers - need to kick the person doing the worst from sniper. That'll be v 1.2nnThanks all.
Threads: 12
Joined: Jul 2006
I've seen that here before. I've never used it though. But now that I see it again, maybe I should give it a try.
Threads: 57
Joined: Oct 2005
I believe this is covered in dod_limits by Zor ?rnhttps://www.dodplugins.net/forums/showthread.php?t=7
Threads: 12
Joined: Jul 2006
Ah yeah thats right. But Zor's plugin lets you limit all the weapons, not just those few.
Threads: 103
Joined: May 2005
not sure how this one works exactly..nnbut im pretty sure with zor's its a percentage thing.. and one thing i didnt like with zors was you couldnt specifiy more then one limit for a single class (like say a limit at 25% full and another at 50% full) ..you could only have one.. plus the whole percentage thing lol was throwing me off when i tried his..nnnand technically.. i guess you could do this same thing with zor's but i think this one is alot more simple for people who just want to turn off sniper/mg till a certain player count and not have to deal with config files and whatnot...nn__________________________________________________________n *edit*nnalso you should fix the compile warning...n
Warning: Function "checklimit" should return a value on line 100using a pcvar as well would be smart...nnand also.. by having it check the player count on team join, you can have a problem were if a bunch of ppl leave and your no longer above the cvar value of players.. that it doesnt change the limits untill someone joins/switches team... so i would suggest also putting in a check on client_disconnect.. or maybe just get rid of it checking on team join and have it check on putinserver & disconnect..nnand youve also hard coded the limits like such:n
if(plrs>=get_cvar_num("dod_wc_num"))n {n set_cvar_num("mp_limitalliesspring",1)n set_cvar_num("mp_limitallies30cal",1)n set_cvar_num("mp_limitaxisscopedkar",1)n set_cvar_num("mp_limitaxismg42",1)n set_cvar_num("mp_limitaxismg34",1)n set_cvar_num("mp_limitbritsniper",1)n set_cvar_num("mp_limitbritmg",1)n }i would say either make seperate cvars to let ppl set how many of each when the player count is high enough.. or maybe have it save the default values from the server as variables on say... plugin config or suchnnmaybe even cvars to control which classes it affects.. like say someone wants only mgs and not snipers... or say they dont want the bren to be included.. etc.. each person shouldnt really have to go in and modify the code itself to config it for their server...Threads: 7
Joined: Nov 2006
I'll work on those things and update it...nnAnd yeah, it's similar to limit, but i wanted it to be non-percentage based, and non-map specific.nPlus the one great thing is if you change the limit, it will go force people out of sniper or MG classes.nnIt's not really general use ready yet, obviously, but I like it a lot, thought some others might want a similar thing.nnWill update when done.
Threads: 7
Joined: Nov 2006
*Super Updated*rnrnFeedback at all?
Threads: 103
Joined: May 2005
theres a much better way then using these:n
register_event("TextMsg", "checklimit", "a", "1=3", "2=#game_disconnected")nregister_event("TextMsg", "checklimit", "a", "1=3", "2=#game_joined_game")try:npublic client_putinserver(id)n{nn// yada yadann}ANDnpublic client_disconnect(id)n{nn// yada yadann}ntho the TxtMsg probably works fine.. there can be problems where sometimes they arent called when someone joins/leave (especially if the server is also running a plugin that blocks those msgs)nn:DThreads: 7
Joined: Nov 2006
True enough.nOk, I've change it so that it runs the checklimit when those functions are called.nnI think however, I will change the connect one back to catching the team join messages, because if players go spectate or don't join a team, I want to exclude them from the counts.nnOk... updated source + amxx.nnNow uses client_disconnect to check disconnect, catches the team join messages, and now includes a loop to subtract from the player count if player is a spectator (more efficient way to do this?)
Threads: 103
Joined: May 2005
..i dont think you attached the new version..
Threads: 7
Joined: Nov 2006
Oi. did now!
Threads: 1
Joined: Mar 2016
Hello, sometimes the bazooka disappears from the list of weapons, is it possible that it is the fault of the plugin?
Threads: 3
Joined: Aug 2007
The plugin doesn't do anything with the bazooka. It manipulates the following cvars:nnmp_limitalliesspringnmp_limitallies30calnmp_limitaxisscopedkarnmp_limitaxismg42nmp_limitaxismg34nmp_limitbritsnipernmp_limitbritmg

