 |
|
AMX Mod X Plugin Approver
|

11-12-2014
, 11:56
Re: AddEntityHasValue mod func
|
#2
|
Yeah, you're right, each new entity created, you see a hash is created from its class name, for performance reason.
About the entity creation, I'm talking about pfnCreateNamedEntity, but in the mod, it basically uses a custom function, which calls pfnCreateNamedEntity and AddEntityHashValue, that's why, using AMXX it doesn't work because it calls directly the engine function.
Also, the game is using a custom function UTIL_FindEntityByString to find an entity, which basically loops over the hash table.
Right now it supports only the classname. "hash_types_e" is just an enum (has only one item defined for classname and it's 0 as value), so you can replace by "int". The same.
You can actually see the actual hash map using the server command print_ent.
And you can see the difference in performance using without and with hash using this command : perf_test
You can use arg_int for last param for okapi.
You could also use CREATE_NAMED_ENTITY() from the mod, the custom function I'm talking about.
This could be a good idea to add it to cstrike module since specific to CS, maybe either cs_create_entity or natives to add/remove hash item, don't know.
__________________
Last edited by Arkshine; 11-12-2014 at 12:05.
|
|
|
|