View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-07-2018 , 13:24   Re: FM Touch Entity
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
In cs, the ground weapons you can find in different maps are armoury_entity. So if you want to create weapons on ground, do it with armoury_entity: https://forums.alliedmods.net/showthread.php?t=250922
Also it's easier than working with weaponbox entities. You just need to use CreateArmouryEntity( itemType, itemCount, Float: fOrigin[ ] ) stock, and it will do everything for you.

Tho if you properly create them, it does not matter if it's armoury_entity or weaponbox, touch will not be needed.


You can read my tutorial, if you want to use orpheu. If you don't want, then be prepared to do a bit of work, you have to port CWeaponBox:: functions from c++ to pawn.
I strongly advise you to go with orpheu, much cleaner. You have everything you need in this tut: https://forums.alliedmods.net/showthread.php?t=261464


The CSW_ index of the weapon. You have to set that on the weapon entity that's going to be packed into the weaponbox(you will also need to create the weapon entities). Again, don't bother with this stuff, just go with armoury_entity.
What you did in your code is only creating an entity with weaponbox as classname, there's MUCH more to do.
I'll stick to your suggestion of armoury_entity, the only thing that bothers me is that I'm unable to create pistols, as they're needed.. But never mind.

Is this ok? Or I still have things to do?
PHP Code:
public OnNewRound( )
{
    new 
iArraySize ArraySizeg_aWeaponData );

    for( new 
iiArraySizei++ )
    {
        
ArrayGetArrayg_aWeaponDataig_iWeapons );
        
        
CreateArmouryEntityg_iWeaponsWeapon_ArmName ], 1g_iWeaponsWeapon_Origin ] );
    }

In my .ini file I put the ARM Name as a string, ex: "ARM_MP5" and when I read it I use str_to_num to make it an integer, is that correct?
__________________

Last edited by edon1337; 01-07-2018 at 13:50.
edon1337 is offline