Raised This Month: $ Target: $400
 0% 

Change armoury_entity bpammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andregb8
Junior Member
Join Date: Jul 2009
Old 08-08-2010 , 22:56   Change armoury_entity bpammo
Reply With Quote #1

How can I change armoury_entities bpammo when they spawn? I want that all armoury_entities spawn with their max bpammo. Sorry for my english...

I tried:

PHP Code:
#include < amxmodx >
#include < fakemeta >

new const g_iMaxBpAmmo[ ] =
{
    
0309020090,
    
321001003552,
    
1202111
}

const 
m_iPrimaryAmmoType 49
const m_iDefaultAmmo 56

new g_iFwdPrecacheSpawn;

public 
plugin_precache( )
{
    
g_iFwdPrecacheSpawn register_forwardFM_Spawn"FwdPrecacheSpawn");
}

public 
plugin_init( )
{
    
register_plugin"armoury_entity max bpammo""1.0""!-Radio-man" );
    
unregister_forwardFM_Spawng_iFwdPrecacheSpawn);
}

public 
FwdPrecacheSpawniEnt )
{
    if( !
pev_validiEnt ) )
    {
        return 
FMRES_IGNORED;
    }
   
    static 
szClass15 ];
    
peviEntpev_classnameszClass14 );
   
    if( !
equalszClass"armoury_entity" ) )
    {
        return 
FMRES_IGNORED;
    }
   
    
set_pdata_intiEntm_iDefaultAmmog_iMaxBpAmmoget_pdata_intiEntm_iPrimaryAmmoType) ], );
    return 
FMRES_IGNORED;

andregb8 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-09-2010 , 05:25   Re: Change armoury_entity bpammo
Reply With Quote #2

your offsets are wrong.

armouries offsets are :

34 m_iType
35 m_iCount // that one you need

You have to set them after each new round, you can hook Ham_Respawn post for this.

ResgisterHam(Ham_Respawn, "armoury_entity", "Armoury_Entity_Respawn", 1)

Code:
public Armoury_Entity_Respawn( iEnt ) {   set_pdata_int(iEnt, m_iCount, ANYVALUE, ARMOURY_ENTITY_EXTRAOFFSET) }
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
andregb8
Junior Member
Join Date: Jul 2009
Old 08-09-2010 , 16:10   Re: Change armoury_entity bpammo
Reply With Quote #3

It still didn't work:

PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

const m_iCount 35;

public 
plugin_init( )
{
    
register_plugin"armoury_entity max bpammo""1.1""!-Radio-man" );
    
    
RegisterHamHam_Respawn"armoury_entity""FwdRespawn");
}

public 
FwdRespawniEnt )
{
    
set_pdata_intiEntm_iCount90); // 90 bullets only to test

andregb8 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-09-2010 , 16:59   Re: Change armoury_entity bpammo
Reply With Quote #4

Try Ham_CS_Restart
__________________
xPaw is offline
andregb8
Junior Member
Join Date: Jul 2009
Old 08-09-2010 , 17:34   Re: Change armoury_entity bpammo
Reply With Quote #5

Now it works. But this offset changes the number of weapons, not the number of bullets in the backpack.
andregb8 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-09-2010 , 19:59   Re: Change armoury_entity bpammo
Reply With Quote #6

Then extraoffset could be 5.
Look at cstrike module sources cstrike.h
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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:07.


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