AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:GO] - ⋯ Ammo management | Set correctly the ammo amout for each weapons (https://forums.alliedmods.net/showthread.php?t=263717)

Dr. Api 05-31-2015 11:34

[CS:GO] - ⋯ Ammo management | Set correctly the ammo amout for each weapons
 
I - Description

Everytime I had a Valve update "items_game.txt" was reset.
So I did this plugin for my community Zombie4ever.eu and Zombie Escape/Riot servers.
Allow you to manage weapon ammo instead of using "items_game.txt"

II - Cvars

drapi_ammo_338mag_max "30" - AWP
drapi_ammo_357sig_max "52" - HPK2000
drapi_ammo_357sig_min_max "12" - CZ75
drapi_ammo_357sig_p250_max "26" - P250
drapi_ammo_357sig_small_max "24" - USP-S
drapi_ammo_45acp_max "100" - FIVESEVEN
drapi_ammo_50AE_max "35" - DEAGLE
drapi_ammo_556mm_box_max "200" - M249, NEGEV
drapi_ammo_556mm_max "90" - M4A1, AK47, FAMAS, GALILAR
drapi_ammo_556mm_small_max "40" - M4A1-S
drapi_ammo_57mm_max "100" - P90, UMP45, MAC10
drapi_ammo_762mm_max "90" - SSG08, AUG, SG556, G3SG1, SCAR20
drapi_ammo_9mm_max "120" - ELITE, TEC9, MP7, MP9, GLOCK, BIZON
drapi_ammo_buckshot_max "32" - MAG7, NOVA, SAWEDOFF, XM1014

This are default ammo. Don't put less than this values in your config "/csgo/cfg/sourcemod/drapi/drapi_ammo.cfg".

III - Bugs

FIXED - For no reason, if you reach 0 ammo you will get in plus default ammo of weapon.
So what I did for example, AK47 Weapon ammo = drapi_ammo_556mm_max - default ammo.


VI - Credits

SMLIB for some useful functions

VII - Changelogs

Quote:

V1.3.1
-Fixed ump45, mac10 -> ammo_45acp_max, fiveseven -> ammo_57mm_max, ak47 -> ammo_762mm_max

V1.3.0
Use m_iItemDefinitionIndex to simplify.

V1.2.0
-Added M4A1.
-No bug anymore when reach 0. Ammo are set correctly.

V1.1.2
-Detect weapons silencer.

V1.1.1
-Correct ammo when round start.

V1.1.0
-Tried on differents SM version works.

VIII - Credits

Anjin to check and tell me the correct cvars.

IX - Donate

If you like my work.

https://www.paypalobjects.com/en_US/...onateCC_LG.gif


X - Download
GIT

Dr. Api 06-01-2015 06:21

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
V1.1.0 Tried on differents SM version works.

shtopor 06-02-2015 04:57

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
Nice plugin!

Code:

#include <autoexec>
what is it? why without it I can not compile the plugin?

Dr. Api 06-02-2015 07:46

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
Quote:

Originally Posted by shtopor (Post 2303859)
Nice plugin!

Code:

#include <autoexec>
what is it? why without it I can not compile the plugin?

It's on the zip file. It's include who making the drapi_ammo.cfg dynamically. For example if I change a cvar or rename you will need to delete the drapi_ammo.cfg and reboot your server.

shtopor 06-02-2015 09:29

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
ok, thx.
Another question: why, in the plugin installed and configured, the game displays the same number of ammo?
example:
in game M4A1-S - 20/40
in drapi_ammo.cfg: M4A1-S - 80

Dr. Api 06-02-2015 10:02

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
Quote:

Originally Posted by shtopor (Post 2303918)
ok, thx.
Another question: why, in the plugin installed and configured, the game displays the same number of ammo?
example:
in game M4A1-S - 20/40
in drapi_ammo.cfg: M4A1-S - 80

Cause you have to increase this number.
M4A1-S should put more than 80 cause at base you have 80 ammo on the M4A1-S.

rodpod 06-02-2015 14:52

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
could you add execution on player spawn to your script??

Dr. Api 06-02-2015 14:56

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
Quote:

Originally Posted by rodpod (Post 2304009)
could you add execution on player spawn to your script??

Sorry the function for the round start was here but I forgot to trigger it. Wait a minute I upload that.

rodpod 06-02-2015 15:46

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
ok. works but not instantly in buyzone. when i bought p250 (changed to 52 ammo) i still saw 26 ammo in reserve. when i switched weapons and went back to secondary it showed 52 bullets. fired 3 rounds, reloaded, 49 bullets in reserve. works like a charm. maybe a little delay (timer 0.2) after purchasing?

[edit]
my bad. timer works.

cheers mate

Dr. Api 06-02-2015 15:52

Re: [CSGO] - Ammo management | Zombie Escape / Riot
 
Quote:

Originally Posted by rodpod (Post 2304029)
ok. works but not instantly in buyzone. when i bought p250 (changed to 52 ammo) i still saw 26 ammo in reserve. when i switched weapons and went back to secondary it showed 52 bullets. fired 3 rounds, reloaded, 49 bullets in reserve. works like a charm. maybe a little delay (timer 0.2) after purchasing?

[edit]
my bad. timer works.

cheers mate

Yes, I put a datatimer to 0.5 but I can put for 0.0 next version.


All times are GMT -4. The time now is 08:26.

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