From EventScripts Community Encyclopedia
|
Overview
Syntax: playerget <command> [various parameters]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: None.
Description
Gets player information depending on the command
Parameters
- command - Command you want to perform - one of the following
- primary <var> <userid> [var_index] - Get the players Primary weapon
- secondary <var> <userid> [var_index] - Get the players Secondary weapon
- he <var> <userid> [var_index] - 1/0 if the player has an HE Grenade
- sg <var> <userid> [var_index] - 1/0 if the player has a Smoke Grenade
- fb <var> <userid> - 2/1/0 Get the player's number of Flashbangs
- c4 <var> <userid> [var_index] - 1/0 if the player has a Bomb
- weaponindex <var> <userid> <weapon_name> - Get the index of the player's weapon
- viewangle <userid> <return pitch> <return yaw> <return roll> - Get the angle the player is looking
- clip <var> <userid> <weapon / slot> - Get the amount of ammo in the player's clip
- ammo <var> <userid> <weapon / slot> - Get the amount of ammo in the player's reserve
- health <var> <userid> - Get the player's health
- cash <var> <userid> - Get the player's cash
- armor <var> <userid> - Get the player's armor
- speed <var> <userid> - Get the player's speed
- defuser <var> <userid> - 1/0 if the player has a defuser
- viewvector <return vector> <userid> - Get the vector the player is looking in x, y, and z
- distance <var> <player1> <player2> [plane] - Get the distance between 2 players in any plane(x,y,z,xy,xz,yz,xyz)
- isdead <var> <userid> - 1/0 if the player dead or alive
- Commands below were added after the first beta release of ES 1.5. See the Library section of the forum for updates of playergetset.
- noclip <var> <userid> - 1/0 if the player has noclip active or not
- jetpack <var> <userid> - 1/0 if the player has jetpack active or not
- freeze <var> <userid> - 1/0 if the player has freeze active or not
- location <userid> <x> <y> <z> - Location of the player
- flashalpha <var> <userid> - Intensity of the flash hitting player(0-255)
- flashduration <var> <userid> - Duration of the flash hitting player
- viewcoord <userid> <x> <y> <z> - Location of the spot the player is looking at
Examples
// Set a variable to 0
es_setinfo myvar 0
// Get the players primary weapon
es playerget primary myvar event_var(userid) //returns eg. weapon_ak47
// Set another variable to 0
es_setinfo wepindex 0
// Get the players secondary weapon and it's index
es playerget secondary myvar event_var(userid) wepindex //returns the weapon name and index of that weapon
// Get the player's view angle(where they are looking)
es playerget viewangle event_var(userid) x y z //returns the player's pitch, yaw, and roll in x, y, and z
Notes
- These commands are similar to ES Tools "Get" commands
- You can use the userid, Steam ID, or a partial player name for the userid.
- weapon / slot - weapon can be weapon_ak47 or just ak47. Slot can be 1(primary) or 2(secondary)
- To see the syntax just type playerget on the command line or playerget command to see specific commands
- Although this is included in ES2 refer to playerlib for the Python equivalent.
See also
External links
|
|