View Single Post
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 01-28-2021 , 14:19   Re: ENTINDEX() and INDEXENT() Question.
Reply With Quote #5

No. ENTINDEX returns the index number of the entity and INDEXENT returns the entity that has the index number specified as the only argument when calling the function.

Sample uaage:

Code:
edict_t* pMyEnt = ENTINDEX(4); // pMyEnt now points to the entity with the index number of 4 if it exists, otherwise it will point nowhere (will be nullptr)

// Check validity, etc.
// ...

int id = INDEXENT(pMyEnt);

return id; // Will return 4.

Last edited by redivcram; 01-28-2021 at 14:25.
redivcram is offline