Es createplayerlist
From EventScripts Community Encyclopedia
|
[edit] OverviewSyntax: 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: es_xcreateplayerlist [edit] DescriptionCreates a keygroup with a list of all players with info about them. It uses userids as the keys within that keygroup.
[edit] Parameters
[edit] Exampleses_createplayerlist test would create the following if only one bot were on-line: "test"
{
"2"
{
"name" "Mattie!"
"steamid" "STEAM_ID_LAN"
"index" "1"
"teamid" "3"
"kills" "0"
"deaths" "0"
"armor" "0"
"model" "models/player/ct_gign.mdl"
"isdead" "0"
"isbot" "0"
"ishltv" "0"
"isobserver" "0"
"isinavehicle" "0"
"health" "100"
"serialnumber" "395"
"weapon" "weapon_scout"
"handle" "85504001"
"ping" "5"
"packetloss" "0"
"timeconnected" "22.330658"
"address" "127.0.0.1:27005"
"x" "640.000000"
"y" "-760.000000"
"z" "-615.968750"
"language" "english"
}
}
Sample code for a single player: event player_say { // create the player info for a single player es_createplayerlist singleplayer event_var(userid) // now look-up an item from the player info es_xsetinfo splayer_isdead 0 es_keygetvalue splayer_isdead singleplayer event_var(userid) isdead if (server_var(splayer_isdead) > 0) do { es_msg The player is dead! } }
[edit] Notes
[edit] See also |
