AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   DoDs Equipment 0.0.6 (https://forums.alliedmods.net/showthread.php?t=74390)

Lis 07-17-2008 20:12

DoDs Equipment 0.0.6
 
3 Attachment(s)
New version is here:
http://forums.alliedmods.net/showpos...0&postcount=41

Thanks to Lebson506th

Hello.

My first plugin for sourcemod is ready.
This plugin allows you to give any weapon to any class and it allows to modify the weapons ammunitions on the fly.

It has been tested on 2 dods servers and it works and compiles.
Since version 0.0.6 every weapon and ammo change was tested and works.

I want to thank strontiumdog for his [DODS] Pistols UPDATED July 15, 2008 code. He made me understand the m_iAmmo offsets faster.

I want to thank teame06 for his GunGame:SM code. His code made me able to understand the virtual function handling faster.

Requirements:
This Plugin will not work with any other nightly sourcemod builds older than 1.1.0-r2400.
According to Lee this plugin also works with 1.0.4svn.
Maybe it will work on other version (with exception of the 1.0.3 release, this version is not compatible), i have not tested it.

Known bugs:
If you assign more than 4 different weapons you aren't able to select all of them with keys. Throwing some weapons away is one of the workarrounds. If you assign a value greater than 9999 to the ammo, the clips get a random size. This is due to array memory limitations.






Next improvements & CURRENT VERSION 0.0.6:
  • DONE: (planned this week) Nicer code and the use of functions (0.0.2).
  • DONE-partially: Support for removing equipment on the fly (0.0.3).
  • FIXED: fixed the riflegren bug. You can now set the amount of riflegrens for the rifleman class. (0.0.4)
  • DONE: Nicer code and more errortesting (0.0.4)
  • FIXED: Fixed a mg ammo bug. You can now set the mg ammo. (0.0.5)
  • FIXED: Refixed the mg ammo, i have tested it and it works now. sorry for the mistake... (0.0.6)
  • Includes for other plugins so you can equip on a given event. (Chancelled due to the possibility to exec configs. If someone wants this feature message me.)
  • Set the equipment for single players.
The CSS version is comming soon.




Installation:
  1. Upload the .cfg into <DoDModDir>/cfg/sourcemod
  2. Upload the .smx file into <DoDModDir>/addons/sourcemod/plugins
  3. Type into HLSW or into the gameserver console: sm plugins refresh
Update:
  1. Upload the new dod_equip.smx into the <DoDModDir>/addons/sourcemod/plugins folder.
  2. Upload the new dod_equip.cfg into <DoDModDir>/cfg/sourcemod
  3. type into the hlsw or into the gameserver console:
    sm plugins list
    you will get a list with loaded plugins. The list has the form
    "NUM Name Author ..."
    Remember the NUM and type into the console
  4. sm plugins unload NUM
    then type
  5. sm plugins refresh
Configuration:
Be shure to get the new config. All cvar names are changed.
Sorry for this change but in the jungle of server cvars its important to have them structured.
They will not be changed again.
You can only assign 4 whitespace seperated values in one cvar.
The ammo numbers are not allowed to exceed 9999!!!!!!!!
The configuration file holds 3 server cvars for each class.

The first cvar is used to remove all equipment from the class before the assignment of any other equipment.
The second cvar for one class is the equipment cvar. You set the weapons in this cvar.
The third cvar is the corresponding ammunition cvar. You set the weapon ammo corresponding to the the weapon, whitch was set in the equipment cvar.
Every weapon an every ammo assignment needs to be seperated with a whitespace.
Every weapon assignment needs a ammo asignment.
If you set the clear cvars to "yes" all weapons are removed prior to equiping. This means only the weapons equiped in the cvars are aviable to the players.

Here are two examples that have the same result:
sm_equip_rifle_clear_ger "no"
sm_equip_rifle_equip_ger "weapon_riflegren_ger weapon_p38"
sm_equip_rifle_ammo_ger "3 80"

sm_equip_rifle_clear_ger "no"
sm_equip_rifle_equip_ger "weapon_p38 weapon_riflegren_ger"
sm_equip_rifle_ammo_ger "80 3"

Example 999 ammo for the assault class primary weapon 3 smokes and 3 frags:
sm_equip_assault_clear_us "no"
sm_equip_assault_equip_us "weapon_thompson weapon_smoke_us weapon_frag_us"
sm_equip_assault_ammo_us "999 3 3"


Example 999 bullets for the us sniper. The us sniper also gets the 30cal with 9999 bullets, the colt with 70 bullets and 3 frag grenades.
After coding version 0.0.3 of this plugin i found a possible workarround to let the sniper class select the mg. If it works i will post it here.
sm_equip_sniper_clear_us "no"
sm_equip_sniper_equip_us "weapon_30cal weapon_spring weapon_colt weapon_frag_us"
sm_equip_sniper_ammo_us "9999 999 70 3"

Have fun with the plugin.

monkman 07-17-2008 22:08

Re: DoDs Equipment
 
i will check this out. thanks

just a heads up, it says counterstrike source for category at the top of this page.

INsane_dod 07-19-2008 19:04

Re: DoDs Equipment
 
Will this be able to strip all weapons at map start via a map config?

There is a football map I would like to do this on :)

