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

cs_set_user_bpammo issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 08-30-2014 , 16:10   cs_set_user_bpammo issue
Reply With Quote #1

So I was testing my weapon api and I found something strange - cs_set_user_bpammo isn't working properly, I think.

PHP Code:
RegisterHam(Ham_Item_Deployg_szWeaponsList[i], "Ham_Item_Deploy_pre"0true);
RegisterHam(Ham_Item_Deployg_szWeaponsList[i], "Ham_Item_Deploy_post"1true);

public 
Ham_Item_Deploy_pre(ent)
{
    new 
owner get_pdata_cbase(ent414);
    if(
is_user_alive(owner))
        
cs_set_user_bpammo(ownerCSW_SCOUT0);
}

public 
Ham_Item_Deploy_post(ent)
{
    new 
owner get_pdata_cbase(ent414);
    if(
is_user_alive(owner))
        
cs_set_user_bpammo(ownerCSW_SCOUT13);

Testing example: buy scout, you will see 13 ammo in inventory, then shoot a bit, so that weapons clip isn't full, press reload, works fine. Now, shoot a bit, swap weapon, swap back to scout and press reload - nothing happens, because engine still thinks that player has no ammo. Why is that? If you give ammo in pre, everything works fine.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 08-30-2014 at 16:11.
GuskiS is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-30-2014 , 17:19   Re: cs_set_user_bpammo issue
Reply With Quote #2

The native is just about setting an offset. Basically your issue is most likely a lack of game knowledge.
__________________
Arkshine is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 08-30-2014 , 18:14   Re: cs_set_user_bpammo issue
Reply With Quote #3

It might be so, could you explain?
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-30-2014 , 18:41   Re: cs_set_user_bpammo issue
Reply With Quote #4

Explain better what you're trying to do then, because it's unclear for me.
__________________
Arkshine is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 08-30-2014 , 18:46   Re: cs_set_user_bpammo issue
Reply With Quote #5

I'm trying to attach every weapon ammo count which player has, when dropped - save it to weapon, when pickup - give to player from weapon ent. I use Ham_Item_Holster to remove ammo, and deploy to set ammo. In that example it just gave basic example.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 08-30-2014 , 19:05   Re: cs_set_user_bpammo issue
Reply With Quote #6

Lol, I have the same ideal about a month ago.
Here what I did:
Hook FM_SETMODEL post, save ammo to any iuser
Upon touching it, retrieve ammo and set to user( with weapon filter)
RateX 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 22:18.


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