Raised This Month: $ Target: $400
 0% 

Give Weapon Ammo Issue


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 12-09-2007 , 02:45   Give Weapon Ammo Issue
Reply With Quote #1

Hello gents. I'm trying to give a player a weapon when he walks over it; normally he'd be able to pick it up like normal, but he already has a primary weapon so I'm going around it with hamsandwich.

The giving part works fine, but the ammo doesn't go with it. The clip ammo does, but not the backpack ammo. So if I drop an SMG for example, with 23 rounds in the clip and 4 extra magazines, I go to pick it back up and only get those 23 rounds total - no extra magazines.

Code:
// Adapted from XxAvalanchexX's stock stock ham_give_weapon_entity( id, wpnent ) {     if( !pev_valid(wpnent) ) return 0;             if(!ExecuteHamB(Ham_AddPlayerItem,id,any:wpnent) || !ExecuteHamB(Ham_Item_AttachToPlayer,wpnent,any:id))     {         if(pev_valid(wpnent)) set_pev(wpnent,pev_flags,pev(wpnent,pev_flags) & FL_KILLME);         return 0;     }           return 1; }

So my question is, first of all, if anyone knows a better way around this.

But assuming no one does, does anyone know where backpack ammo is stored? Is it on the person, or in the gun (which would be logical). If it's in the gun, where? Pdata (I've looked through some offsets to no avail)?

Thanks in advance
__________________

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]
 



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 11:04.


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