e2 docs player - wiremod/wire GitHub Wiki

Jump to table of contents

Player

Number = Entity:isAdmin()

Is the player an admin? (5 ops)

Number = Entity:isSuperAdmin()

Is the player a super admin? (5 ops)

Vector = Entity:shootPos()

Returns a players shoot position (8 ops)

Vector = Entity:eye()

Gets a players view direction else entity forward direction (8 ops)

Angle = Entity:eyeAngles()

Gets a players view direction (8 ops)

String = Entity:steamID()

Gets the steam ID of the player (5 ops)

String = Entity:steamID64()

Gets the Steam Community ID (aka Steam64) of the given player (5 ops)

Number = Entity:armor()

Gets the armor of the player (5 ops)

Number = Entity:isCrouch()

Is the player crouching? (5 ops)

Number = Entity:isAlive()

Is the player or NPC alive? (5 ops)

Number = Entity:isFlashlightOn()

Returns 1 if the player has flashlight on, 0 otherwise (5 ops)

Number = Entity:frags()

Returns the number of kills the player has made (5 ops)

Number = Entity:deaths()

Returns the number of times the player died (5 ops)

Number = Entity:team()

Returns the team number a player is on (5 ops)

String = teamName(Number Rv1)

Returns the name of the team associated with the team number (5 ops)

Number = teamScore(Number Rv1)

Returns the score of the team associated with the team number (5 ops)

Number = teamPlayers(Number Rv1)

Returns the number of players of the team associated with the team number (5 ops)

Number = teamDeaths(Number Rv1)

Returns the number of deaths of the team associated with the team number (5 ops)

Number = teamFrags(Number Rv1)

Returns the number of kills of the team associated with the team number (5 ops)

Vector = teamColor(Number Index)

Returns the color of the team associated with the team number (5 ops)

Array = teams()

Returns an array of all teams (10 ops)

Number = Entity:keyForward()

Is the player pressing their forward key? (default W) (2 ops)

Number = Entity:keyLeft()

Is the player pressing their left key? (default A) (2 ops)

Number = Entity:keyBack()

Is the player pressing their back key? (default S) (2 ops)

Number = Entity:keyRight()

Is the player pressing their right key? (default D) (2 ops)

Number = Entity:keyJump()

Is the player pressing their jump key? (2 ops)

Number = Entity:keyAttack1()

Is the player pressing their primary fire key? (2 ops)

Number = Entity:keyAttack2()

Is the player pressing their secondary fire key? (2 ops)

Number = Entity:keyUse()

Is the player pressing their use key? (2 ops)

Number = Entity:keyReload()

Is the player pressing their reload key? (2 ops)

Number = Entity:keyZoom()

Is the player pressing their zoom key? (2 ops)

Number = Entity:keyWalk()

Is the player pressing their walk key? (2 ops)

Number = Entity:keySprint()

Is the player pressing their sprint key? (2 ops)

Number = Entity:keyDuck()

Is the player pressing their crouch key? (2 ops)

Number = Entity:keyLeftTurn()

Is the player pressing their Look left key? (2 ops)

Number = Entity:keyRightTurn()

Is the player pressing their Look right key? (2 ops)

Number = Entity:keyPressed(String Char)

Is the player pressing the KEY_ enumeration [S]? For example, 'W', 'K', '4', 'COMMA' (2 ops)

runOnKeys(Entity Ply, Number On)

If set to 1, E2 will run when specified player presses/releases their key (20 ops)

runOnKeys(Entity Ply, Number On, Array Filter)

(20 ops)

runOnKeys(Array Plys, Number On)

(20 ops)

runOnKeys(Array Plys, Number On, Array Filter)

(20 ops)

Entity = keyClk()

Returns the player that pressed/released the key if the E2 was triggered by runOnKeys (1 ops)

Number = keyClk(Entity Ply)

Returns 1 if the E2 was triggered by the player pressing a key or -1 when releasing a key (1 ops)

String = keyClkPressed()

Returns the name of the pressed/released key that triggered the E2 (1 ops)

