Es setplayerprop

From EventScripts Community Encyclopedia


Overview

Syntax: es_setplayerprop <userid> "<property>" <value>

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Variation of this command that doesn't expand variables: {{{x}}}

Description

Set the value of a class property for a player.

Parameters

  • userid - Userid of the user to assign the property to.
  • property - Direct name of the variable from source, i.e. CCSPlayer.m_iAccount (money that a CS:S player has)
  • value - Value to assign to the property.


Examples

// Give a player's cash to $16000.
es_setplayerprop event_var(userid) "CCSPlayer.m_iAccount" 16000
 
// Set a player's health to 50.
es_setplayerprop event_var(userid) "CCSPlayer.baseclass.m_iHealth" 50
 
// Set the player's speed to 2 times normal speed.
es_setplayerprop event_var(userid) "CBasePlayer.localdata.m_flLaggedMovementValue" 2
 
// Make a player unblockable by other players.
es_setplayerprop event_var(userid) "CBaseEntity.m_CollisionGroup" 2
 
// Push the player 300 in the Z direction (looks like a jump)
es_setplayerprop event_var(userid) "CCSPlayer.baseclass.localdata.m_vecBaseVelocity" 0,0,300


Notes

  • CBaseEntity is the base class of all entities and therefore all players. This contains basic entity properties such as m_vecOrigin.
  • Use with caution! - Improperly assigning a value to a player property can cause a server to crash.


See also


External links

es_xsetplayerprop


{{{category}}}

blog comments powered by Disqus