Raised This Month: $ Target: $400
 0% 

cs_get/set_user_bpammo Issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-08-2010 , 01:20   cs_get/set_user_bpammo Issues
Reply With Quote #1

Ok so.. i have the following array.

JammedWeapon[33][3];

PHP Code:
JammedWeapon[33][0] = Weapon Name;
JammedWeapon[33][1] = Back pack ammo;
JammedWeapon[33][2] = Clip Ammo 
Using the following code I achieve the goal.
PHP Code:
public WeaponJam(id)
{
    new 
wepName[32], tempwepID get_user_weapon(idtemptemp);
    
JammedWeapon[id][0] = get_weaponname(wepIDwepName31);
    new 
wepEntID fm_find_ent_by_owner(-1wepNameid);
    
JammedWeapon[id][1] = cs_get_user_bpammo(idJammedWeapon[id][0]);
    
JammedWeapon[id][2] = cs_get_weapon_ammo(wepEntID);    
    
    
cs_set_weapon_ammo(wepEntID0);
    
cs_set_user_bpammo(idJammedWeapon[id][0], 0);    
    
WeaponIsJammed[id] = true;
    
emit_sound(id,CHAN_AUTO"weapons/m4a1_boltcatch.wav"1.0ATTN_NORM0PITCH_NORM);

How ever Only the Clip Ammo is effected Any ideas on how to store the bp ammo and then set it to 0?
Doc-Holiday is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 08-08-2010 , 01:33   Re: cs_get/set_user_bpammo Issues
Reply With Quote #2

Code:
enum WeaponStruct {     CSWID,     Ammo,     Bpammo } new WeaponJam[33][WeaponStruct] public WeaponJam( id ) {     WeaponJam[id][CSWID] = get_user_weapon( id, WeaponJam[id][Ammo], WeaponJam[id][Bpammo] )         new cswid = WeaponJam[id][CSWID]     new name[20]     get_weaponname( cswid, name, 19 )     new wepID = find_ent_by_owner( -1, name, id )         if( wepID )     {         cs_set_weapon_ammo( wepID, 0 )         cs_set_user_bpammo( id, cswid, 0 )     }         // WeaponJam[id][CSWID] is the CSW_* constant of the weapon     // WeaponJam[id][Ammo] holds the ammo     // WeaponJam[id][Bpammo] holds the backpack ammo         // ... }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-08-2010 , 03:26   Re: cs_get/set_user_bpammo Issues
Reply With Quote #3

THANKS!!!!
Doc-Holiday is offline
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 00:06.


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