AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Adding ammo slots (https://forums.alliedmods.net/showthread.php?t=62463)

hleV 10-27-2007 17:54

Adding ammo slots
 
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?

Wilson [29th ID] 10-27-2007 20:41

Re: Adding ammo slots
 
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.

ConnorMcLeod 10-27-2007 20:47

Re: Adding ammo slots
 
He wants to be able to buy more bullet than allowed, aka increase bpammo limit.

Wilson [29th ID] 10-28-2007 14:42

Re: Adding ammo slots
 
ooooh. In that case, you have to send a WeaponList message and increase the ammo amount.

hleV 10-28-2007 18:04

Re: Adding ammo slots
 
So, can you make the code?

Friday13 10-31-2007 14:49

Re: Adding ammo slots
 
Some one make the code. +Karma.

mikes3ds 10-31-2007 16:22

Re: Adding ammo slots
 
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

ConnorMcLeod 10-31-2007 17:18

Re: Adding ammo slots
 
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 ?

Friday13 11-04-2007 13:55

Re: Adding ammo slots
 
Anybody?

Wilson [29th ID] 11-04-2007 19:11

Re: Adding ammo slots
 
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.


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

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