PDA

View Full Version : Weapons Mod 2.0


TooLz
03-19-2007, 01:05 PM
The new Weapons Mod 2.0 is finally here.

The Weapons Mod allows you to type /, then the weapons name and receive the weapon as your primary! You can do this with any gun in the game, Now including the Scoped FG42 and Scoped Enfield!

The following is a list of instructions:

Step 1: Press your public chat key while in game
Step 2: Type / then weapons name, the following is a list of aliases to make this simple for binding one key to a gun.
alias GiveK98 "say /k98"
alias GiveK43 "say /k43"
alias GiveMP40 "say /mp40"
alias GiveSTG44 "say /stg44"
alias GiveFG42 "say /fg42"
alias GiveScopedFG42 "say /scopedfg42"
alias GiveScopedK98 "say /scopedk98"
alias GiveMG34 "say /mg34"
alias GiveMG42 "say /mg42"
alias GivePanzerschreck "say /panzerschreck"

alias GiveGarand "say /garand"
alias GiveCarbine "say /carbine"
alias GiveThompson "say /thompson"
alias GiveGreaseGun "say /greasegun"
alias GiveBAR "say /bar"
alias GiveSpringfield "say /springfield"
alias Give30Cal "say /30cal"
alias GiveBazooka "say /bazooka"

alias GiveEnfield "say /enfield"
alias GiveSten "say /sten"
alias GiveBren "say /bren"
alias GiveScopedEnfield "say /scopedenfield"
alias GivePiat "say /piat"

Put those in your userconfig.cfg located in your dod folder client side and then simply bind a key to any of those names you shall receive the gun! Its magic! lol

Modules used:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <dodx>
#include <fakemeta>

CVAR's

amx_weapon_changes - How many times client is allowed to change weapons, default is 2

All below are default to 0, no weapons are disabled by default.
amx_disable_k98
amx_disable_garand
amx_disable_carbine
amx_disable_k43
amx_disable_mp40
amx_disable_thompson
amx_disable_stg44
amx_disable_bar
amx_disable_fg42
amx_disable_greasegun
amx_disable_bazooka
amx_disable_enfield
amx_disable_sten
amx_disable_mg42
amx_disable_mg34
amx_disable_30cal
amx_disable_springfield
amx_disable_scopedk98
amx_disable_bren
amx_disable_panzerschreck
amx_disable_piat
amx_disable_scopedfg42
amx_disable_scopedenfield

Let me know if you have any problems so I can promptly fix them :)

UPDATE 3-20-07:
1. Fixed problem with having to drop weapon before receiving new one!
2. Added Piat and Panzerschreck

UPDATE 3-20-07:
1. Added a 0.5 delay on picking up weapon because when
someone has a higher latency, they don't receive the weapon.

UPDATE 3-23-07:
1. Did a complete recode for cleaner and smaller code
2. Made weapons give faster
3. Fixed bug with the cvar's from previous version

UPDATE 3-25-07:
1. ADDED SCOPED FG42 AND SCOPED ENFIELD!
Big thanks to Wilson for all the help on finding out how finally!
2. Fixed CVAR issue that I thought was fixed in last version

UPDATE 3-26-07:
1. Changed how Scoped FG42 and Scoped Enfield were handled.

UPDATE 4-01-07:
1. Fixed Allowed Change CVAR
2. Fixed problem with sometimes not getting scoped weapon

Special thanks goes to Wilson for helping me out on parts of the code such as the drop issues I was having, and to Diamond-Optic for allowing me to pester him while he is just about to leave all the time.. lol

Cya

Stixsmaster
03-19-2007, 05:06 PM
for those that have never heard of the first weapons mod...what exactly does this do?

---Stixsmaster

=|[76AD]|= TatsuSaisei
03-19-2007, 09:26 PM
Panzershreck
Piat


I know alot who like to use all the zooka types...

weapon_pschreck
weapon_piat

they both work...

TooLz
03-21-2007, 04:03 AM
Okay, I got a lot of things fixed, reuploaded - big thanks goes to Wilson for the help. Piat and Panzerschreck added as requested.

Now if anyone knows where the weapons are defined as weapon_name, let me know please, I am on pursuit of trying to get the scoped FG42 and Scoped Enfield working, that would complete the mod 100&#37;.

Cya

T1mmy
03-22-2007, 09:08 PM
Is there a way to make this admin only also the amx_weapon_count doesnt seem to work

T1mmy
03-23-2007, 01:50 AM
well i managed to get the amx_weapon_changes to work by doing amx_cvar amx_weapon_changes all we need now is for it to be admin only

TooLz
03-23-2007, 02:54 AM
You're wanting only admins to be able to change guns? If so, sorry that just sounds like more of a cheat than a plugin.. It's meant for everyone, not as a cheat.

Cya

T1mmy
03-23-2007, 01:13 PM
no, wanting it admin only cus we want the admins with bazookas and other stuff only gainst the rest as a fun thing

TooLz
03-23-2007, 01:27 PM
Then change your classes to bazooka or figure out how to code and change it yourself :)

I don't make cheats, I make plugins - sorry.

Cya

TooLz
03-23-2007, 09:55 PM
Updates to code above, did a complete recode to take down all of the junk code that was there and put everything into an array and down to 2 functions from like 25, lol..

Should run a lot nice and is a ton smaller in code size, from 550ish lines to 112 lines, so a pretty big improvement, I'd suggest everyone use this one over the old one.

Cya

Allenwr
03-24-2007, 01:11 AM
Your welcome for using my scripting techniques....

TooLz
03-24-2007, 01:21 AM
Yeah, tyvm, that was a huge help - I thank the community because if I tried to give a list of names of all of the people who have helped or I have referenced code from, I'd have a longgggggggggggg list that people just don't care to read.. lol

But yes, ty.

Cya

TooLz
03-25-2007, 11:13 AM
Not very popular? IT WILL BE NOW!

Thanks to the help of Wilson and his awesome plugin, the mod may be complete!

New additions:

The long awaited Scoped FG42 and Scoped Enfield!

Let me know if ya find any bugs, but I think this sucker is finished!

Cya

{SR} *Raggy*
03-25-2007, 12:06 PM
I'll be changing to this today as I got your old one :P

TooLz
03-25-2007, 12:21 PM
Awesome, enjoy it man - its so much more awesome now that I got those 2 put in there, feels all complete! lol

Cya

{SR} *Raggy*
03-25-2007, 02:47 PM
I wouldn't celebrate to much... Sorry... After one of my members doing it, the scopedenfield won't scope :P It's secondary thing is the knife :P I'll have to try the scopedfg42 next...

Well it's the same thing for both weapons... It only shows the model but isn't able to work with the actual weapons...

=|[76AD]|= TatsuSaisei
03-25-2007, 02:52 PM
This is a major accomplishment... well done to all involved !! :D

now excuse me while I own some peeps with my Scoped Fg42...

TooLz
03-25-2007, 03:58 PM
It works Raggy, redownload it - there was a problem where the linux flag for the offset wasnt set, its reuploaded and fixed - discovered that when i tried to run it on my linux server from testing it on my windows test server.. lol

Cya

TooLz
03-25-2007, 04:25 PM
2 bugs fixed:

1. Allowed Changes CVAR wasn't working at all, fixed it.
2. Weapons model stuck for some reason so I kinda did a temporary fix on it by making it fast weapon switch.

Any better ideas? Let me know.. This plugin is officially beta right now because I rushed it out too fast.. Sorry for the problems everyone.

Cya

|OnEHiTwOnDeR|SoCal
03-25-2007, 09:33 PM
VERY NICE JOB GUYS!! Props to u toolz and wilson for the 2 guns. Also just a little thing which i felt was awesome was how when u say /scopedenfield it brings the regualr enfield first and then scoped. Just so u know u can shoot that regular enfield within that 1sec period of switching to scopedenfield which is awesome lol. its a nice 2 shots in 2 sec haha

TooLz
03-26-2007, 07:54 AM
Yeah, I'm still trying to work that problem out, hopefully should have it figured out soon though.

EDIT: Fixed, tested it all for an hour trying to reproduce ANY bugs, none were found in that test so lets keep our fingers crossed.

Cya

|OnEHiTwOnDeR|SoCal
03-26-2007, 11:36 AM
k dont have time to test right now, but another bug was with scopedenfield. It at one point didnt give scoped just gave regular until i gave myself scopedfg42 and tried scopedenfield after and it worked.

TooLz
03-26-2007, 12:28 PM
Yes, that is fixed now. I encountered the problem myself on a Linux server and fixed it.

Cya

=|[76AD]|= TatsuSaisei
03-26-2007, 05:55 PM
Yes, that is fixed now. I encountered the problem myself on a Linux server and fixed it.

Cya

I see you 'fix' was to increase the amount of time before a task executes... I actually reduced the number, and strongly wonder if a task is even needed... granted the code executes fast, and I can forsee the need for the momentary pause... but really even 0.1 should be sufficient... all you are really doing is allowing the plugin time to "give" the weapon to the person before altering a "setting" on the weapon to indicate "special" usage (aka scoped)

btw, I use Wilsons stocks as well now for making an enf. and fg42 scoped... and am using a setting of 0.2 for the pause... and have not seen any issue...

Spectral2
03-31-2007, 12:29 AM
i just downloaded the plugin and ran it and it seems the first couple times you try to give yourself a scoped weapon like fg42 it will give you the regular one. Then i ran out of allowed counts. Will setting the allowed counts to -1 make it so you can change unlimited times?

|OnEHiTwOnDeR|SoCal
03-31-2007, 01:36 AM
no it shouldnt

in the amxx.cfg

stick: amx_weapon_changes "number of how many times a user can change it"

example: amx_weapon_changes 102

and that should do it

TooLz
03-31-2007, 04:48 AM
The scoped FG42 and scoped enfield could use some improving, I'm trying to figure out a method to do that but its proving to be difficult to do at the moment. I'm considering making it set 115 to 1, then check it, if its not 1, then it will set it again. Thats basically the only other way I can think to do it. Considering doing a loop to keep doing that to completely ensure it is the scoped model of the gun before handling the plugin.

EDIT: Added loop, tested, it did solve the issue we were having with not giving the scope on initial try. I was having the problem on my own server. Reuploaded both SMA and AMXX files on original post.

Cya

etothep
03-31-2007, 08:49 PM
good work, some of us have been waiting for this for awhile =D well done.

oh and smiley, your server has been ranked lower than 1 for some time now =D depending on where you get your stats.

Spectral2
03-31-2007, 10:01 PM
love it but it spams my log files


