weaponbox/armoury_entity Touch
Hello,
I'm trying to disable the player from getting a dropped weapon that he already has. They're custom created entities, but it's not working, the returned Weapon ID is always 0. I'm trying to create dropped weapons just like in fy_ maps, if anyone could give me any idea on fixing this bug or a better method of creating dropped entities, I'd be thankful! Have a nice day. PHP Code:
|
Re: FM Touch Entity
Use an armoury_entity, it will make things much easier for you. If you properly create it, the game will do everything for you, no need to hook touch or anything.
It returns 0 because you are not properly creating the weaponbox entity. To get cs_get_weapon_id to work you need to set m_iId offset when creating the weaponbox. |
Re: FM Touch Entity
It is not fakemeta event, in engine you should use PLUGIN_[CONTINUE/HANDLED].
|
Re: FM Touch Entity
Quote:
Quote:
Quote:
Thanks both :) |
Re: FM Touch Entity
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. Quote:
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 Quote:
What you did in your code is only creating an entity with weaponbox as classname, there's MUCH more to do. |
Re: FM Touch Entity
Quote:
Is this ok? Or I still have things to do? PHP Code:
|
Re: FM Touch Entity
Quote:
|
Re: FM Touch Entity
Quote:
The format: "ARM_MP5" "111.11 222.22 333.33" Also my point is not to convert "ARM_MP5" (string) to an integer, I just need to make it compatible with the Enum (ARM_MP5). |
Re: FM Touch Entity
Quote:
Then when you read from file you need TrieGetCell. What PRoSToTeM@ said basically. Alternatively, you could do that without weaponbox/armoury_entity at all. Create some dummy entity(info_target) and set the weapon index that your entity will contain in a pev value like pev_iuser1. Hook touch, retrieve the CSW_* index from pev_iuser1, get it's name with get_weaponname and use give item, then remove the dummy entity. That way you can put any weapon in there and you don't need to deal with complicated weaponbox code. |
Re: FM Touch Entity
Quote:
PHP Code:
Quote:
|
All times are GMT -4. The time now is 01:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.