Lis 07-19-2008 19:31

Re: DoDs Equipment
 
If you are on DoDs you are able to create a .cfg file with the map name in the DoDModDir/cfg folder. This config is executed if the map is loaded.

dod_football.cfg would be executed if you change the map do dod_football. You can put all needet cvars into this .cfg.

CSS does not have such a feature. Thought you can ask http://forums.alliedmods.net/showthread.php?p=590466 this guy if he implements a per map config execution.

Last thing is:
This plugin does not support removing of weapons currently. You need to wait until version 0.0.3 arrives :D. Since you made your request i try to speed things up a little.

@monkman:
Oh yes thanks and sorry.
Changed the category.

DJ Tsunami 07-19-2008 21:24

Re: DoDs Equipment
 
As far as I know CS:S does have map specific configs built in, but I'm not sure. Anyway, I was planning on adding that to my plugin, but I don't have much time at the moment to update it. But there are plenty of plugins that do map specific configs, as listed here.

Lis 07-19-2008 21:42

Re: DoDs Equipment
 
@DJ Tsunami:

Ah you are right. I missed that.

http://www.steampowered.com/platform...%20Source.html

Look at May 12, 2005:
When a map is loaded, an associated .cfg file is automatically evaluated. This cfg file must be located in the cstrike/maps/cfg folder and be named <mapname>.cfg. For instance, the file cstrike/maps/cfg/de_dust.cfg will be evaluated when the map de_dust is loaded. This is useful for per-map rules, bot rosters, etc.

spacedkadet 07-21-2008 11:51

Re: DoDs Equipment 0.0.3
 
Love the plugin, very useful!!I do have one thing i cant get to work righ though;
I cannot get more than the default number of rifle grenades, i have this code:

Code:

sm_dod_rifle_clear_ger "yes"
sm_dod_rifle_equip_ger "weapon_k98 weapon_riflegren_ger"
sm_dod_rifle_ammo_ger "500 250"
sm_dod_rifle_clear_us "yes"
sm_dod_rifle_equip_us "weapon_garand weapon_riflegren_us"
sm_dod_rifle_ammo_us "500 250"

have also tried this:

Code:

sm_dod_rifle_clear_ger "no"
sm_dod_rifle_equip_ger "weapon_k98 weapon_riflegren_ger weapon_p38"
sm_dod_rifle_ammo_ger "500 250 150"
sm_dod_rifle_clear_us "no"
sm_dod_rifle_equip_us "weapon_garand weapon_riflegren_us weapon_colt"
sm_dod_rifle_ammo_us "500 250 150"

I get the pistols and the extra rifle ammo but no extra rifle nades.

Windows server sm version 1.0.4svn (latest as of time of this post)
Other wise great plugin!

Lee.

Lis 07-21-2008 14:27

Re: DoDs Equipment 0.0.3
 
Thanks for your response Lee. Nice to hear you like it.

I tried the same and it seems the script does not set the riflegrenades in the right way. Thats a script bug and not your fault, sorry for this error. I will fix this within the next days.

Since i havent found any riflegren ammo offsets i try to find another way to set the ammount of rifflegrenades.

[EDIT]
A dods uses offsets for the riflegrens i just did not saw them the first time.

Kahless 07-25-2008 02:09

Re: DoDs Equipment 0.0.4
 
what do each of the configs do?

Lis 07-25-2008 04:58

Re: DoDs Equipment 0.0.4
 
The first config simply gives some classes 3 frag grenades and more pistol ammo. The rifleclass also gets a pistol.
The second config is the one i use with the dod_balls map.
The dod_balls config sets 100 grenades 600 rockets 1000 mg ammo and so on.


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

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