If you run this on other mods, like HL, that have monsters or other stuff in them, the entity index can be anywhere between the number of max players on a server and 500 (default), causing an out of bounds error.
You can essentially filter the monsters out with a simple check like:
Code:
if (!is_user_alive(id))
// It's a monster!
__________________