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

Solved weaponbox/armoury_entity Touch


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-15-2018 , 20:13   Re: weaponbox/armoury_entity Touch
Reply With Quote #31

Quote:
Originally Posted by edon1337 View Post
Thanks, Hamlet, I'll test it tomorrow and tell you the results! I have a question:

So if item count is 0, the item will be removed, if 1 then only 1 entity will be created?
Yes, setting the count to 0 will make it invisible and > 0 it will be visible/touchable. It does the work for you.
__________________
Bugsy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-16-2018 , 04:10   Re: weaponbox/armoury_entity Touch
Reply With Quote #32

As Bugsy said, it will make it INVISIBLE, not remove it. It's not the same thing.
If you remove the armoury_entity then it's removed for good, it won't respawn. It's in the FAQ.
__________________

Last edited by HamletEagle; 01-16-2018 at 04:11.
HamletEagle is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-16-2018 , 06:36   Re: weaponbox/armoury_entity Touch
Reply With Quote #33

Quote:
Originally Posted by HamletEagle View Post
As Bugsy said, it will make it INVISIBLE, not remove it. It's not the same thing.
If you remove the armoury_entity then it's removed for good, it won't respawn. It's in the FAQ.
Good point, yes by remove I meant remove from a player perspective aka it will disappear but the entity will remain intact. HamletEagles thread covers all of this stuff, I suggest creating a test plugin setting the count value to 0 and non zero values, doing round restarts etc so you can see how they work out of the box. You can also play with my Armoury Manager plugin.
__________________

Last edited by Bugsy; 01-16-2018 at 06:37.
Bugsy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-16-2018 , 13:53   Re: weaponbox/armoury_entity Touch
Reply With Quote #34

I tested it, and again, it's not letting me pick up weapons, just grenades. Something's wrong with these entities. Sometimes they work as expected, and sometimes weird glitches appear.
PHP Code:
new Array:g_aWeaponData;
new 
Trie:g_tWeaponTrie;

const 
XO_CArmoury //diff windows/linux
const m_iType 34 // armoury_entity index( see above enum )
const m_iCount 35// hold the number of weapons that the armoury_entity will have 

enum
{
    
ARM_MP5//0
    
ARM_TMP,
    
ARM_P90,
    
ARM_MAC10,
    
ARM_AK47,
    
ARM_SG552,
    
ARM_M4A1,
    
ARM_AUG,
    
ARM_SCOUT,
    
ARM_G3SG1,
    
ARM_AWP,
    
ARM_M3,
    
ARM_XM1014,
    
ARM_M249,
    
ARM_FLASHBANG,
    
ARM_HEGRENADE,
    
ARM_KEVLAR,
    
ARM_ASSAULT,
    
ARM_SMOKEGRENADE //18
}

new const 
g_szValues[ ][ ] =
{
    
"ARM_MP5",
    
"ARM_TMP",
    
"ARM_P90",
    
"ARM_MAC10",
    
"ARM_AK47",
    
"ARM_SG552",
    
"ARM_M4A1",
    
"ARM_AUG",
    
"ARM_SCOUT",
    
"ARM_G3SG1",
    
"ARM_AWP",
    
"ARM_M3",
    
"ARM_XM1014",
    
"ARM_M249",
    
"ARM_FLASHBANG",
    
"ARM_HEGRENADE",
    
"ARM_KEVLAR",
    
"ARM_ASSAULT",
    
"ARM_SMOKEGRENADE"
}

new const 
Values[ ] =
{
    
ARM_MP5,
    
ARM_TMP,
    
ARM_P90,
    
ARM_MAC10,
    
ARM_AK47,
    
ARM_SG552,
    
ARM_M4A1,
    
ARM_AUG,
    
ARM_SCOUT,
    
ARM_G3SG1,
    
ARM_AWP,
    
ARM_M3,
    
ARM_XM1014,
    
ARM_M249,
    
ARM_FLASHBANG,
    
ARM_HEGRENADE,
    
ARM_KEVLAR,
    
ARM_ASSAULT,
    
ARM_SMOKEGRENADE
}

public 
plugin_init( )
{
    
SsInit3000.0 );
    
SsScan( );
    
SsDump( );
    
    
g_aWeaponData ArrayCreateWeaponData );
    
g_tWeaponTrie TrieCreate( );
    
    for( new 
isizeof g_szValuesi++ )
    {
        
TrieSetCellg_tWeaponTrieg_szValues], Values] );
    }
    
    
ReadFile( );
    
    new 
iArraySize ArraySizeg_aWeaponData );

    new 
Float:fOrigin];
    
    for( new 
iiArraySizei++ )
    {
        
ArrayGetArrayg_aWeaponDataig_iWeapons );
        
        if( 
SsGetOriginfOrigin ) )
        
CreateArmouryEntityg_iWeaponsWeapon_ArmName ], 1fOrigin );
    }
}

public 
ReadFile( )
{
    new 
szConfigs32 ], szFormat64 ], szWeaponData256 ], szWeaponArmName32 ];
    
get_configsdirszConfigscharsmaxszConfigs ) ) ;
    
    
formatexszFormatcharsmaxszFormat ), "%s/%s"szConfigsg_szIniFile ) ;
    new 