L 03/31/2007 - 19:52:34: [FUN] Item "ammo_weapon_bar" failed to create
L 03/31/2007 - 19:52:34: [AMXX] Run time error 10 (plugin "WeaponsMod2.amxx") (native "give_item") - debug not enabled!
L 03/31/2007 - 19:52:34: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 03/31/2007 - 19:53:01: [FUN] Item "ammo_weapon_kar" failed to create
L 03/31/2007 - 19:53:01: [AMXX] Run time error 10 (plugin "WeaponsMod2.amxx") (native "give_item") - debug not enabled!
L 03/31/2007 - 19:53:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 03/31/2007 - 19:53:19: [FUN] Item "ammo_weapon_kar" failed to create
L 03/31/2007 - 19:53:19: [AMXX] Run time error 10 (plugin "WeaponsMod2.amxx") (native "give_item") - debug not enabled!
L 03/31/2007 - 19:53:19: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 03/31/2007 - 19:54:00: [FUN] Item "ammo_weapon_kar" failed to create
L 03/31/2007 - 19:54:00: [AMXX] Run time error 10 (plugin "WeaponsMod2.amxx") (native "give_item") - debug not enabled!
L 03/31/2007 - 19:54:00: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 03/31/2007 - 19:54:59: [FUN] Item "ammo_weapon_bar" failed to create
L 03/31/2007 - 19:54:59: [AMXX] Run time error 10 (plugin "WeaponsMod2.amxx") (native "give_item") - debug not enabled!
L 03/31/2007 - 19:54:59: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 03/31/2007 - 19:56:27: Start of error session.
L 03/31/2007 - 19:56:27: Info (map "dod_avalanche") (logfile "error_033107.log")
L 03/31/2007 - 19:56:27: [FUN] Item "ammo_weapon_sten" failed to create
L 03/31/2007 - 19:56:27: [AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 03/31/2007 - 19:56:27: [AMXX] Run time error 10: native error (native "give_item")
L 03/31/2007 - 19:56:27: [AMXX] [0] temp.sma::cmdGiveWeapon (line 109)
L 03/31/2007 - 19:56:36: [FUN] Item "ammo_weapon_bren" failed to create
L 03/31/2007 - 19:56:36: [AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 03/31/2007 - 19:56:36: [AMXX] Run time error 10: native error (native "give_item")
L 03/31/2007 - 19:56:36: [AMXX] [0] temp.sma::cmdGiveWeapon (line 109)
L 03/31/2007 - 19:57:21: Start of error session.
L 03/31/2007 - 19:57:21: Info (map "dod_avalanche") (logfile "error_033107.log")
L 03/31/2007 - 19:57:21: [FUN] Item "ammo_weapon_bren" failed to create
L 03/31/2007 - 19:57:21: [AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 03/31/2007 - 19:57:21: [AMXX] Run time error 10: native error (native "give_item")
L 03/31/2007 - 19:57:21: [AMXX] [0] temp.sma::cmdGiveWeapon (line 109)
L 03/31/2007 - 19:59:06: [FUN] Item "ammo_weapon_sten" failed to create
L 03/31/2007 - 19:59:06: [AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 03/31/2007 - 19:59:06: [AMXX] Run time error 10: native error (native "give_item")
L 03/31/2007 - 19:59:06: [AMXX] [0] temp.sma::cmdGiveWeapon (line 109)
L 03/31/2007 - 19:59:37: [FUN] Item "ammo_weapon_piat" failed to create
L 03/31/2007 - 19:59:37: [AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 03/31/2007 - 19:59:37: [AMXX] Run time error 10: native error (native "give_item")
L 03/31/2007 - 19:59:37: [AMXX] [0] temp.sma::cmdGiveWeapon (line 109)

diamond-optic
03-31-2007, 10:27 PM
i believe the errors are from this:
xmod_get_wpnlogname(WeaponID, WeaponName, 31);
format(WeaponName, 31, "weapon_&#37;s", WeaponName);
format(WeaponAmmo,31,"ammo_%s",WeaponName);look what your doing, lol

ok say you get the logname of the garand..
so ill assume that would set: WeaponName = garand

then you format the WeaponName variable to: weapon_garand

then you format the WeaponAmmo with the WeaponName variable that you already formatted..
hence WeaponName would be weapon_garand and your adding that to the end of ammo_

so i would think putting the WeaponAmmo format before the WeaponName one would solve the problem..

TooLz
04-01-2007, 02:25 AM
It would indeed, obviously this just means that you don't need ammo - gun comes with it already, but I will fix it to ensure they get it and not log. lol - Updated to fix that though.

Good catch there.

Cya

Kiel |17.SS|
04-01-2007, 04:59 AM
Hey, I noticed that after you get out of spawn, you can still use that command to get more guns. Can you fix that please?

TooLz
04-01-2007, 07:18 AM
Problem solved, thanks for reporting.

Please redownload, big update on that one. Removed ammo completely because it isn't needed at all and was just a waste of code. Gun comes full of ammo, so that problem is solved with all of the errors. Also allowed changes was on an else statement, apparently messed it up, tested and that problem appears to be solved (Was only tested on my windows server so far, should not have any different effects on linux.)

Hope this is final, lol.

Cya

Spectral2
04-04-2007, 06:13 AM
there is a bug with the plugin. I have another plugin that is custom say commands and we have commands that are triggered by '/' yet anything that starts with a '/' is not relayed to that plugin as the weapons mod plugin is preventing that. is there a way to fix this?

Zor
04-04-2007, 08:22 AM
Best fix is to have it return PLUGIN_CONTINUE instead of PLUGIN_HANDLED so as to carry on to the next plugin. If this is what its doing. Such things as say commands this is necessary.

Cheers!

|OnEHiTwOnDeR|SoCal
04-05-2007, 07:01 AM
Hey, I noticed that after you get out of spawn, you can still use that command to get more guns. Can you fix that please?


TooLz when u say u "fixed it" does this mean noone can get gun out of spawn anymore??

TooLz
04-08-2007, 04:47 AM
They can get guns anywhere, they just can't get more than the limit of guns. Good suggestion Zor, I'll fix that sometime soon, been very busy with my new job - being the lead developer isn't easy there and having time for other things, lol.

Cya

jondoe
04-08-2007, 09:47 PM
Awesome plugin but i would like to give only different pistols to players on my server as i have already edited the entites and added more weapons to the maps. So this would rock if i can use this to just give players lugers and colts. But i do not see that feature in the plugin.

Spectral2
04-10-2007, 12:30 AM
yea that would be cool if you could get pistols too, however if you do make it so you can only get them in the spawn areas, please make it an option you can turn on and off so people who want to be able to allow players to get them anywhere in the map can do so. otherwise great plugin! I was going to make a plugin do this exact samething until i noticed you where making it!

|OnEHiTwOnDeR|SoCal
04-11-2007, 03:36 AM
if u can only get these guns in spawn area then it totally kills the plugins original intention. It was and is intended to have a player run with a bar then see a person far away, get a sniper, kill, go back to having a auto gun. Thats the best thing about this

TooLz
04-11-2007, 03:50 PM
Personally, I don't see a purpose in changing the pistols to the other teams pistols if that is what you guys mean. If you pick up a gun while on allies of someone on axis that died, you will not get a luger, so I don't see a point personally. If you're looking for a pistol only mod, I would look into the "One Weapon Mod."

Spectral2, what you're saying is more like counter-strike with buying weapons in spawn. I only intended this plugin for what |OnEHiTwOnDeR|SoCal just explained. It was basically to enhance game play with several weapons, this mod is farthest from realistic to what WW2 or any war would actually be, I can't possibly see how any soldier could have a bar and a springfield packed up, that would be pretty heavy, this isn't a realism mod and isn't to make DoD more like Counter-Strike. Just to simple enhance the game play with the ability to change weapons under any battle circumstance.

Cya

anwari
04-13-2007, 12:51 PM
Nice plugin but is there a way when people type /fg42 or others it should show on the text... so if i type /bazooka every could see the text i typed

TooLz
04-13-2007, 12:53 PM
Yes, That is the plan with the next update, I am at work at the moment and have no time to work on it or resources at the moment, maybe when I get home I can put the finishing touches on it if I don't get too busy.

Cya

{SR} *Raggy*
04-13-2007, 03:52 PM
I still have to upgrade this... I never got the chance over the last 2 weeks :( Sucking up to my parents for Money for a school trip :P

|OnEHiTwOnDeR|SoCal
04-13-2007, 04:05 PM
? hows that related to anything?

blobby
04-14-2007, 02:46 PM
Thanks for this wonderfull piece.ive just put this on my server and it works a treat i think there was only one problem that it wasnt spawning weapons on the say command binds it was just leaving people with pistols just redownloaded it and it woked fine.

Thanks

Blobby

anwari
04-18-2007, 01:41 AM
So are you almost done adding that little thing i requested, when people type /fg42...etc the others could see the /fg42 on text without being disapeard

|OnEHiTwOnDeR|SoCal
04-18-2007, 07:45 AM
im yet to get why the hell anyone would want that....but....

give him time man u requested it, im sure he'll do it on his free time when he gets the chance

TooLz
04-18-2007, 10:44 AM
I need someone to test this, I just downloaded the file from here at work and played with it for a couple of minutes, let me know if this works.

I believe I may have fixed it, just need someone to test it. Changed the / thing to putting a / in front of all of the names of the weapons in the array, which may be easier and will stop our issue of my plugin taking over any that use a /.. Also "should" display when someone says /whatever unless they're out of changes or the weapon is disabled.

Cya

diamond-optic
04-19-2007, 08:45 PM
all you had to do was change the returns from PLUGIN_HANDLED to PLUGIN_CONTINUE to let the chat continue on thru the rest of the plugins and then show up in the chat..

PLUGIN_HANDLED basically tells it to stop right there.. so the chat wouldnt go any farther then your plugin..


if you want to just block the /weaponname lines from showing up.. then after detecting that.. return PLUGIN_HANDLED..

but with things like chat you want to return PLUGIN_CONTINUE on things your not using (IE* normal chat that doesnt match your conditions) and a lot of times.. depending on how you wrote it.. you can usually have just the last return be that..

Hood [10th MD]
04-24-2007, 09:02 PM
Diamond got it pretty much exactly in that last part - a big issue I've seen, and reason I don't run this:
anytime anyone says something that starts with "/" it disappears, because the plugin eats it alive.

That, socal, is why it needs to be fixed, and also, if your MOTD doesn't explain the weapon mod, then being able to see someone say /enfield gets other people to try it and learn about the plugin as well :)

I think I'll go download and change it now actually, I really like this plugin :)

Also, I'm going to change it so that it uses the cvars on server to determine restrictions for people switching to a different gun - that way, people don't avoid limits like "1 sniper per team" by getting a scoped kar, spring, and scoped enfield. That sounds very good - if anyone is interested, I can post when I get it working?

|OnEHiTwOnDeR|SoCal
04-24-2007, 09:36 PM
why would u totally try to take over a plugin and especially brag about it on the makers thread.

disrespectful.

Hood [10th MD]
04-24-2007, 11:49 PM
Uh... no it's not, it's an improvement, and I like coding, so I want to try it, in all honesty, I'll probably fail.
Feel better?

Hood [10th MD]
04-24-2007, 11:59 PM
Yep, in fact, I cannot even begin to code something to do that...
The way it seems to breakdown is:
You would use the cvars such as mp_limitaxisscopedkar, and let's say that's set to 1...
well, then when a user calls /scopedkar, we should check if any user already has that class, and if they do, then we should deny it.

If anyone wants to code it, I would greatly appreciate it, I just don't understand this code well enough to do it, and apparently, now I'm disrespectful too.

Well, many thanks if anyone can suggest how or can do it. It's a great plugin, I like being able to use any gun. Thanks :)

TooLz
04-30-2007, 05:37 PM
Great! If you want to post it when you're done changing stuff - let me know and I will post it on the main.

Socal, I personally like when people change my plugins for the better - I do not have much time at all to work on these things anymore with my new job. It makes it easier on me and more responsive to the community when they need something that isn't there and the developer who made it isn't available.

Hood, if you do that, let me know - I'll definitely give you credit for helping out on it.

Cya

rplatt
04-30-2007, 10:30 PM
i would like to know how to have all the weapons names appear and the bottom of the screen so everyone can see what the names are

Allenwr
05-01-2007, 11:13 AM
This should fix it so they clients see what weapon was typed

/*
Weapons Mod 2.0
Brought to you by TooLz

Special thanks to DoDPlugins.net for providing the wonderful community!
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <dodx>
#include <fakemeta>

#define MAXWEAPON 23
new got_weapon[32], Weapon_Name[33][32]
enum WeaponData {
WMOD_Weapon,
WMOD_SayCmd[32],
WMOD_Disabled[32]
}
new WEAPON[MAXWEAPON][WeaponData] = {
{DODW_KAR,"k98","amx_disable_k98"}, //0
{DODW_GARAND,"garand","amx_disable_garand"}, //1
{DODW_K43,"k43","amx_disablek43"}, //2
{DODW_M1_CARBINE,"carbine","amx_disable_carbine"}, //3
{DODW_MP40,"mp40","amx_disable_mp40"}, //4
{DODW_THOMPSON,"thompson","amx_disable_thompson"}, //5
{DODW_STG44,"stg44","amx_disable_stg44"}, //6
{DODW_GREASEGUN,"greasegun","amx_disable_greasegun"}, //7
{DODW_SCOPED_KAR,"scopedk98","amx_disable_scopedk98"}, //8
{DODW_SPRINGFIELD,"springfield","amx_disable_springfield"}, //9
{DODW_MG34,"mg34","amx_disable_mg34"}, //10
{DODW_BAR,"bar","amx_disable_bar"}, //11
{DODW_MG42,"mg42","amx_disable_mg42"}, //12
{DODW_30_CAL,"30cal","amx_disable_30cal"}, //13
{DODW_PANZERSCHRECK,"panzerschreck","amx_disable_panzerschreck"}, //14
{DODW_BAZOOKA,"bazooka","amx_disable_bazooka"}, //15
{DODW_ENFIELD,"enfield","amx_disable_enfield"}, //16
{DODW_STEN,"sten","amx_disable_sten"}, //17
{DODW_BREN,"bren","amx_disable_bren"}, //18
{DODW_PIAT,"piat","amx_disable_piat"}, //19
{DODW_FG42,"fg42","amx_disable_fg42"}, //20
{DODW_SCOPED_FG42,"scopedfg42","amx_disable_scopedfg42"}, //21
{DODW_SCOPED_ENFIELD,"scopedenfield","amx_disable_scopedenfield"} //22
}
public plugin_init()
{
register_plugin("Weapons Mod 2.0","2.0","TooLz")
register_event("ResetHUD","respawn","be")
register_clcmd("say","cmdSay",0,"- Checks which weapon was said")
register_cvar("amx_weapon_changes", "2")
register_cvar("amx_disable_scopedfg42","0")
register_cvar("amx_disable_scopedenfield","0")
register_cvar("amx_disable_k98", "0")
register_cvar("amx_disable_garand", "0")
register_cvar("amx_disable_carbine", "0")
register_cvar("amx_disable_k43", "0")
register_cvar("amx_disable_mp40", "0")
register_cvar("amx_disable_thompson", "0")
register_cvar("amx_disable_stg44", "0")
register_cvar("amx_disable_bar", "0")
register_cvar("amx_disable_fg42", "0")
register_cvar("amx_disable_greasegun", "0")
register_cvar("amx_disable_bazooka", "0")
register_cvar("amx_disable_enfield", "0")
register_cvar("amx_disable_sten", "0")
register_cvar("amx_disable_mg42", "0")
register_cvar("amx_disable_mg34", "0")
register_cvar("amx_disable_30cal", "0")
register_cvar("amx_disable_springfield", "0")
register_cvar("amx_disable_scopedk98", "0")
register_cvar("amx_disable_bren", "0")
register_cvar("amx_disable_panzerschreck", "0")
register_cvar("amx_disable_piat", "0")
}
public respawn(id){
got_weapon[id] = 0
}
stock detect_weapon_id(id) {
// Big thanks to Wilson for this stock!
new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];
new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);
xmod_get_wpnlogname(m_iWpn, m_szWpn, 31);
format(m_szWpn, 31, "weapon_&#37;s", m_szWpn);
if(equal(m_szWpn, "weapon_scoped_enfield")) m_szWpn = "weapon_enfield";
if(equal(m_szWpn, "weapon_scoped_fg42")) m_szWpn = "weapon_fg42";
new Float:m_flOrigin[3];
pev(id, pev_origin, m_flOrigin);
while((m_iCurEnt = engfunc(EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0)) != 0) {
new m_szClassname[32];
pev(m_iCurEnt, pev_classname, m_szClassname, 31);
if(equal(m_szClassname, m_szWpn))
m_iWpnEnt = m_iCurEnt;
}
return m_iWpnEnt;
}
stock cmdWeapon(WeaponID, WeaponName[32]) {
xmod_get_wpnlogname(WeaponID, WeaponName, 31);
format(WeaponName, 31, "weapon_%s", WeaponName);
}
stock dod_get_scoped(id) {
new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];
new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);
new is_scoped
xmod_get_wpnlogname(m_iWpn, m_szWpn, 31);
format(m_szWpn, 31, "weapon_%s", m_szWpn);
if(equal(m_szWpn, "weapon_scoped_enfield")) m_szWpn = "weapon_enfield";
if(equal(m_szWpn, "weapon_scoped_fg42")) m_szWpn = "weapon_fg42";
new Float:m_flOrigin[3];
pev(id, pev_origin, m_flOrigin);
while((m_iCurEnt = engfunc(EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0)) != 0) {
new m_szClassname[32];
pev(m_iCurEnt, pev_classname, m_szClassname, 31);
if(equal(m_szClassname, m_szWpn))
m_iWpnEnt = m_iCurEnt;
}
is_scoped = get_pdata_int(m_iWpnEnt,115,4);
return is_scoped;
}
public cmdMakeScoped(id){
new is_scoped = dod_get_scoped(id)
while(is_scoped != 1){
is_scoped = dod_get_scoped(id)
set_pdata_int(detect_weapon_id(id),115,1,4)
}
client_cmd(id,"slot2;wait;slot3")
}
public cmdGiveWeapon(id){
if (!equali(Weapon_Name[id],"weapon_scoped_fg42") && !equali(Weapon_Name[id], "weapon_scoped_enfield")){
give_item(id,Weapon_Name[id])
}
if(equali(Weapon_Name[id],"weapon_scoped_fg42")){
give_item(id,"weapon_fg42")
set_task(0.2,"cmdMakeScoped",id)
}
if(equali(Weapon_Name[id],"weapon_scoped_enfield")){
give_item(id,"weapon_enfield")
set_task(0.2,"cmdMakeScoped",id)
}
got_weapon[id]++
}
public cmdSay(id) {
new said[32]
read_argv(1,said,31)
if(said[0] != '/')
return PLUGIN_CONTINUE;
for(new i = 0 ; i < MAXWEAPON ; i++) {
if(equali(said[1],WEAPON[i][WMOD_SayCmd])) {
if(get_cvar_num(WEAPON[i][WMOD_Disabled]) != 0){
client_print(id,print_chat, "[Weapons Mod 2.0] This weapon is disabled on this server.")
return PLUGIN_HANDLED
}
if (got_weapon[id] == get_cvar_num("amx_weapon_changes")){
client_print(id,print_chat, "[Weapons Mod 2.0] You've used up your gun changes, you must wait until respawn to change guns again.")
return PLUGIN_HANDLED
}
cmdWeapon(WEAPON[i][WMOD_Weapon],Weapon_Name[id])
client_cmd(id, "drop")
set_task(0.3,"cmdGiveWeapon", id)
break;
}
}
return PLUGIN_CONTINUE;
}


If you dont know what to do with this, go to www.amxmodx.org/webcompiler.cgi

|OnEHiTwOnDeR|SoCal
05-18-2007, 10:58 PM
this plugin keeps casuing my server to crash atleast once daily. i went ahead and enabled debug and got:

[AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 05/17/2007 - 00:12:21: [AMXX] Run time error 4: index out of bounds
L 05/17/2007 - 00:12:21: [AMXX] [0] temp.sma::respawn (line 77)

[AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 05/17/2007 - 04:49:34: [AMXX] Run time error 4: index out of bounds
L 05/17/2007 - 04:49:34: [AMXX] [0] temp.sma::cmdSay (line 153)

any ideas?

diamond-optic
05-18-2007, 11:17 PM
just glancing over it real quick...

might be this global:
got_weapon[32]

array size might need to be 33

{SR} *Raggy*
05-19-2007, 05:26 AM
I updated this like 3 days ago and I also put bots onto my server... I thought it was the bots that was crashing my server... Thanks for saying that now Wonder and Diamond :)

|OnEHiTwOnDeR|SoCal
05-19-2007, 05:43 AM
i dont think thats the only problem but so far it hasnt caused anything but it does it like once a say so i dunno yet. and i dunno whether or not my other plugins getting in the way of it but they give me errors as well

|OnEHiTwOnDeR|SoCal
05-27-2007, 04:20 AM
u know there IS one problem with this plugin OR maybe another one of mine plugins somehow interfering with this one. id say 1 out of 50 ppl on the server at a certain time cannot use the plugin, when they type /gunname it dont work for them. they reset steam, dod, everything and nothing works. the next day everything is good. it seems to choose random players to not let use the plugin lol i know it sounds stupid but ive seen this happen atleast 50 times in the past 5 months even with the old weapons mod

TooLz
05-27-2007, 07:00 AM
That is very odd, I've not personally seen that problem on my servers, I've got the weapons mod on 3 of my servers personally and have not had any problems with it crashing or not giving weapons.. Probably one of your other plugins maybe interfering..

Cya

|OnEHiTwOnDeR|SoCal
05-27-2007, 07:04 AM
i havent another weapon plugin so might be it. thanks anyways lol

=|[76AD]|= TatsuSaisei
05-27-2007, 12:21 PM
u know there IS one problem with this plugin OR maybe another one of mine plugins somehow interfering with this one. id say 1 out of 50 ppl on the server at a certain time cannot use the plugin, when they type /gunname it dont work for them. they reset steam, dod, everything and nothing works. the next day everything is good. it seems to choose random players to not let use the plugin lol i know it sounds stupid but ive seen this happen atleast 50 times in the past 5 months even with the old weapons mod

It is not random, it is the 32nd person in the server... the code NEEDS an edit here...


new got_weapon[32], Weapon_Name[33][32]


to this...


new got_weapon[33], Weapon_Name[33][32]


the player slots run from 1 - 32, and the original array stopped at 31 ... for most of us who use redirection when the server gets full, we never really see 32 people on the server, because one slot always has to be open... but IV|XX does not use any redirection and his server WILL hold 32 people at any given time... therefore it MUST be 33 and not 32 in the array declaration ...

any array used to hold info based on a players "id" HAS to be declared with 33 elements (the 0 indexed cell will go unused) ....
this plugin keeps casuing my server to crash atleast once daily. i went ahead and enabled debug and got:

[AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 05/17/2007 - 00:12:21: [AMXX] Run time error 4: index out of bounds
L 05/17/2007 - 00:12:21: [AMXX] [0] temp.sma::respawn (line 77)

[AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 05/17/2007 - 04:49:34: [AMXX] Run time error 4: index out of bounds
L 05/17/2007 - 04:49:34: [AMXX] [0] temp.sma::cmdSay (line 153)

any ideas?

onehit, take the sma and change 32 to 33 recompile and add it back onto the server, most others might never see this probelm if they never see a full server...

just glancing over it real quick...

might be this global:
got_weapon[32]

array size might need to be 33

|OnEHiTwOnDeR|SoCal
05-27-2007, 02:44 PM
ty sir appreciate it

|OnEHiTwOnDeR|SoCal
05-27-2007, 06:13 PM
could this be a problem in all the other plugins ?

=|[76AD]|= TatsuSaisei
05-27-2007, 07:25 PM
could this be a problem in all the other plugins ?

its possible, but not in any of mine...

diamond-optic
05-27-2007, 11:17 PM
pfffffffffffffffffftttttttt

should have listened to me :D heheh

|OnEHiTwOnDeR|SoCal
05-28-2007, 12:24 AM
yo d-o no joke i did do that when u told me lol

blobby
06-13-2007, 06:13 AM
Is there any way i can take mgs off this as we have them banned due to alot of camping and i cant stop people from using this to get them and it doesnt have a way to limit them via the plugin does it

Regards

Blobby

{SR} *Raggy*
06-13-2007, 10:44 AM
Look at the first page... There is a way to stop people of getting them

blobby
06-13-2007, 10:58 AM
Ok i do apologise for that i must have missed it when i read through or just not taken it in fully so im sorry

Regards

Blobby

{SR} *Raggy*
06-13-2007, 06:54 PM
It's cool... We all do it sometime's (Except the Developer's :P They are just too smart for that lol :P)

=|[76AD]|= TatsuSaisei
06-14-2007, 03:07 AM
(Except the Developer's :P They are just too smart for that lol :P)

LMAO, I can envision Diamonds post now ("speak for yourself") but even us Developers are occasionally guilty of that...

diamond-optic
06-14-2007, 12:01 PM
lol

i almost said it :P

ruffusbebad
08-09-2007, 09:40 AM
Got this error:
L 08/07/2007 - 11:31:06: Start of error session.
L 08/07/2007 - 11:31:06: Info (map "mario_air") (logfile "error_080707.log")
L 08/07/2007 - 11:31:06: [FUN] Invalid player 8
L 08/07/2007 - 11:31:06: [AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 08/07/2007 - 11:31:06: [AMXX] Run time error 10: native error (native "give_item")
L 08/07/2007 - 11:31:06: [AMXX] [0] phpUiNJz4.sma::cmdGiveWeapon (line 130)

Any ideas, Thanks in advance.

Just deleat this if there is no fix

TooLz
09-13-2007, 02:48 PM
Got this error:
L 08/07/2007 - 11:31:06: Start of error session.
L 08/07/2007 - 11:31:06: Info (map "mario_air") (logfile "error_080707.log")
L 08/07/2007 - 11:31:06: [FUN] Invalid player 8
L 08/07/2007 - 11:31:06: [AMXX] Displaying debug trace (plugin "WeaponsMod2.amxx")
L 08/07/2007 - 11:31:06: [AMXX] Run time error 10: native error (native "give_item")
L 08/07/2007 - 11:31:06: [AMXX] [0] phpUiNJz4.sma::cmdGiveWeapon (line 130)

Any ideas, Thanks in advance.

Just deleat this if there is no fix

Make sure you have all of the Modules on that need to be ran for the weapons mod to work. Look in the top part of the code to find them.

Cya

=|[76AD]|= TatsuSaisei
09-19-2007, 07:43 PM
Make sure you have all of the Modules on that need to be ran for the weapons mod to work. Look in the top part of the code to find them.

Cya

His problem is not the lack of a module being loaded (shouldn't be an issue with latest amxx anyways) as I get these on occasion and has more to do with players getting disconnected and amxx trying to execute a comand on their player id which hasn't had a chance to refresh yet... usually the presence of bots brings this out more often then not...

knife108
09-20-2007, 07:25 AM
update amxx to 1.75 or above :D

ruffusbebad
09-23-2007, 02:59 PM
I guess I should of said that the plugin is working fine,running v1.76c. Just dont like errors, and am trying to keep a clean log file.
I appreciate everyones efforts, Thanks for the insight Tatsu. I understand better what is going on now. I get simular errors with some other plugins. They dont cause crashes as a rule. So I guess I've got to live with them.

The_Tank
10-17-2007, 02:31 PM
Goodday to you all,

First I want to thank the creator(s) for this plugin, it's providing a lot of fun for me and the others on the server. Small introduction, im a member of IVXX, the clan of OneHitWonder.

I guess this is a bit off-topic and if so, im sorry but couldn't think of a better place to ask this question since its regarding this plugin. If I am totally off topic and shouldnt ask this question here, then my apologies for it and please delete the reply then.

This plugin is installed on the IVXX server and people who play on this server have binded the phrases to spawn guns to keys, the only problem is that it sometimes spawns a gun, so replacing your original gun and makes it drop the ground again.

so like this------original weapon -> say /bar, so bar -> bar on the ground.

Since I am a complete newb to stuff like this, this is like a simple view from me, its like the loop goes to far. First it makes you drop the original gun, so it can be replaced by the gun of choise, then it gives you the gun of choise and then makes the gun drop again.

Is there a way I can alter the bind phrase so it wont drop me my gun and leave me out with a pistol in my hand?

I was thinking about placing some wait's in it, but that doesnt really do the job, so my line looked like: bind x "say /bar; wait; wait;" or something like that.

Also another thing, there is a limit on this plugin, so you can only spawn like 3 or 4 guns in one spawn round. This limit is still on, on IVXX. Reason, because we dont like people spamming guns everywhere, probably will lag the server as well.

Now there is a way to bypass the limit, which is ok with Onehitwonder, its even described on his forums. To bypass you just press the binded key so many times until the line comes up that you have reached the spawn limit and have to wait until you respawn, once you see that line and press once or twice your binded key, it will cancel the limit.nSo this is not considered a cheat on our community and used by many, since the information for it is available to anyone.

Is there a way I can bind a key to make me bypass the limit by one press on the button?

I had something like: bind x "say /bar; wait; say /bar; wait; say /bar; wait; say /bar;"
But it only spawns like 2 weapons at the same time and not with the greatest of speeds.

Again, if missposted, my apologies for it.

With kind regards,

The Tank

Hood [10th MD]
11-02-2007, 11:43 PM
A while back I posted about this mod complying with server cvars... i.e. if there's only 1 sniper allowed, I would like to keep it that way, but give them the freedom of choice for which one they want - has this been incorporated? If not, I will now finally give it a look, but I feel like I will only be confused :)

rawfuls
11-28-2007, 10:52 PM
Yeah... I'm kind of a baddie at mods rah now.

I just add the .amxx in the addons/amxmodx/plugins/ folder? If so, I just restarted map, and it won't work.

Do I need to add the cvars? yes/no?

I'm so lost.

NVM

Got it.

meathead
11-29-2007, 03:51 AM
rawfuls, this post should help
http://www.dodplugins.net/forums/showthread.php?t=681

dodsynthetic
02-27-2008, 10:03 AM
I was asked by a server admin from H.A.T. to modify your plugin so that it automatically changes back to chosen gun instead of class default on spawn / round start. I figured I would share the modification with you TooLz.

/*
Weapons Mod 2.0
Brought to you by TooLz

Special thanks to DoDPlugins.net for providing the wonderful community!
*/

// ===========================
// Modifications:
// ===========================
// Added the ability to keep chosen weapon instead of class default after respawn / round start.
//
// ===========================
// CVARS:
// ===========================
// - amx_autospawn_weapon | 0 = off | 1 = on
// Enable or disable respawning / round starting with chosen weapon. Default on.

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <dodx>
#include <fakemeta>
#define MAXWEAPON 23

new player_weapon[33][32]
new player_id
new weapon_chosen[33]

new got_weapon[32], Weapon_Name[33][32]
enum WeaponData {
WMOD_Weapon,
WMOD_SayCmd[32],
WMOD_Disabled[32]
}
new WEAPON[MAXWEAPON][WeaponData] = {
{DODW_KAR,"k98","amx_disable_k98"}, //0
{DODW_GARAND,"garand","amx_disable_garand"}, //1
{DODW_K43,"k43","amx_disablek43"}, //2
{DODW_M1_CARBINE,"carbine","amx_disable_carbine"}, //3
{DODW_MP40,"mp40","amx_disable_mp40"}, //4
{DODW_THOMPSON,"thompson","amx_disable_thompson"}, //5
{DODW_STG44,"stg44","amx_disable_stg44"}, //6
{DODW_GREASEGUN,"greasegun","amx_disable_greasegun"}, //7
{DODW_SCOPED_KAR,"scopedk98","amx_disable_scopedk98"}, //8
{DODW_SPRINGFIELD,"springfield","amx_disable_springfield"}, //9
{DODW_MG34,"mg34","amx_disable_mg34"}, //10
{DODW_BAR,"bar","amx_disable_bar"}, //11
{DODW_MG42,"mg42","amx_disable_mg42"}, //12
{DODW_30_CAL,"30cal","amx_disable_30cal"}, //13
{DODW_PANZERSCHRECK,"panzerschreck","amx_disable_panzerschreck"}, //14
{DODW_BAZOOKA,"bazooka","amx_disable_bazooka"}, //15
{DODW_ENFIELD,"enfield","amx_disable_enfield"}, //16
{DODW_STEN,"sten","amx_disable_sten"}, //17
{DODW_BREN,"bren","amx_disable_bren"}, //18
{DODW_PIAT,"piat","amx_disable_piat"}, //19
{DODW_FG42,"fg42","amx_disable_fg42"}, //20
{DODW_SCOPED_FG42,"scopedfg42","amx_disable_scopedfg42"}, //21
{DODW_SCOPED_ENFIELD,"scopedenfield","amx_disable_scopedenfield"} //22
}
public plugin_init()
{
register_plugin("Weapons Mod 2.0","2.0","TooLz")
register_event("ResetHUD","respawn","be")
register_clcmd("say","cmdSay",0,"- Checks which weapon was said")
register_cvar("amx_weapon_changes", "2")
register_cvar("amx_disable_scopedfg42","0")
register_cvar("amx_disable_scopedenfield","0")
register_cvar("amx_disable_k98", "0")
register_cvar("amx_disable_garand", "0")
register_cvar("amx_disable_carbine", "0")
register_cvar("amx_disable_k43", "0")
register_cvar("amx_disable_mp40", "0")
register_cvar("amx_disable_thompson", "0")
register_cvar("amx_disable_stg44", "0")
register_cvar("amx_disable_bar", "0")
register_cvar("amx_disable_fg42", "0")
register_cvar("amx_disable_greasegun", "0")
register_cvar("amx_disable_bazooka", "0")
register_cvar("amx_disable_enfield", "0")
register_cvar("amx_disable_sten", "0")
register_cvar("amx_disable_mg42", "0")
register_cvar("amx_disable_mg34", "0")
register_cvar("amx_disable_30cal", "0")
register_cvar("amx_disable_springfield", "0")
register_cvar("amx_disable_scopedk98", "0")
register_cvar("amx_disable_bren", "0")
register_cvar("amx_disable_panzerschreck", "0")
register_cvar("amx_disable_piat", "0")
register_cvar("amx_autospawn_weapon", "1")
register_event("HLTV", "func_new_round", "a", "1=0", "2=0")
}
public respawn(id){
got_weapon[id] = 0
}
stock detect_weapon_id(id) {
// Big thanks to Wilson for this stock!
new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];
new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);
xmod_get_wpnlogname(m_iWpn, m_szWpn, 31);
format(m_szWpn, 31, "weapon_%s", m_szWpn);
if(equal(m_szWpn, "weapon_scoped_enfield")) m_szWpn = "weapon_enfield";
if(equal(m_szWpn, "weapon_scoped_fg42")) m_szWpn = "weapon_fg42";
new Float:m_flOrigin[3];
pev(id, pev_origin, m_flOrigin);
while((m_iCurEnt = engfunc(EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0)) != 0) {
new m_szClassname[32];
pev(m_iCurEnt, pev_classname, m_szClassname, 31);
if(equal(m_szClassname, m_szWpn))
m_iWpnEnt = m_iCurEnt;
}
return m_iWpnEnt;
}
stock cmdWeapon(WeaponID, WeaponName[32]) {
xmod_get_wpnlogname(WeaponID, WeaponName, 31);
format(WeaponName, 31, "weapon_%s", WeaponName);
}
stock dod_get_scoped(id) {
new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];
new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);
new is_scoped
xmod_get_wpnlogname(m_iWpn, m_szWpn, 31);
format(m_szWpn, 31, "weapon_%s", m_szWpn);
if(equal(m_szWpn, "weapon_scoped_enfield")) m_szWpn = "weapon_enfield";
if(equal(m_szWpn, "weapon_scoped_fg42")) m_szWpn = "weapon_fg42";
new Float:m_flOrigin[3];
pev(id, pev_origin, m_flOrigin);
while((m_iCurEnt = engfunc(EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0)) != 0) {
new m_szClassname[32];
pev(m_iCurEnt, pev_classname, m_szClassname, 31);
if(equal(m_szClassname, m_szWpn))
m_iWpnEnt = m_iCurEnt;
}
is_scoped = get_pdata_int(m_iWpnEnt,115,4);
return is_scoped;
}
public cmdMakeScoped(id){
new is_scoped = dod_get_scoped(id)
while(is_scoped != 1){
is_scoped = dod_get_scoped(id)
set_pdata_int(detect_weapon_id(id),115,1,4)
}
client_cmd(id,"slot2;wait;slot3")
}
public cmdGiveWeapon(id){
if (!equali(Weapon_Name[id],"weapon_scoped_fg42") && !equali(Weapon_Name[id], "weapon_scoped_enfield")){
give_item(id,Weapon_Name[id])
}
if(equali(Weapon_Name[id],"weapon_scoped_fg42")){
give_item(id,"weapon_fg42")
set_task(0.2,"cmdMakeScoped",id)
}
if(equali(Weapon_Name[id],"weapon_scoped_enfield")){
give_item(id,"weapon_enfield")
set_task(0.2,"cmdMakeScoped",id)
}
got_weapon[id]++
}
public cmdSay(id) {
new said[32]
read_argv(1,said,31)
read_argv(1,player_weapon[id],31)
if(said[0] != '/')
return PLUGIN_CONTINUE;
for(new i = 0 ; i < MAXWEAPON ; i++) {
if(equali(said[1],WEAPON[i][WMOD_SayCmd])) {
if(get_cvar_num(WEAPON[i][WMOD_Disabled]) != 0){
client_print(id,print_chat, "[Weapons Mod 2.0] This weapon is disabled on this server.")
return PLUGIN_HANDLED
}
if (got_weapon[id] == get_cvar_num("amx_weapon_changes")){
client_print(id,print_chat, "[Weapons Mod 2.0] You've used up your gun changes, you must wait until respawn to change guns again.")
return PLUGIN_HANDLED
}
cmdWeapon(WEAPON[i][WMOD_Weapon],Weapon_Name[id])
client_cmd(id, "drop")
weapon_chosen[id] = 1
set_task(0.3,"cmdGiveWeapon", id)
break;
}
}
return PLUGIN_HANDLED
}
//If round restarts, change all player's weapons from class defaults to chosen.
public func_new_round() {
if (get_cvar_num("amx_autospawn_weapon") == 1)
{
new i,max_players[32],inum
get_players(max_players,inum,"c")
for(i = 0; i < inum; ++i)
{
if (weapon_chosen[max_players[i]] && is_user_connected(max_players[i]))
{
player_id = max_players[i]
set_task(1.5,"func_auto_change",max_players[i]+50)
}
}
}
}
//If player spawns, change weapon from class default to chosen.
public dod_client_spawn(id) {
if (get_cvar_num("amx_autospawn_weapon") == 1)
{
if (weapon_chosen[id] && is_user_connected(id))
{
player_id = id
set_task(0.3,"func_auto_change",id+50)
}
}
}
//Make client execute say command with chosen weapon.
public func_auto_change() {
client_cmd(player_id,"say %s",player_weapon[player_id])
}
//Reset id bit if new player takes previous id number.
public client_connect(id) {
weapon_chosen[id] = 0
}

|OnEHiTwOnDeR|SoCal
02-27-2008, 12:11 PM
i was playing on a server like that and its super annoying cuz thats not the point of the plugin at all

but anyways there is already a plugin that does this dude....i think its called dod_class or someshit like that its somewhere in the plugins or non mod plugins

dodsynthetic
02-27-2008, 10:11 PM
It's all about the laziness factor lol. I guess some people just don't like typing or to even hit a single binded key for their gun when they start from spawn. It would be possible to use the class plugin and weapon mod if one were to change out plugin_handled to plugin_continue in both of their say functions which I could have done but I chose to make my own code for it. Either way, you end up with the same main weapon result on spawn / round start.

Dr.G
02-28-2008, 05:45 PM
Yeah GJ m8.. keep em coming ;)

TooLz
03-07-2008, 11:46 AM
That script you posted has a nasty flaw, if you say something in chat - it doesn't give you the weapon when you respawn, it repeats the last thing you said in chat.

I'd recommend working on that a little more and getting it to not do that, then make a cvar to enable or disable it - then I can post it.

Cya

dodsynthetic
06-24-2008, 08:03 PM
I forgot all about this XD. HAT had reported the same problem. I fixed it when they first told me about it but I also just made some minor changes in regards to the timer ids. I tested it on my private server but it's only populated by bots. Let me know how it goes. ;)

/*
Weapons Mod 2.0
Brought to you by TooLz

Special thanks to DoDPlugins.net for providing the wonderful community!
*/

// ===========================
// Modifications:
// ===========================
// Added the ability to keep chosen weapon instead of class default even after respawn / round start.
//
// ===========================
// CVARS:
// ===========================
// - amx_autospawn_weapon | 0 = off | 1 = on
// Enable or disable respawning / round starting with chosen weapon. Default on.

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <dodx>
#include <fakemeta>
#define MAXWEAPON 23

new player_weapon[32][32]
new auto_type
new weapon_chosen[32]
new weapon_said[32][32]

new got_weapon[32], Weapon_Name[33][32]
enum WeaponData {
WMOD_Weapon,
WMOD_SayCmd[32],
WMOD_Disabled[32]
}
new WEAPON[MAXWEAPON][WeaponData] = {
{DODW_KAR,"k98","amx_disable_k98"}, //0
{DODW_GARAND,"garand","amx_disable_garand"}, //1
{DODW_K43,"k43","amx_disablek43"}, //2
{DODW_M1_CARBINE,"carbine","amx_disable_carbine"}, //3
{DODW_MP40,"mp40","amx_disable_mp40"}, //4
{DODW_THOMPSON,"thompson","amx_disable_thompson"}, //5
{DODW_STG44,"stg44","amx_disable_stg44"}, //6
{DODW_GREASEGUN,"greasegun","amx_disable_greasegun"}, //7
{DODW_SCOPED_KAR,"scopedk98","amx_disable_scopedk98"}, //8
{DODW_SPRINGFIELD,"springfield","amx_disable_springfield"}, //9
{DODW_MG34,"mg34","amx_disable_mg34"}, //10
{DODW_BAR,"bar","amx_disable_bar"}, //11
{DODW_MG42,"mg42","amx_disable_mg42"}, //12
{DODW_30_CAL,"30cal","amx_disable_30cal"}, //13
{DODW_PANZERSCHRECK,"panzerschreck","amx_disable_panzerschreck"}, //14
{DODW_BAZOOKA,"bazooka","amx_disable_bazooka"}, //15
{DODW_ENFIELD,"enfield","amx_disable_enfield"}, //16
{DODW_STEN,"sten","amx_disable_sten"}, //17
{DODW_BREN,"bren","amx_disable_bren"}, //18
{DODW_PIAT,"piat","amx_disable_piat"}, //19
{DODW_FG42,"fg42","amx_disable_fg42"}, //20
{DODW_SCOPED_FG42,"scopedfg42","amx_disable_scopedfg42"}, //21
{DODW_SCOPED_ENFIELD,"scopedenfield","amx_disable_scopedenfield"} //22
}
public plugin_init()
{
register_plugin("Weapons Mod 2.0","2.0","TooLz")
register_event("ResetHUD","respawn","be")

register_clcmd("say /k98","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /garand","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /k43","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /carbine","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /mp40","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /thompson","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /stg44","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /greasegun","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /scopedk98","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /springfield","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /mg34","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /bar","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /mg42","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /30cal","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /panzerschreck","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /bazooka","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /enfield","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /sten","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /bren","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /piat","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /fg42","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /scopedfg42","cmdSay",0,"- Checks which weapon was said")
register_clcmd("say /scopedenfield","cmdSay",0,"- Checks which weapon was said")
register_cvar("amx_weapon_changes", "99")
register_cvar("amx_disable_scopedfg42","0")
register_cvar("amx_disable_scopedenfield","0")
register_cvar("amx_disable_k98", "0")
register_cvar("amx_disable_garand", "0")
register_cvar("amx_disable_carbine", "0")
register_cvar("amx_disable_k43", "0")
register_cvar("amx_disable_mp40", "0")
register_cvar("amx_disable_thompson", "0")
register_cvar("amx_disable_stg44", "0")
register_cvar("amx_disable_bar", "0")
register_cvar("amx_disable_fg42", "0")
register_cvar("amx_disable_greasegun", "0")
register_cvar("amx_disable_bazooka", "0")
register_cvar("amx_disable_enfield", "0")
register_cvar("amx_disable_sten", "0")
register_cvar("amx_disable_mg42", "0")
register_cvar("amx_disable_mg34", "0")
register_cvar("amx_disable_30cal", "0")
register_cvar("amx_disable_springfield", "0")
register_cvar("amx_disable_scopedk98", "0")
register_cvar("amx_disable_bren", "0")
register_cvar("amx_disable_panzerschreck", "0")
register_cvar("amx_disable_piat", "0")
register_cvar("amx_autospawn_weapon", "1")
register_event("HLTV", "func_new_round", "a", "1=0", "2=0")
}

public respawn(id){
got_weapon[id] = 0
}

stock detect_weapon_id(id) {
// Big thanks to Wilson for this stock!
new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];
new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);
xmod_get_wpnlogname(m_iWpn, m_szWpn, 31);
format(m_szWpn, 31, "weapon_%s", m_szWpn);
if(equal(m_szWpn, "weapon_scoped_enfield")) m_szWpn = "weapon_enfield";
if(equal(m_szWpn, "weapon_scoped_fg42")) m_szWpn = "weapon_fg42";
new Float:m_flOrigin[3];
pev(id, pev_origin, m_flOrigin);
while((m_iCurEnt = engfunc(EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0)) != 0) {
new m_szClassname[32];
pev(m_iCurEnt, pev_classname, m_szClassname, 31);
if(equal(m_szClassname, m_szWpn))
m_iWpnEnt = m_iCurEnt;
}
return m_iWpnEnt;
}
stock cmdWeapon(WeaponID, WeaponName[32]) {
xmod_get_wpnlogname(WeaponID, WeaponName, 31);
format(WeaponName, 31, "weapon_%s", WeaponName);
}
stock dod_get_scoped(id) {
new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];
new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);
new is_scoped
xmod_get_wpnlogname(m_iWpn, m_szWpn, 31);
format(m_szWpn, 31, "weapon_%s", m_szWpn);
if(equal(m_szWpn, "weapon_scoped_enfield")) m_szWpn = "weapon_enfield";
if(equal(m_szWpn, "weapon_scoped_fg42")) m_szWpn = "weapon_fg42";
new Float:m_flOrigin[3];
pev(id, pev_origin, m_flOrigin);
while((m_iCurEnt = engfunc(EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0)) != 0) {
new m_szClassname[32];
pev(m_iCurEnt, pev_classname, m_szClassname, 31);
if(equal(m_szClassname, m_szWpn))
m_iWpnEnt = m_iCurEnt;
}
is_scoped = get_pdata_int(m_iWpnEnt,115,4);
return is_scoped;
}
public cmdMakeScoped(id){
new is_scoped = dod_get_scoped(id)
while(is_scoped != 1){
is_scoped = dod_get_scoped(id)
set_pdata_int(detect_weapon_id(id),115,1,4)
}
client_cmd(id,"slot2;wait;slot3")
}
public cmdGiveWeapon(id){
if (!equali(Weapon_Name[id],"weapon_scoped_fg42") && !equali(Weapon_Name[id], "weapon_scoped_enfield")){
give_item(id,Weapon_Name[id])
}
if(equali(Weapon_Name[id],"weapon_scoped_fg42")){
give_item(id,"weapon_fg42")
set_task(0.2,"cmdMakeScoped",id)
}
if(equali(Weapon_Name[id],"weapon_scoped_enfield")){
give_item(id,"weapon_enfield")
set_task(0.2,"cmdMakeScoped",id)
}
got_weapon[id]++
}
public cmdSay(id) {
new said[32]
read_argv(1,said,31)
read_argv(1,player_weapon[id],31)
if(said[0] != '/')
return PLUGIN_CONTINUE;
for(new i = 0 ; i < MAXWEAPON ; i++) {
if(equali(said[1],WEAPON[i][WMOD_SayCmd])) {
if(get_cvar_num(WEAPON[i][WMOD_Disabled]) != 0){
client_print(id,print_chat, "[Weapons Mod 2.0] This weapon is disabled on this server.")
return PLUGIN_HANDLED
}
if (got_weapon[id] == get_cvar_num("amx_weapon_changes")){
client_print(id,print_chat, "[Weapons Mod 2.0] You've used up your gun changes, you must wait until respawn to change guns again.")
return PLUGIN_HANDLED
}
cmdWeapon(WEAPON[i][WMOD_Weapon],Weapon_Name[id])
client_cmd(id, "drop")
weapon_chosen[id] = 1
set_task(0.3,"cmdGiveWeapon", id)
break;
}
}
return PLUGIN_CONTINUE
}
//If round restarts, change all player's weapons from class defaults to chosen.
public func_new_round() {
if (get_cvar_num("amx_autospawn_weapon") == 1)
{
new i,max_players[32],inum
get_players(max_players,inum,"c")
for(i = 0; i < inum; ++i)
{
if (weapon_chosen[max_players[i]] && is_user_connected(max_players[i]))
{
auto_type = 1
set_task(2.5,"func_auto_change",max_players[i]+150)

}
}
}
}
//If player spawns, change weapon from class default to chosen.
public dod_client_spawn(id) {
if (get_cvar_num("amx_autospawn_weapon") == 1)
{
if (weapon_chosen[id] && is_user_connected(id))
{
auto_type = 0
set_task(0.6,"func_auto_change",id+250)
}
}
}

