Es fire

From EventScripts Community Encyclopedia


Overview

Syntax: es_fire <userid> <classname or targetname> <input name> [optional parameter] [delay]

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_xfire

Description

Cause a player to manipulate game entities. It works the same as Valve's "ent_fire" but you can force players to run it without cheats

Parameters

  • userid - Player that you wish to trigger the event
  • classname/targetname - Class or Target to trigger
  • input name - All entities have different input triggers
  • value - Value of input you wish to change.
  • delay - Delay the action for x seconds.


Examples

event player_spawn
{
   // set the player's personal gravity
   es_fire event_var(userid) !self addoutput "gravity 400"
}

The above example will set the player's gravity to 400 times the current server value. This is to say that the gravity is a multiplier value. If you wanted to set a player's gravity to half that of the server's then you would use 0.5 as the gravity value.

event player_spawn
{
   // Strip the player's weapons.
   es_give event_var(userid) player_weaponstrip
   es_fire event_var(userid) player_weaponstrip strip
}

The above example will strip the player from all their weapons on player_spawn. Be sure to use es_delayed, if you're going to add an es_give command afterwards.

event player_hurt
{
   es_fire event_var(userid) !self sethealth 100
}

The above example sets a player's health to 100 everytime he's hurt. However, if the player took over 100 damage, it will not revive him.

event player_hurt
{
   es_fire event_var(attacker) !picker ignite
}

The above example will burn the player that the attacker's is looking at, when a player is taking damage.

event player_spawn
{
   es_fire event_var(userid) weapon_awp kill
}

The above example will remove all the AWPs whenever a player spawn.


Notes

  • Parameters may not always be the same for every situation
  • Please note that Valve's entity message engine (which es_fire uses) does not resolve es_fire messages right away. These may require a gameframe or more before they finish. You may need to delay other commands that depend on the es_fire results such that they happen after es_fire messages are handled by Valve's entity manager.
  • This command is a wrapper around Valve's ent_fire command and can do just about everything it can. (See below for external links on ent_fire.)


See also

blog comments powered by Disqus