View Single Post
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 01-28-2021 , 15:35   Re: ENTINDEX() and INDEXENT() Question.
Reply With Quote #6

Quote:
Originally Posted by redivcram View Post
No. 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.
I got you, I understood in your earlier post, I just said in my term to make me easy. Btw, thanks for examples. That was what, I was looking for.

I have a question, what if I use INDEXENT() for entity other than player ? Then, will it return the index of that entity ?

Last edited by Abhinash; 01-28-2021 at 15:37.
Abhinash is offline