//Reset id bit if new player takes previous id number.
public client_connect(id) {
weapon_chosen[id] = 0
}

//Make client execute say command with chosen weapon.
public func_auto_change(id) {
new id_type
if (auto_type == 0)
{
id_type = 250
}
else
{
id_type = 150
}
client_cmd(id-id_type,"say %s",player_weapon[id-id_type])
}

Paddock
06-27-2008, 07:44 PM
i have added weapon mod to my server and when someone types in the command for any weapon it only makes them drop their gun and pull out the pistol. can someone help me? also i have noticed i dont have dodx but tfcx on my server is that what could be holding it back?

Tank
06-28-2008, 05:44 PM
Uhm, I am not a hardcore coder or whatever but I've been using this mod for a while. It's the lag which is causing you to drop your main gun and lets you hang with a pistol only.

I don't know why, but these two binds did help me a little when I was playing on a server far away from where I am.....It's not perfect but thats the only advice I can give you.

bind x "wait; say /bar" or bind x "say /bar; say /bar"

The first one helped me the most. The more lag you have on the server, the more waits you could put in.

It also helps when you hit your bind (if you even use a bind) in a spot where there are no other players and/or guns....

About the TFCX...this is what I found, its a team fortress classic module:

The Team Fortress Classic module (TFCX) was developed by SidLuke/ It has two main portions, generic Team Fortress Classic natives and a TFC statistical package. The statistical functions are not listed because they are the same as in the DoDX module.

