[FAQ]armoury_entity
I've seen a number of questions related to this topic, so I thought that such a FAQ is welcome. What is an armoury_entity ? armoury_entity is the weapons that is spawned on the ground (like in fy_snow). This does not include the dropped weapons which are weaponboxes. If you pickup an armoury_entity and drop, it will be no longer an armoury_entity, but an weaponbox ent. An armoury_entity can hold more than one weapon. Before you begin you need to know the armoury_entity indexs, this is what you will use. Code:
enum The models for armoury_entity: Code:
"models/w_mp5.mdl", Some offset that we will use: Code:
Ok, let's begin: 1.Hook touch with an armoury_entity: Code:
2.Create an armoury entity: Code:
itemCount is the number of the weapons that the armoury entity will hold. fOrigin is the origin where the armoury_entity will be spawned. The stock above will return -1 on failure/ the armoury index otherwise. 3.Remove all armoury_entity from the map: Code:
I'm waiting for suggestion and comments. Please check this post: https://forums.alliedmods.net/showpo...8&postcount=10 in order to find out how armoury entities are hidden when they contain 0 weapons and how they are restored. |
Re: [FAQ]armoury_entity
Good tutorial. Though AFAIK you don't need to use the models enum. Using this should be enough:
PHP Code:
|
Re: [FAQ]armoury_entity
It seems that you are right, game sets the model on it's own. But I'll let the model list, in case someone wants to know.
|
Re: [FAQ]armoury_entity
I thought defines were existing for armoury_entity, but I guess it's defined only in cstrike module. It would be probably welcomed to define that in amxconst.inc as well.
|
Re: [FAQ]armoury_entity
You shouldn't set origin with set_pev.
Is there a way to set ammo for weapon inside that ent? Or, what happens when setting more than one count? Also, how to set other weapons in armoury entity? I'm not sure, but if I remember correctly, via valve hammer editor you could set weapon, then count, then set other weapon and it's count (I could be wrong, did mapping long time ago, will check later). |
Re: [FAQ]armoury_entity
No, it's perfectly fine with set_pev. EngFunc_SetOrigins is usefull for linking the entity with the world, I don't think this is needed now, so we can reduce the code that is called internally.
I don't think you can change the default ammo directly, like an offset, will check that. |
Re: [FAQ]armoury_entity
Quote:
I want to remove all armoury_entity entities for round 1 only since we play a map that only gives the Terror team AKs and that gives them an unfair advantage in the first round |
Re: [FAQ]armoury_entity
Quote:
PHP Code:
|
Re: [FAQ]armoury_entity
Quote:
|
Re: [FAQ]armoury_entity
Well...yes.
remove_entity and remove_entity_name are the same thing, the last one is a stock which call remove_entity on the specified classname(it loops all ents that have the given identifier). Since remove means actually remove, using such functions on armoury_entities will make them unable to spawn on new round. Metalicross way sets the item count to 0, so it will contain 0 weapons of it's type and make them invisible, this is the trick. Now, why removing them make them unable to respawn ? When the item count from an armoury is decremented to 0 the armoury will get hidden and on new round the m_iCount is restored, so the actual ent is not removed when m_iCount is 0. Look at this decompiled code by Arkshine: PHP Code:
PHP Code:
|
All times are GMT -4. The time now is 21:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.