Raised This Month: $ Target: $400
 0% 

Adding ammo slots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-27-2007 , 17:54   Adding ammo slots
Reply With Quote #1

Can I get code of how to add slots to weapon's ammo (all weapons the same ammo amount), I don't need to set user's bpammo, need only additional slots. Like M4A1 (default 30/90) would have 30/200 (after buying full bullets), but when player spawns and buy's M4A1, he would have 30/0 (he must buy the bullets, not get it). Anybody?
hleV is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-27-2007 , 20:41   Re: Adding ammo slots
Reply With Quote #2

I don't understand the first portion of your message at all..not sure what you're trying to do.

If you are trying to make a player start with 30/0 when he buys an M4A1, just set the user's ammo to 30 when he gets the weapon.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-27-2007 , 20:47   Re: Adding ammo slots
Reply With Quote #3

He wants to be able to buy more bullet than allowed, aka increase bpammo limit.
ConnorMcLeod is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-28-2007 , 14:42   Re: Adding ammo slots
Reply With Quote #4

ooooh. In that case, you have to send a WeaponList message and increase the ammo amount.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-28-2007 , 18:04   Re: Adding ammo slots
Reply With Quote #5

So, can you make the code?
hleV is offline
Friday13
Junior Member
Join Date: Oct 2007
Old 10-31-2007 , 14:49   Re: Adding ammo slots
Reply With Quote #6

Some one make the code. +Karma.
Friday13 is offline
mikes3ds
Member
Join Date: Jul 2005
Location: CA
Old 10-31-2007 , 16:22   Re: Adding ammo slots
Reply With Quote #7

Hey Wilson [29th ID] long time no see

http://wiki.alliedmods.net/Half-Life...nts#WeaponList


Also I think this will also work.
cs_set_user_bpammo
__________________
[img]http://img529.**************/img529/3995/omg6gp.png[/img]
mikes3ds is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-31-2007 , 17:18   Re: Adding ammo slots
Reply With Quote #8

I tried to increase the PrimaryAmmoMaxAmount by setting the message argument, but it doesn't work.
Decrease doesn't work either as you can see for m249 ammo.

Code:
#include <amxmodx> enum PcvarsNum {     awp,     scout,     m249,     famas,     m3,     usp,     fiveseven,     deagle,     p228,     glock18 } new pcvar[PcvarsNum] public plugin_precache() {     register_message( get_user_msgid("WeaponList") , "msg_WeaponList")     pcvar[awp] = register_cvar("max_ammo_awp", "30")    // 30     pcvar[scout] = register_cvar("max_ammo_scout", "180") // 90     pcvar[m249] = register_cvar("max_ammo_m249", "100") // 200     pcvar[famas] = register_cvar("max_ammo_famas", "180") // 90     pcvar[m3] = register_cvar("max_ammo_m3", "32") // 32     pcvar[usp] = register_cvar("max_ammo_usp", "100") // 100     pcvar[fiveseven] = register_cvar("max_ammo_fiveseven", "100") // 100     pcvar[deagle] = register_cvar("max_ammo_deagle", "35") // 35     pcvar[p228] = register_cvar("max_ammo_p228", "52") // 52     pcvar[glock18] = register_cvar("max_ammo_glock18", "120") // 120 } public plugin_init() {     register_plugin("AmmoMaxAmount","0.1","connor") } public msg_WeaponList() {     new num = get_msg_arg_int(2)     set_msg_arg_int(3, 0, get_pcvar_num(pcvar[PcvarsNum:num]))     return PLUGIN_CONTINUE }

Any ideas ?
ConnorMcLeod is offline
Friday13
Junior Member
Join Date: Oct 2007
Old 11-04-2007 , 13:55   Re: Adding ammo slots
Reply With Quote #9

Anybody?
Friday13 is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-04-2007 , 19:11   Re: Adding ammo slots
Reply With Quote #10

You can't just intercept it and change it. Try adding an echo line right after that set_msg_arg_int - you will probably never see it echoed.

Instead of intercepting it, send it yourself.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:20.


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