Hope this helped you a bit

diamond-optic
06-28-2008, 06:36 PM
also i have noticed i dont have dodx but tfcx on my server is that what could be holding it back?

if you are running a dod server, there is no reason for you to be running the tfc addons... you should be running the dod addons

if you are using amxx 1.8.x grab the dod addon package off the nightly builds section of the amxx website: http://www.amxmodx.org/nightly.php

and if you are running an older version of amxx, grab it off of sourceforge: http://sourceforge.net/project/showfiles.php?group_id=100470

Paddock
06-28-2008, 07:26 PM
i know its tfc because my server used to be a tfc server i just dont know how to add dodx

menotyou
06-29-2008, 08:34 PM
Does anyone know if they will be a source plugin like this mod. love the mod but love source two

Zor
06-30-2008, 08:28 AM
SourceMod: its like amxmodx but for Source. As for DoD:Source, in my minor opinion it sucks the shit between baboons ass cheeks. If they coulda fucked it up any more it would be CShit. :) Anyway, yeah check out SourceMod:

http://www.sourcemod.net/

Cheers!

Tank
07-01-2008, 02:24 PM
I seem to having some issues with this plugin lately. With 1 out of 20 people they cannot use the weapons mod 2.0.

They just type /garand in chat like all ways but it does not seem to work. I tell them to reboot their computer and most of the times when they come back on, it's working again.

