Raised This Month: $ Target: $400
 0% 

get_dropped_weapon_bpammo(ent)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 07-30-2009 , 17:55   get_dropped_weapon_bpammo(ent)
Reply With Quote #1

I have a weapon ent, it is dropped. And I wanna to get it's bpammo.

How can I do such a thing.
Empowers is offline
Send a message via ICQ to Empowers
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-30-2009 , 18:15   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #2

http://forums.alliedmods.net/showpos...25&postcount=7
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 07-31-2009 , 05:56   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #3

PHP Code:
#define OFFSET_WBOX_AMMO_BACKPACK_WIN32 73

stock cs_get_weaponbox_bpammo(ent) {
        return 
get_pdata_int(entOFFSET_WBOX_AMMO_BACKPACK_WIN32)

doesn't work on me(( always returns zero

Help me plz
Empowers is offline
Send a message via ICQ to Empowers
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-31-2009 , 06:09   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #4

Tested on windows or linux ?
__________________
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-31-2009 , 07:17   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #5

#define cs_get_weaponbox_bpammo(%1) get_pdata_int(%1, OFFSET_WBOX_AMMO_BACKPACK_WIN32, 4)
__________________
xPaw is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 07-31-2009 , 10:57   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #6

Quote:
Originally Posted by Arkshine View Post
Tested on windows or linux ?
Widnows 32bit system

Quote:
Originally Posted by xPaw View Post
#define cs_get_weaponbox_bpammo(%1) get_pdata_int(%1, OFFSET_WBOX_AMMO_BACKPACK_WIN32, 4)
this does the same always zero

any suggestions?
Empowers is offline
Send a message via ICQ to Empowers
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-31-2009 , 11:32   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #7

Can you show an example of your code? And yes, the linux extra-offset should be 4.
__________________
Arkshine is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 07-31-2009 , 11:52   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
Can you show an example of your code? And yes, the linux extra-offset should be 4.
PHP Code:
#define OFFSET_WBOX_AMMO_BACKPACK_WIN32 73
#define cs_get_weaponbox_bpammo(%1) get_pdata_int(%1, OFFSET_WBOX_AMMO_BACKPACK_WIN32, 4)

public plugin_init()
    
register_forward(FM_SetModel"forward_set_model")


public 
forward_set_model(ent, const model[]) 
{
    if(!
is_weaponbox(ent))
        return 
FMRES_IGNORED;

    for (new 
g_max_clients 1g_max_entities; ++i) {
        if (!
pev_valid(i) || ent != pev(ipev_owner))
            continue
        
        
//both return zero
        
server_print("ent:%i i:%i",cs_get_weaponbox_bpammo(ent),cs_get_weaponbox_bpammo(i))

    
        return 
FMRES_IGNORED
    
}

    return 
FMRES_IGNORED

Code taken from Ven's plugin.

Last edited by Empowers; 07-31-2009 at 12:02.
Empowers is offline
Send a message via ICQ to Empowers
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-31-2009 , 12:41   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #9

cs_get_weaponbox_bpammo(ent) is right but you retrieve when the weaponbox just spawning, I guess it's too early to get the value.
__________________
Arkshine is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 08-01-2009 , 05:01   Re: get_dropped_weapon_bpammo(ent)
Reply With Quote #10

Quote:
Originally Posted by Arkshine View Post
cs_get_weaponbox_bpammo(ent) is right but you retrieve when the weaponbox just spawning, I guess it's too early to get the value.
I was trying to set task for 1 second and then retreve value. But the same always returns zero. i think offset is not right.
Empowers is offline
Send a message via ICQ to Empowers
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 18:17.


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