Es.getplayerhandle

From EventScripts Community Encyclopedia



Method: getplayerhandle

Module: es
Class: (no class)
EventScripts version: 2.0

Method Overview

Table of Contents

Contents


Description

Returns the hOwner property of userid and returns it as an integer.

Arguments

  • userid - The userid of the player you're getting the handle for


Examples

def remove_weapons(userid):
    # Removes a player's weapons
 
    entityList = es.createentitylist()
    for index in entityList:
        if entityList[index]['classname'].startswith("weapon_") == True:
            if es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') == es.getplayerhandle(userid):
                es.server.queuecmd('es_remove %s' % index)

Notes

This is often used when checking ownership of a prop

See Also

blog comments powered by Disqus