Any idea what could cause this? Perhaps an interfearence with another plugin? This is my plugins.ini, I did notice when I change the order of plugins in this file, it has some affect on some of the plugins.

syns_booster.amxx ; Allows clients to use a booster after a certain amount of kills
dod_gunz_menu.amxx ; Enables clients to use the gunmenu plugin
WeaponsMod2.amxx ; Enables Weapons Mod 2.0 aka the weapon binds
dod_uberrifles.amxx ; Enables Uber Garand and Uber K43
dod_adminsentinel.amxx ; Enables admins to read enemy chat
dod_killinfo.amxx ; Enables clients to see who shot them and the damage status
dod_say_ratio.amxx ; Enables clients to see their k-d when they die
dod_teammanager.amxx ; Automatic team balancer
sea_banold.amxx ; Allows admins to ban the last 50 clients connected to the server
admin_gag.amxx ; Allows admins to gag people from using voice chat
dod_unlimited_pistolammo.amxx ; Allows clients to have unlimited pistol ammo
dod_xkills.amxx ; Will reset clients score when it reaches 220 to prevent the server from crashing
amx_exec.amxx ; Allows admins to execute commands on clients
dod_meleebonus.amxx ; Clients will get a health bonus when they make a melee kill
dod_playerpush.amxx ; Allows admins to push clients (power set on 15)
dod_holodude.amxx ; Enables clients to create a hologram of theirselves
amx_ejaculate.amxx ; Enables clients to ejaculate

