Raised This Month: $51 Target: $400
 12% 

Setting weapon ammo (clip and bp) mod-independently


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 09-13-2008 , 16:52   Setting weapon ammo (clip and bp) mod-independently
Reply With Quote #1

Does anyone know how to do this? I see HamSandwich has Ham_GiveAmmo (presumably backpack), Ham_Item_PrimmaryAmmoIndex, Ham_Item_SecondaryAmmoIndex. Any ideia what the later 2 do?
danielkza is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 09-13-2008 , 17:59   Re: Setting weapon ammo (clip and bp) mod-independently
Reply With Quote #2

set weapon bpammo:
Code:
#include <cstrike> cs_set_user_bpammo(id,CSW_AK47,255)

set clip
Code:
#include <fakemeta> #define OFFSET_CLIPAMMO 51 //from MeRcyLeZZ' Zombie Plague new weapon_ent=fm_find_ent_by_owner(-1,"weapon_ak47",id); set_pdata_int(weapon_ent,OFFSET_CLIPAMMO,1000); // Find entity by its owner (from fakemeta_util) stock fm_find_ent_by_owner(entity, const classname[], owner) {     while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}         return entity; }
zwfgdlc is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 09-13-2008 , 18:00   Re: Setting weapon ammo (clip and bp) mod-independently
Reply With Quote #3

Quote:
Originally Posted by zwfgdlc View Post
set weapon bpammo:
[samall]
#include <cstrike>
cs_set_user_bpammo(id,CSW_AK47,255)[/small]

set clip
Code:
#include <fakemeta> #define OFFSET_CLIPAMMO 51 //from MeRcyLeZZ' Zombie Plague new weapon_ent=fm_find_ent_by_owner(-1,"weapon_ak47",id); set_pdata_int(weapon_ent,OFFSET_CLIPAMMO,1000); // Find entity by its owner (from fakemeta_util) stock fm_find_ent_by_owner(entity, const classname[], owner) { &nbsp;&nbsp;&nbsp;&nbsp;while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {} &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;return entity; }
Have you read the mod-independent part?
danielkza is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 09-13-2008 , 19:32   Re: Setting weapon ammo (clip and bp) mod-independently
Reply With Quote #4

you can use stock in all, or change one mod like cstrike or fun. You choice
padilha007 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 17:47.


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