iFile fopenszFormat"r" ) ;
    
    if( 
iFile ) {
        
        while( ! 
feofiFile ) ) {
            
            
fgetsiFileszWeaponDatacharsmaxszWeaponData ) ) ;
            
trimszWeaponData ) ;
            
            
parseszWeaponDataszWeaponArmNamecharsmaxszWeaponArmName ) );            
            
            new 
iArmValue;
            if( 
TrieGetCellg_tWeaponTrieszWeaponArmNameiArmValue ) )
            {
                
g_iWeaponsWeapon_ArmName ] = iArmValue;
                
                
ArrayPushArrayg_aWeaponDatag_iWeapons );
            }
        }
        
fcloseiFile ) ;
    }
}

stock CreateArmouryEntityitemTypeitemCountFloatfOrigin[ ] )
{
    new 
armouryEnt create_entity("armoury_entity")
    if(!
armouryEnt)
    {
        return -
1
    
}
    
    if(
itemType ARM_MP5 || itemType ARM_SMOKEGRENADE)
    {
        return -
1
    
}
    
    
set_pev(armouryEntpev_originfOrigin)
    
set_pdata_int(armouryEntm_iTypeitemTypeXO_CArmoury)
    
set_pdata_int(armouryEntm_iCountitemCountXO_CArmoury)
    
dllfunc(DLLFunc_SpawnarmouryEnt)
    return 
armouryEnt

__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-16-2018 , 15:12   Re: weaponbox/armoury_entity Touch
Reply With Quote #35

We are so going to be able to help you with half the source code.

Anyway do some debugging, print the values when you create the entity.
Hook touch and print m_iCount, m_iType when you walk over an armoury.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-16-2018 , 17:26   Re: weaponbox/armoury_entity Touch
Reply With Quote #36

Quote:
Originally Posted by HamletEagle View Post
We are so going to be able to help you with half the source code.

Anyway do some debugging, print the values when you create the entity.
Hook touch and print m_iCount, m_iType when you walk over an armoury.
There's nothing related to this thread in the rest of the code.
I did some debugs and, as soon as I spawned, I got 75 KB of debugs in just a few seconds, no idea why it spammed me like this
PHP Code:
L 01/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:58m_iType12 m_iCount1
L 01
/16/2018 23:21:58m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iTypem_iCount1
L 01
/16/2018 23:21:59m_iType12 m_iCount
Wasn't even able to touch any armoury_entity because of the intense spam.
PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

const m_iType 34 // armoury_entity index( see above enum )
const m_iCount 35 // hold the number of weapons that the armoury_entity will have 

public plugin_init( )
{
    
RegisterHamHam_Touch"armoury_entity""fw_HamTouchArmouryEntity_Pre");
}

public 
fw_HamTouchArmouryEntity_PreiEnt )
{
    if( 
pev_validiEnt ) != )
    return 
HAM_IGNORED;
    
    
log_to_file"DebugArmoury.txt""m_iType: %d | m_iCount: %d"get_pdata_intiEntm_iType ), get_pdata_intiEntm_iCount ) );
    return 
HAM_IGNORED;

__________________
edon1337 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-16-2018 , 17:42   Re: weaponbox/armoury_entity Touch
Reply With Quote #37

Can you pick up map-created armoury_entity's?
__________________
Bugsy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-16-2018 , 17:49   Re: weaponbox/armoury_entity Touch
Reply With Quote #38

Quote:
Originally Posted by Bugsy View Post
Can you pick up map-created armoury_entity's?
What exactly are map-created armoury_entities? Are you talking about the armoury_entities that I manually created in my code?

EDIT: This time it didn't spam me
PHP Code:
L 01/16/2018 23:50:16m_iTypem_iCount1
L 01
/16/2018 23:50:16m_iTypem_iCount0
L 01
/16/2018 23:50:16m_iTypem_iCount0
L 01
/16/2018 23:50:16m_iTypem_iCount0
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:24m_iType13 m_iCount1
L 01
/16/2018 23:50:28m_iType14 m_iCount1
L 01
/16/2018 23:50:28m_iType14 m_iCount0
L 01
/16/2018 23:50:28m_iType14 m_iCount0
L 01
/16/2018 23:50:28m_iType14 m_iCount0
L 01
/16/2018 23:50:28m_iType14 m_iCount0
L 01
/16/2018 23:50:28m_iType14 m_iCount0
L 01
/16/2018 23:50:28m_iType14 m_iCount0
L 01
/16/2018 23:50:28m_iType14 m_iCount0
L 01
/16/2018 23:50:28m_iType14 m_iCount0
L 01
/16/2018 23:50:28m_iType14 m_iCount
EDIT2: Now it keeps spamming me again, as soon as I spawn, without even touching any entity, my console is flooded.
__________________

Last edited by edon1337; 01-16-2018 at 17:55.
edon1337 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-16-2018 , 18:09   Re: weaponbox/armoury_entity Touch
Reply With Quote #39

No, like the weapons on fy_iceworld.
__________________
Bugsy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-16-2018 , 18:40   Re: weaponbox/armoury_entity Touch
Reply With Quote #40

Quote:
Originally Posted by Bugsy View Post
No, like the weapons on fy_iceworld.
There isn't any. I'm testing in de_mon.
__________________

Last edited by edon1337; 01-16-2018 at 18:40.
edon1337 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 23:02.


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