Foxx
07-13-2008, 06:07 AM
Im having trouble installing this, i did what i know unless if im doing something wrong so here's step by step on how i did it, please correct me if im wrong.

1.) Downloaded the WeaponsMod2.amxx (i was told the .sma was not needed)

2.) Dragged into my amxmodmx/plugins folder

3.) Edited the plugins.ini with Notepad ++ and went to 3rd party plugins and typed in WeaponsMod2.amxx and saved, and then overwrote the old plugins.ini (I was also told to hit tab and put ; allows weaponsmod)

4.) Restarted server, typed in /garand to test, Did not work.

If i did anything wrong please let me know!

Tank
07-13-2008, 01:01 PM
I'll explain a few things as it looks to me you haven't done this many times. If I'm explaining something you already know then my apologies for that.

1) You downloaded the *.amxx file. Since this is a developers plugins you don't have to worry. Remember though when you use a plugin from people you don't know or there is no control on their intentions always download the *.sma file to see if there is no little "backdoors" build in. I also always download the *.sma files and put them in dod\addons\amxmodx\scripting

Reason for this is when I want to change something on the plugins (lets say the admin access levels) then I have the original *.sma file always close to me.

You can use the *.sma file and compile it yourself using the online compiler which can be found here: http://www.amxmodx.org/webcompiler.cgi.

2) You did exactly right, nothing to explain or to add

