[L4D] Limit ammo pile usage to 1 clip per use
Hi coders,
I am trying to limit the ammo pile usage to 1 clip per usage but the script below always assigns the maximum of 360 ammo for rifle (for example). PHP Code:
I thought "m_iAmmo_prim" would deliver the current amount of ammo the player has got, but it always returns the maximum possible obviously. Any ideas how to retrieve the CURRENT amount of ammo for the player or what I am doing wrong here? |
Re: [L4D] Limit ammo pile usage to 1 clip per use
Next time try to search or google the exact problem you have, that's why it's there. :P
Possibly try this, you maybe missed it? https://forums.alliedmods.net/showthread.php?t=81546 |
[L4D] Limit ammo pile usage to 1 clip per use
I read this thread several times. It's almost the same method but he works with offsets. I tried to copy his code and received the same results.
I googled and searched everything for iAmmo but it doesnt return the actual amount the player has but the maximum possible. |
Re: [L4D] Limit ammo pile usage to 1 clip per use
Quote:
O..o well... idk if it'd work but what about when a client activates the ammo pickup event, get his weapon with GetClientWeapon, then GiveWeaponAmmo to that client based on what weapon it is, then return plugin handled? |
[L4D] Limit ammo pile usage to 1 clip per use
I can set a value of 99 ammo or whatever. But I cant get the current amount of ammo or add anything. Just set the amount.
|
Re: [L4D] Limit ammo pile usage to 1 clip per use
Why the heck are you not using the convars?
ammo_assaultrifle_max = 50 ammo_buckshot_max = 10 ammo_huntingrifle_max = 15 ammo_smg_max = 50 |
[L4D] Limit ammo pile usage to 1 clip per use
Because I am trying to limit the amount of ammo in an ammo pile not the maximum amount of ammo in a gun.
|
Re: [L4D] Limit ammo pile usage to 1 clip per use
Quote:
|
[L4D] Limit ammo pile usage to 1 clip per use
I did examine that plugin. It is clear to me what it does. I have all the code I need. I just cant get the value for the amount of ammo the survivor deploys. But I think this is because its not there. The game just sets ammo to max when using the pile. A guy tried to limit ammo pile usage to 1 clip and failed also
|
Re: [L4D] Limit ammo pile usage to 1 clip per use
Quote:
|
All times are GMT -4. The time now is 13:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.