Garry's Mod

Garry's Mod

116 次評價
STMagazines Rewrite
   
獎勵
加入最愛
已加入最愛
移除最愛
Content Type: Addon
Addon Type: Weapon
Addon Tags: Roleplay, Realism
檔案大小
發佈於
更新時間
5.837 KB
2017 年 4 月 12 日 下午 4:22
2019 年 4 月 26 日 下午 8:52
11 項更新註記 (檢視)

訂閱以下載
STMagazines Rewrite

在 SweptThr.one 的 1 個收藏中
SweptThrone Catalogue
135 個項目
描述
A proof of concept for a simple mag system.

//

This addon is old and bad. I'm pretty sure it uses one table for ALL mags, so EVERY player will share magazines! I don't recommend using this unless you're in singleplayer!

DO NOT PACK THIS BASE WITH YOUR WEAPON. I WILL BE UPDATING THIS FREQUENTLY. PLEASE ADD IT AS REQUIRED INSTEAD!

Throneco's rolling out the big guns today, releasing the alpha version of our very own weapon base!

The STMagazines Base is a simple weapon base that, instead of using a mass reserve of ammo in an infinite amount of mags, uses a set amount of mags with a pre-defined ammo type. This means that if you fire 8 rounds out of a 20-round mag, you will eventually load an 11-round mag regardless (chambering implemented!)

This base is pretty easy to convert, just a quick switch from the M9K or TFA base to "st_mags_base" and a few other modifications should render a perfectly usable weapon!

These few modifications are:
SWEP.Scoped - If true, zooms in your screen instead of iron-sighting.
SWEP.Sniper - If true, zooms in twice instead of iron-sighting.
SWEP.Zoom - Set to 0 if one of the above is set to true.
SWEP.Revolver - If true, the mag is completely emptied before reloading, because you typically don't catch falling rounds.
SWEP.Primary.DeploySound - Custom sound path that plays when the weapon is deployed.
SWEP.Primary.ReloadSound - Custom sound path that plays when the weapon is reloaded.
Shotguns are not supported.

When converting, make sure to use one of the following SWEP.Primary.Ammo types or make your own. These can be found here[pastebin.com].

With the rewrite, there are two new functions to make this base more user friendly. Player:GiveMagazines( type, number=1 ) and RegisterNewMagazine( type, bullets ).
These are not implemented in any way by default, if you wanna create an entity or script using these, go ahead.

There are bound to be many errors with this base, as it is in alpha. Please report any and all bugs or errors in the comments.

Known "issues":
There's no recoil, and accuracy sucks.

Future plans:
Add shotgun support.
Add a scope texture.
Add a custom scope sound.


[sweptthr.one]

Credits:
Valve - Models and sounds
Facepunch - Ironsights code
Gamebanana - Scope code
21 則留言
Bubble Merchant 2022 年 9 月 17 日 上午 9:18 
Thanks i'll try that.
SweptThr.one  [作者] 2022 年 9 月 16 日 下午 11:13 
you could do
lua_run Entity( 1 ):GiveMagazines( "typeOfMagazine", 5 )
in server console, where 5 is however magazines you want and typeOfMagazines is obviously the type of magazines
Bubble Merchant 2022 年 9 月 16 日 下午 10:14 
I did try grabbing more through spawning the same weapon but that didn't seem to do anything when trying to pick it up. I ask simply cuz I dig these kinda modifications to the old hl2 weapons. Thanks for your time though.
SweptThr.one  [作者] 2022 年 9 月 16 日 下午 6:12 
i think you gotta middle-click to spawn more of the weapons, but maybe not. regardless, this is kinda poorly made
Bubble Merchant 2022 年 9 月 16 日 下午 5:56 
How does one get new magazines once their original mags have been depleted?
SweptThr.one  [作者] 2020 年 12 月 13 日 上午 10:52 
maybe, except a lot shittier
tangoo 2020 年 12 月 13 日 上午 10:51 
So is this similar to the CW2.0 magazine system?
Manckeynaut 2019 年 6 月 23 日 下午 6:44 
Update when I like the mag system pls bb
oranchecsgo 2018 年 7 月 3 日 下午 7:55 
Also, idk if youd actually take suggestions, but i think there should be magazine entities, if theyre already arent.
oranchecsgo 2018 年 7 月 3 日 下午 7:53 
Where should i spawn the magazines, if thats possible?