3) If you hit tab and put ; allows weaponsmod is meant to put a comment for yourself. You can type anything. It's just easy when you take a look at your plugins.ini after 2 months that you still know what plugins is doing what and what it's used for.

4) Most of the time a mapchange is sufficient.

You did everything right, what I could advice is turning all your plugins off by doing the following:

Open plugins.ini again, lets say you have the following plugins.

plugins1.amxx
plugins2.amxx
plugins3.amxx
plugins4.amxx
weaponsmod2.amxx

Disable plugins like this

; plugins1.amxx
; plugins2.amxx
; plugins3.amxx
; plugins4.amxx
weaponsmod2.amxx

Why do I advice disabling other plugins? Cause I noticed the weaponsmod sometimes interfear with other plugins. I have a booster which is enabled by typing /boost, if I place my booster underneath weapondsmod2.amxx my booster does not work. So try that and see if it works then.

Hope I helped in any way....I heared that the modules are automatically loaded when needed, but you could perhaps see if the modules are loaded in modules.ini Idk if this is still needed but its worth trying.

I assume though you have the latest amxmodx version and all?

dodsynthetic
07-21-2008, 11:21 AM
Well, I'd like to give thanks to Toolz for creating the original plugin. I redid it from scratch using a different approach to fix some issues and added a new feature:

- Fixes issues with plugins loaded after weaponmod that include /say commands but still will not clog chat with weapon messages from players.

- Scoped enfield and scoped fg42 now come up immediately and do not need to be dropped or have player change weapons. In turn, fixes melee kill bug with scoped enfield.

- Fixes issue of not getting chosen weapon for players with high latency. This might need more testing from the community but seemed to work fine in my tests.

- You no longer need to be on your main weapon to change weapons.

- CVAR names are untouched so you don't have to worry about setting anything.

