Es.getplayerprop

From EventScripts Community Encyclopedia



Method: getplayerprop

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

Method Overview

Table of Contents

Contents


Description

Get the value of a class property from the player.
This is the Python equivalent of: http://www.eventscripts.com/pages/es_getplayerprop

Arguments

  • userid - Userid of the user to get the property from.
  • property - Direct name of the variable from source, i.e. CBaseEntity.vecOrigin (location of the player in the map)


Examples

getting a player location

player_location = es.getplayerprop(event_var['userid'], "CBaseEntity.m_vecOrigin")
es.msg("player ", event_var['es_username'], " is located at: ", player_location)
//possible output:
//player mRyOuNg is located at: -144.248990,1234.812397,12.123091 

Notes

  • Class which contains the source variable name may not always be CBaseEntity, although this is the superclass of all other source entity classes. Other subclasses may have their own variables, such as CCSPlayer, which contains information such as m_iAccount, for how much money a player has.
  • Half Life 2 Class Hierarchy: http://hl2doxygen.sniperumm.co.uk/d5/de5/class_c_base_entity.html


See Also

blog comments powered by Disqus