Raised This Month: $ Target: $400
 0% 

Solved Orpheu & WeaponBox


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-14-2018 , 18:37   Orpheu & WeaponBox
Reply With Quote #1

Hi,

I'm trying to create a custom made entity, such as in fy_ maps, no, I'm not going with armoury_entity.
I decided to use Orpheu and learn in the meantime, but after all I'm still a beginner with it.
Why does this code give me an AK47? I'm trying to make it spawn an AK47 in my origin not give me it.. What am I missing?

PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < engine >
#include < cstrike >
#include < hamsandwich >
#include < orpheu >

#define XO_CWEAPONBOX 4 

const m_iId 43;

new const 
WeaponBoxModels[ ][ ] =
{
    
"""models/w_p228.mdl",  "",
    
"models/w_scout.mdl",  """models/w_xm1014.mdl",
    
"models/w_c4.mdl""models/w_mac10.mdl""models/w_aug.mdl""",
    
"models/w_elite.mdl""models/w_fiveseven.mdl",  "models/w_ump45.mdl"
    
"models/w_sg550.mdl""models/w_galil.mdl",  "models/w_famas.mdl"
    
"models/w_usp.mdl""models/w_glock18.mdl""models/w_awp.mdl"
    
"models/w_mp5.mdl""models/w_m249.mdl",  "models/w_m3.mdl",
    
"models/w_m4a1.mdl""models/w_tmp.mdl""models/w_g3sg1.mdl"
    
"""models/w_deagle.mdl""models/w_sg552.mdl""models/w_ak47.mdl",
    
"""models/w_p90.mdl",  """"
}

public 
plugin_init( )
{
    
register_clcmd"say /create""OnCreate" );
}

public 
OnCreateid )
{
    new 
Float:fOrigin];
    
pevidpev_originfOrigin );

    new 
iClassString engfuncEngFunc_AllocString"weaponbox" );
    new 
iWeaponEntity create_entity"weapon_ak47" );

    new 
OrpheuFunction:HandleCreateNamedEntityFunc OrpheuGetFunction"CREATE_NAMED_ENTITY" );
    new 
iEntity OrpheuCallHandleCreateNamedEntityFunciClassString );

    new 
OrpheuFunction:HandlePackWeaponFunc;
    
HandlePackWeaponFunc OrpheuGetFunction"PackWeapon""CWeaponBox" );

    
OrpheuCallHandlePackWeaponFunciEntityiWeaponEntity );
    
set_pdata_intiWeaponEntitym_iIdcs_get_weapon_idiWeaponEntity ), XO_CWEAPONBOX );
    
    new 
iWeaponId cs_get_weapon_idiWeaponEntity );
    if( 
WeaponBoxModelsiWeaponId ][ ] != EOS )
    {
        
engfuncEngFunc_SetModeliWeaponEntityWeaponBoxModelsiWeaponId ] );
        
        
ExecuteHamHam_SpawniWeaponEntity );
        
set_peviWeaponEntitypev_originfOrigin );
    }

Thanks!
__________________

Last edited by edon1337; 07-15-2018 at 08:56.
edon1337 is offline
 


Thread Tools
Display Modes

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 12:39.


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