Retrieving an entity id before it's created
How can I detect what id the entity will have before it's created ?
|
Re: Retrieving an entity id before it's created
It may be predictable with code that simulates what ED_Alloc() engine function does here: https://github.com/dreamstalker/rehl..._edict.cpp#L48
I don't think it's possible to do it from an AMXX plugin though. As far as I know, AMXX doesn't offer any natives that deal with edicts directly, so it probably has to be written within a module. Why do you even want to predict the id? I don't see how is that useful. |
Re: Retrieving an entity id before it's created
Well I get entity origins from a .cfg file and store them in a dynamic array. There is a menu from which I can delete the entity, add them and etc. So when I delete the entity I want to delete the dynamic array item too, but how can I retrieve the array item id when deleting the entity ?
|
Re: Retrieving an entity id before it's created
You could save array index in entity's pev_iuser[1-4] fields. Easily retrieved with pev().
PHP Code:
|
Re: Retrieving an entity id before it's created
Thanks also why does this part give me a tag missmatch?
PHP Code:
|
Re: Retrieving an entity id before it's created
You are probably declaring that array as:
PHP Code:
One way to get around that is to de-tag the value you assign to your variable: PHP Code:
PHP Code:
|
Re: Retrieving an entity id before it's created
Thanks :)
|
| All times are GMT -4. The time now is 09:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.