Unfortunately the source won't fit so you will have to download it:
new_weaponmod.sma (http://www.weaksaucedod.com/new_weaponmod.sma)

Tank
07-23-2008, 02:32 PM
I guess it's time I get to work :D Syn, this evening (my local time) it will be on the server. As Im not anywhere near a decent computer you prolly have to check the testing yourself (sorry about that, wish I had my own computer here)

dodsynthetic
07-23-2008, 11:48 PM
I added a new way of handling high latency players. The way I did it before wasn't good enough. XD Here is the latest. I would just make a whole new thread for this but Toolz was the first to come up with the idea for the weapons mod.

Download Source (http://www.weaksaucedod.com/syns_weaponmod.sma)

Tank
07-24-2008, 05:42 PM
Either it's interfearing with another plugin or there is something not working....

Ok, here are the test result. I got SB (Syn knows what im talking about) in a bunch. Weapons all over the place (like they have been placed by bsp edit) and it's randomly spawning guns from the binds.

Let me go into detail on that. If I have a bind for a bar, I have no idea what will come out. Sometimes it gives me a mp40, sometimes a bar and sometimes a mg42.

I replaced the old weapons mod to keep continuity on the server. If you need me to put it back up, let me know.

dodsynthetic
07-24-2008, 06:39 PM
Somewhere I dropped the ball. HAHA. Checking into it now.

Tank
07-24-2008, 08:41 PM
LOL, since I got the explaination from SB idk how accurate the "weapons all over the place" is. It could also be people just trying to get the right gun.

I do have to say one thing....I was playing on my computer I have at my dads place who can only run on 640x480 wth 256 RAM and getting the guns wasn't even that hard. It's only weird that you get a mg42 when there is no mg42 around.

But the word in the community is that people are really thankfull you are looking into this as we have a lot of eurotrash (im from the netherlands so I guess I can say that) and those are the people having the biggest problems with getting their guns.

dodsynthetic
07-25-2008, 12:48 AM
This should be much better now XD

- Completely changed the weapons dropping scheme. I was making it harder than it needed to be.
- Fixed some issues of sending multiple unneeded client commands on weapon drop.
- Changed some code that was only made to handle 1 player at a time causing players to get other's gun choices. Apparently, mutiple people play DoD at the same time. XD
- Removed dropping weapon entities to ground as they could fall below a player IE stading on an edge or a pile of sandbags.

Download Source (http://www.sarsysoft.com/syns_weaponmod.txt)

diamond-optic
07-25-2008, 01:45 AM
if its working better then the one in this thread.. just post a new thread for it and put a link to the thread in here and we can just close this one

Tank
07-27-2008, 12:22 PM
I will change some minor things and will put this one on the server tonight (for me that is). I advice and thats just my humble opinion, lets test this one first. If all the bugs and stuff is handeled then you could go for a new topic.

menotyou
07-28-2008, 11:11 AM
Weapons Mod 2.0 To DoD:S?? FOR SOURCE MOD
Hi i have asked about getting the Weapons Mod 2.0 To DoD:S?? I was told that it could be done. So if any one could put that togeter i would love it. i use the Weapons Mod 2.0 on my old dod server to this date.
plug-in info
http://www.dodplugins.net/forums/showthread.php?t=699
it is a amxx plug in.......
source mod plugin that may help
http://forums.alliedmods.net/showthr...318#post659318
and
http://forums.alliedmods.net/showthread.php?p=507619
thanks

Tank
07-29-2008, 10:51 AM
Is there a way we keep can keep this discussion 1.3 related? Perhaps your requests fits the request section of these forums more.


Well, I know you just set up your new server but just wanted to let you know that the last version was not quite "it".

Things I noticed are basicly dropping your gun a lot ending you up with a pistol so there is something messing up with the latency on this plugin. The ability that you don't have to select your primary weapon seems to be working perfectly.

dodsynthetic
07-29-2008, 06:57 PM
Yeah, I noticed this too on the new server. I'm going to be doing some changes here to see if I can take care of this. If not, I will see if I can change a player's weapon by directly manipulating the right offset in their memory block. Actually, I will attempt this first because it would be allot easier and neater.

dodsynthetic
07-29-2008, 08:28 PM
Well, unfortunately I couldn't find anything specific in the pdata which is a disappointment. So what I did was add in a few more weapon entity position changes to player's position which are working quite well. I haven't been stuck with a pistol yet. For once my high 300ms ping spikes have been a good thing for testing this plugin. XD I'm going to continue to test things out though, possibly add in some additional checking to verify if the player actually got the weapon then try moving it to their position again if they haven't.

dodsynthetic
07-30-2008, 05:33 AM
After playing all day today with the plugin and getting feedback from players, it seems to be doing great. I also just reduced the time to get weapons. The initial delay was to help keep people from spamming it but amx has protection for that already XD.

===========================
v1.2 Changes
===========================
- Added more aggressive lag/player movement compensation to prevent players from not getting their chosen weapon.
- Reduced time it took before given chosen weapon.

Download Source (http://www.weaksaucedod.com/syns_weaponmod.sma)

Tank
07-30-2008, 02:07 PM
I'll put it on the server right now. As for your comment on the anti-spam build into amxx....it works like a charm, would only be cool if it also would control the voice commands but thats a whole different conversation.

Thanks Syn, im putting it on as we speak and of course I will bug you with updates :D

Tank
07-31-2008, 09:03 AM
Ok, there are my foundings on this version of the weapons mod altered by Syn:

1. It seems guns are flying :D Every now and then you will see guns floating in the air, prolly from a bind used by another.

2. There is still some delay (bigger when in crowded places) which makes you end up with a gun. The thing is a split second later you still have the gun you had binded.

So it's like, while running you press your bind, your primary weapons flies off you, a pistol shows up and a second later you are holding a primairy gun again.

3. All the other functions are working like a charm. People really like the fact they don't have to switch to primary to do a weapon switch.

So from me and the community, thanks.

dodsynthetic
08-03-2008, 07:06 PM
Just so everyone knows, I have started a new thread for my version of this plugin. XD Enjoy!

http://www.dodplugins.net/forums/showthread.php?t=1333

Myers [93rd ID]
11-16-2008, 03:37 PM
for some reason i cant get this to work on my server, it keeps coming up as an unknown plugin

Tank
11-16-2008, 04:02 PM
If you type amx_plugins in your console you often will see an "unknown" in your list if you forgot to actually upload the plugin or that the name from the *.amxx file is different then the one you placed in plugins.ini.

My advice make sure that the *.amxx file has the exact same name as the one you placed in plugins.ini. Perhaps you forgot the extention. My advice check that first before you check anything else.

The 2 questions you want to start:

- is the plugin actually uploaded in amxmodx/plugins
- does the *.amxx name in plugins.ini match the one in amxmodx/plugins?

Vet
01-14-2009, 02:25 PM
So whats going on with these plugins? Is this ToolZ plugin or dodsyn's. Does anyone maintain the original plugin anymore? Does either of these plugins work without bugs of some sort? As someone new into the thread, it seems awfully confusing and screwed up. I can't tell what's going on.

Tank
01-14-2009, 03:13 PM
This is Toolz his plugin, whether it's supported or not I'm not sure.

The reason Synthetic created his version of weapons mod is because Toolz his plugin works great if you have a ping of 20, but if you are like me, an European player connecting to an American server you can only hope the plugin works, basicly when I used this plugin, bound it to a key and pressed it I had to search where the weapon spawned.

This plugin should be (haven't used it in a while because Im using Synthetic's plugin) bug free however, stated above may happen to one of your members.

Not to disrespect Toolz but Synthetic's plugin works great, if there might be any issues Synthetic has been on top of things since the beginning so I recon you wont have to wait long for support.

You can find his version here: http://www.dodplugins.net/forums/showthread.php?t=1333.

Im currently in the middle of a complete server reinstall, so this plugin is not online on my server but before commencing the server reinstall it worked like a dream. No issues being reported by logs.

Vet
01-14-2009, 03:29 PM
Thanks, that explains a lot. I wrote a custom plugin for another member and he wanted it compatible with this plugin. So I needed to bone-up on what was happening in the first place.

Thanks again.

Tank
01-14-2009, 03:40 PM
No problem, here to serve :D Since I'm using this plugin I can only wish for as much people using Syn's plugin as much as possible. The more people using it, the better it's being tested, the better a plugin can become.

Vet
01-17-2009, 02:18 PM
If people are going to use this plugin over the new version, 2 things should be done with this one.

1) The cmdSay routine should end with PLUGIN_CONTINUE. There are several other plugins (stock and public) that use the forwardslash as a qualifier. This plugin, by using PLUGIN_HANDLED, prevents subsequent plugins from getting handled or the 'say /' command from being displayed.
2) A single CVar should be added to enable/disable all gun calls and override the individual CVars. I can think of instances where you may way to temporarily disable it. As it is now, you'd have to set 23 CVars to 0, or pause the plugin. Both inconvenient.

Dr.G
01-18-2009, 11:48 AM
You should attach your update... or at least send it to me lol

Tank
01-18-2009, 02:21 PM
Well, I don't think he created an update but just showed what's wrong with this version if people would like to use it or improve it.

Vet
01-19-2009, 01:01 AM
This modification will address the 2 items I mentioned. Both are handled in the cmdSay routine. (both mods tested and works)
CVar added: amx_disable_weaponsmod <0|1> (Default 0 [enabled])

I can't add the sma as an attachment, so here's the code.

/*
Weapons Mod 2.0
Brought to you by TooLz

Special thanks to DoDPlugins.net for providing the wonderful community!
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <dodx>
#include <fakemeta>

#define MAXWEAPON 23
new got_weapon[32], Weapon_Name[33][32]
enum WeaponData {
WMOD_Weapon,
WMOD_SayCmd[32],
WMOD_Disabled[32]
}
new WEAPON[MAXWEAPON][WeaponData] = {
{DODW_KAR,"k98","amx_disable_k98"}, //0
{DODW_GARAND,"garand","amx_disable_garand"}, //1
{DODW_K43,"k43","amx_disablek43"}, //2
{DODW_M1_CARBINE,"carbine","amx_disable_carbine"}, //3
{DODW_MP40,"mp40","amx_disable_mp40"}, //4
{DODW_THOMPSON,"thompson","amx_disable_thompson"}, //5
{DODW_STG44,"stg44","amx_disable_stg44"}, //6
{DODW_GREASEGUN,"greasegun","amx_disable_greasegun"}, //7
{DODW_SCOPED_KAR,"scopedk98","amx_disable_scopedk98"}, //8
{DODW_SPRINGFIELD,"springfield","amx_disable_springfield"}, //9
{DODW_MG34,"mg34","amx_disable_mg34"}, //10
{DODW_BAR,"bar","amx_disable_bar"}, //11
{DODW_MG42,"mg42","amx_disable_mg42"}, //12
{DODW_30_CAL,"30cal","amx_disable_30cal"}, //13
{DODW_PANZERSCHRECK,"panzerschreck","amx_disable_panzerschreck"}, //14
{DODW_BAZOOKA,"bazooka","amx_disable_bazooka"}, //15
{DODW_ENFIELD,"enfield","amx_disable_enfield"}, //16
{DODW_STEN,"sten","amx_disable_sten"}, //17
{DODW_BREN,"bren","amx_disable_bren"}, //18
{DODW_PIAT,"piat","amx_disable_piat"}, //19
{DODW_FG42,"fg42","amx_disable_fg42"}, //20
{DODW_SCOPED_FG42,"scopedfg42","amx_disable_scopedfg42"}, //21
{DODW_SCOPED_ENFIELD,"scopedenfield","amx_disable_scopedenfield"} //22
}
public plugin_init()
{
register_plugin("Weapons Mod 2.0","2.0","TooLz")
register_event("ResetHUD","respawn","be")
register_clcmd("say","cmdSay",0,"- Checks which weapon was said")
register_cvar("amx_weapon_changes", "2")
register_cvar("amx_disable_weaponsmod","0")
register_cvar("amx_disable_scopedfg42","0")
register_cvar("amx_disable_scopedenfield","0")
register_cvar("amx_disable_k98", "0")
register_cvar("amx_disable_garand", "0")
register_cvar("amx_disable_carbine", "0")
register_cvar("amx_disable_k43", "0")
register_cvar("amx_disable_mp40", "0")
register_cvar("amx_disable_thompson", "0")
register_cvar("amx_disable_stg44", "0")
register_cvar("amx_disable_bar", "0")
register_cvar("amx_disable_fg42", "0")
register_cvar("amx_disable_greasegun", "0")
register_cvar("amx_disable_bazooka", "0")
register_cvar("amx_disable_enfield", "0")
register_cvar("amx_disable_sten", "0")
register_cvar("amx_disable_mg42", "0")
register_cvar("amx_disable_mg34", "0")
register_cvar("amx_disable_30cal", "0")
register_cvar("amx_disable_springfield", "0")
register_cvar("amx_disable_scopedk98", "0")
register_cvar("amx_disable_bren", "0")
register_cvar("amx_disable_panzerschreck", "0")
register_cvar("amx_disable_piat", "0")
}
public respawn(id){
got_weapon[id] = 0
}
stock detect_weapon_id(id) {
// Big thanks to Wilson for this stock!
new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];
new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);
xmod_get_wpnlogname(m_iWpn, m_szWpn, 31);
format(m_szWpn, 31, "weapon_%s", m_szWpn);
if(equal(m_szWpn, "weapon_scoped_enfield")) m_szWpn = "weapon_enfield";
if(equal(m_szWpn, "weapon_scoped_fg42")) m_szWpn = "weapon_fg42";
new Float:m_flOrigin[3];
pev(id, pev_origin, m_flOrigin);
while((m_iCurEnt = engfunc(EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0)) != 0) {
new m_szClassname[32];
pev(m_iCurEnt, pev_classname, m_szClassname, 31);
if(equal(m_szClassname, m_szWpn))
m_iWpnEnt = m_iCurEnt;
}
return m_iWpnEnt;
}
stock cmdWeapon(WeaponID, WeaponName[32]) {
xmod_get_wpnlogname(WeaponID, WeaponName, 31);
format(WeaponName, 31, "weapon_%s", WeaponName);
}
stock dod_get_scoped(id) {
new m_iCurEnt = -1, m_iWpnEnt = 0, m_szWpn[32];
new clip, ammo, m_iWpn = get_user_weapon(id,clip,ammo);
new is_scoped
xmod_get_wpnlogname(m_iWpn, m_szWpn, 31);
format(m_szWpn, 31, "weapon_%s", m_szWpn);
if(equal(m_szWpn, "weapon_scoped_enfield")) m_szWpn = "weapon_enfield";
if(equal(m_szWpn, "weapon_scoped_fg42")) m_szWpn = "weapon_fg42";
new Float:m_flOrigin[3];
pev(id, pev_origin, m_flOrigin);
while((m_iCurEnt = engfunc(EngFunc_FindEntityInSphere, m_iCurEnt, m_flOrigin, Float:1.0)) != 0) {
new m_szClassname[32];
pev(m_iCurEnt, pev_classname, m_szClassname, 31);
if(equal(m_szClassname, m_szWpn))
m_iWpnEnt = m_iCurEnt;
}
is_scoped = get_pdata_int(m_iWpnEnt,115,4);
return is_scoped;
}
public cmdMakeScoped(id){
new is_scoped = dod_get_scoped(id)
while(is_scoped != 1){
is_scoped = dod_get_scoped(id)
set_pdata_int(detect_weapon_id(id),115,1,4)
}
client_cmd(id,"slot2;wait;slot3")
}
public cmdGiveWeapon(id){
if (!equali(Weapon_Name[id],"weapon_scoped_fg42") && !equali(Weapon_Name[id], "weapon_scoped_enfield")){
give_item(id,Weapon_Name[id])
}
if(equali(Weapon_Name[id],"weapon_scoped_fg42")){
give_item(id,"weapon_fg42")
set_task(0.2,"cmdMakeScoped",id)
}
if(equali(Weapon_Name[id],"weapon_scoped_enfield")){
give_item(id,"weapon_enfield")
set_task(0.2,"cmdMakeScoped",id)
}
got_weapon[id]++
}
public cmdSay(id) {
new said[32]
read_argv(1,said,31)
if(said[0] != '/')
return PLUGIN_CONTINUE;
for(new i = 0 ; i < MAXWEAPON ; i++) {
if(equali(said[1],WEAPON[i][WMOD_SayCmd])) {
if (get_cvar_num("amx_disable_weaponsmod")) {
client_print(id,print_chat, "[Weapons Mod 2.0] Plugin is currently disabled.")
return PLUGIN_HANDLED
}
if (get_cvar_num(WEAPON[i][WMOD_Disabled]) != 0) {
client_print(id,print_chat, "[Weapons Mod 2.0] This weapon is disabled on this server.")
return PLUGIN_HANDLED
}
if (got_weapon[id] == get_cvar_num("amx_weapon_changes")) {
client_print(id,print_chat, "[Weapons Mod 2.0] You've used up your gun changes, you must wait until respawn to change guns again.")
return PLUGIN_HANDLED
}
cmdWeapon(WEAPON[i][WMOD_Weapon],Weapon_Name[id])
client_cmd(id, "drop")
set_task(0.3,"cmdGiveWeapon", id)
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}

Tank
01-19-2009, 07:48 AM
This is Vet's update but then in sma form. Great work Vet.

Dr.G
01-19-2009, 11:35 AM
Thanks! :)

Vet
01-19-2009, 12:06 PM
Necessity is the mother of revisions.

Legend Born
03-14-2009, 07:05 PM
Anyone know how to add the folding carbine to this code? I tried replacing references to the MG34 (since no one uses it) with variations of fcarbine, folding_carbine, etc., and could never get it to show up. Any help?

diamond-optic
03-14-2009, 08:00 PM
im pretty sure the carbine version is determined by whether the team is para or not.. Ive noticed that if a para axis has a carbine, its the folding stock version, but if he drops it and say a british player picks it up.. its the normal carbine.. then again if he drops it and the axis para player picks it up again it goes back to being folding stock

tho i have wanted to check out pdata values and see if theres a way to force the folding stock version thru them, just havent got around to it yet

Legend Born
03-14-2009, 09:04 PM
Maybe a stupid question then but, how do I know if I'm on a para team? I've seen the term used since I've started messing with plugins and maps, etc., but don't know what it refers to. First time I saw it mentioned I thought it referred to maps that you need parachutes on, or that (story-wise) you supposedly already parachuted into. Guess I can always just try for a carbine on every map, see if it's the folding version.

diamond-optic
03-14-2009, 09:08 PM
well the player models are different for one, the para models are actually a lot better looking lol.. and as for the the axis team, you have access to the fg42's..

any map can be set to use the para versions of the teams (except theres no british para) by editing the info_doddetect entity.. and im pretty sure theres a plugin around here somewhere that lets you set the teams to para easily without having to edit the entity in the bsp manually.. but i cant recall what its name was

not really sure about any other differences since i dont play dod that much anymore lol


*edit*

ok found it lol: http://www.dodplugins.net/forums/showthread.php?t=294

stryker
03-20-2009, 10:41 AM
please, tell me how to install the plugin :D my email is sweden_stryker@live.se if you will help.

Dr.G
03-20-2009, 12:48 PM
google buddy (http://lmgtfy.com/?q=how+to+install+amxx+plugins%3F)

Legend Born
04-06-2009, 01:56 PM
Just an update, in case anyone reads the last few messages...

I added the dodw_folding_carbine in the code, everything compiles fine, but when you call the weapon it just changes to the pistol. I understand what Diamond was saying (I think) but what DOESN'T make sense is that the folding version is its own weapon, even shows up on Psychostats as a different weapon than the normal carbine. Which to me just seems like it should show up. The FG is a para weapon isn't it? Yet everyone can use it, even the British. Although there is special code to call the FG in the source which is beyond my limited knowledge, so maybe that's the prob, lol. Ah well.

CLICKBOOM
10-14-2009, 10:56 PM
This server has a plugin,mod, or script i been looking for for days.
68.196.124.73:27015

It is a weapons mod that allows you to change weapons from the regular classs button {,}. It has all the dod weapons available in the class menu and instead of typing /garand or whatever, all you have to do is choose from the class button. there is 6 meenus of weapons in that class button{all the dod weapons.

PLEASE PLEASE if someone could help me ge this i will donate to whatever you would like me to.

Please check this server out n help me THANK YOU. 68.196.124.73:27015