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.