String = keyClkPressedBind()

(1 ops)

runOnUse(Number Value)

If set to 1, E2 will run when a player presses E on the E2 (50 ops)

Entity = useClk()

Returns the player that used the E2, if the E2 was triggered by runOnUse (1 ops)

Number = Entity:isTyping()

Is the player typing a message in chat? (1 ops)

Array = Entity:friends()

Returns an array of players on the prop protection friends list (2 ops)

Number = Entity:trusts(Entity Whom)

Is E2 on the prop protection friends list of E? (2 ops)

Array = Entity:steamFriends()

Returns a Array with E's steam friends on the server E is playing on (15 ops)

Number = Entity:isSteamFriend(Entity Friend)

Returns if the given Entity is a steam friend of the first Entity (15 ops)

Number = Entity:ping()

Returns the latency for player E (5 ops)

Number = Entity:timeConnected()

Returns a players time connected to a server (5 ops)

Entity = Entity:vehicle()

Returns the entity of the vehicle that the specified player is in (5 ops)

Number = Entity:inVehicle()

Is the player in a vehicle? (5 ops)

Number = Entity:inNoclip()

Is the player in noclip mode? (5 ops)

Number = Entity:inGodMode()

Returns whether the player has god mode or not (5 ops)

Array = players()

Returns an array containing all players on the server (10 ops)

Array = playersAdmins()

Returns an array containing all admins on the server (10 ops)

Array = playersSuperAdmins()

Returns an array containing all super admins on the server (10 ops)

Entity = Entity:aimEntity()

Returns the entity that the entity is aiming at (10 ops)

Vector = Entity:aimPos()

Returns the point that the entity is looking at (10 ops)

Vector = Entity:aimNormal()

Returns a normalized directional vector perpendicular to the surface pointed at (10 ops)

Bone = Entity:aimBone()

Returns the bone the player is currently aiming at (10 ops)

runOnPlayerConnect(Number Activate)

If set to 0, the chip will no longer run on player connect events, otherwise it makes this chip execute when someone connects. Only needs to be called once, not in every execution (3 ops)

Number = playerConnectClk()

Returns 1 if the chip is being executed because of a player connect event. Returns 0 otherwise (3 ops)

Entity = lastConnectedPlayer()

Returns the last player to connect. (3 ops)

runOnPlayerDisconnect(Number Activate)

If set to 0, the chip will no longer run on player disconnect events, otherwise it makes this chip execute when someone disconnects. Only needs to be called once, not in every execution (3 ops)

Number = playerDisconnectClk()

Returns 1 if the chip is being executed because of a player disconnect event. Returns 0 otherwise (3 ops)

Entity = lastDisconnectedPlayer()

Returns the last player to disconnect. Must be done while in a disconnectClk() as anytime after the player object is gone. (3 ops)

runOnDeath(Number Active)

If set to 0, chip won't run on players dying (5 ops)

Number = deathClk()

Returns if the E2 was triggered by a death (5 ops)

Number = lastDeathTime()

Returns the last time a player died (5 ops)

Number = lastDeathTime(Entity Ply)

Returns the last time given player died (5 ops)

Entity = lastDeathVictim()

Returns the last player to die (5 ops)

Entity = lastDeathInflictor()

Returns the entity that inflicted the last death (5 ops)

Entity = lastDeathInflictor(Entity Ply)

Returns the entity that inflicted the given player's last death (5 ops)

Entity = lastDeathAttacker()

Returns the attacker who killed the last player to die (5 ops)

Entity = lastDeathAttacker(Entity Ply)

Returns the attacker who killed the player provided in their last death (5 ops)

Number = spawnClk()

Returns if the E2 was triggered by a player spawning (5 ops)

runOnSpawn(Number Activate)

If set to 0, chip won't run on players spawning (5 ops)

Number = lastSpawnTime()

Returns the last time a player spawned (5 ops)

Number = lastSpawnTime(Entity Ply)

Returns the last time the given player spawned (5 ops)

Entity = lastSpawnedPlayer()

Returns the last player to spawn (5 ops)