View Single Post
Andersso
Member
Join Date: Nov 2009
Location: E8 2A 2A 2A 2A
Old 05-12-2014 , 16:35   Re: Set player animation
Reply With Quote #5

I believe the m_hPlayer property is the entity handle of the client, not index.

If I recall correctly, you can do index->ref->handle like this:
PHP Code:
new entityHandle EntIndexToEntRef(entityIndex) & 0x7FFF
And vice versa:
PHP Code:
new entityIndex EntRefToEntIndex(entityHandle | ~0x7FFF); 
What it does is to mask in/out the negative bit-flag of the integer value

Not tested, just out of my head, so I excuse myself if I got this wrong.
Andersso is offline