bullets problem
i made one plugin that removes spawn equip, but how is it possible to remove bullets from given gun and then give bullets to it?
|
Re: bullets problem
Yes it has something to do with:
cs_set_weapon_ammo(id , 12); cs_get_weapon_ammo() |
Re: bullets problem
http://www.amxmodx.org/funcwiki.php?go=func&id=185 // Get Ammo in Backpack
http://www.amxmodx.org/funcwiki.php?go=func&id=186 // Set Ammo in Backpack http://www.amxmodx.org/funcwiki.php?go=func&id=207 // Get Ammo in current Clip http://www.amxmodx.org/funcwiki.php?go=func&id=208 // Set Ammo in current Clip ( Those four do not ask for players id - the entity ID of the weapon is meant ) http://www.amxmodx.org/funcwiki.php?go=module&id=4 // Weapon IDs ( NOT the Entity IDs - Entity IDs vary on every weapon on the servers instance of a map, situation and time ) http://www.amxmodx.org/funcwiki.php?go=func&id=156 // Get currently carried Weapon http://www.amxmodx.org/funcwiki.php?go=func&id=163 // Get list of all owned Weapons ( First get the Weapons ID(s) ( NOT Entity ID(s) ) ) http://www.amxmodx.org/funcwiki.php?go=func&id=617 // Call a Function in the Engine ( This requires Fakemeta - Use this in a loop to get Weapons Entity IDs ) ( Use EngFunc_FindEntityByString with "classname" and "weapon_whatever" ) Here is a list of weapon names: Code:
weapon_knifehttp://www.amxmodx.org/funcwiki.php?go=func&id=164 // Changes a Weapons ID into its classname, like into those shown in the code block above - probably easier to use this. http://www.amxmodx.org/funcwiki.php?go=func&id=609 // Retrieves Keyvalues from Entities ( Use pev_owner on the Weapon Entity IDs retrieved with engfunc to get correct Players Weapon ) ( Also uses Fakemeta ) If you are clever enough, you can put these functions together into a simple function which can change the ammo of one of a players weapon. |
Re: bullets problem
if i use this:
cs_set_weapon_ammo ( index, newammo ) will it replace spawn clip? |
Re: bullets problem
i dont know how..
|
Re: bullets problem
It will change the amount of ammunition in the current clip.
For example the m4a1 can have up to 30 bullets in the current clip and 90 ammo in backpack. You should not go above 255 as CS can not display that then. What do you not know how to do it? I have just written a full manual on how to do what you want. Please be more precisely if you expect any more help, thanks. |
Re: bullets problem
Quote:
|
Re: bullets problem
The problem is that you can't say for sure whether this weapon recieved on spawn or not. Let's say that all weapons that you recieve for a time 0.1 sec after spawn are spawn weapons (see http://forums.alliedmods.net/showthread.php?t=42159 for more info on spawn event). Then after that delay use get_user_weapons(), loop though all player's weapons and do cs_set_weapon_ammo(fm_get_user_weapon_entity( id, weapon_id), 0). Though you should skip weapons that doesn't contain clip (knife, c4 etc).
fm_get_user_weapon_entity() function can be found here: Fakemeta Utilities |
Re: bullets problem
Quote:
(I dont get that get_user_weapons thing.. :shock:) |
Re: bullets problem
Quote:
|
| All times are GMT -4. The time now is 06:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.