Est GetViewPlayer

From EventScripts Community Encyclopedia
Syntax: est_GetViewPlayer <identifier> <return userid>
Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Contents

Description

  • If the player is looking at another player, returns that player userid, otherwise returns 0

Parameters

  • identifier - The identifier must be a players:
    • userid
    • steamid
    • username - Partial or full name
  • return userid - The user ID of the person the player is looking at

Example


This will cause it so when ever a player types in !freeze it will stop the player they are looking at from moving.

event player_say
{
 if (event_var(text) = !freeze) do
 {
  es_xset target 0
  es est_getviewplayer event_var(userid) target
  ifx true(target) do
  {
   es est_freeze server_var(target) 1
   es_msg Haha you got frozen!
  }
 }
}

Notes

  • None

See Also

blog comments powered by Disqus