Es event setfloat

From EventScripts Community Encyclopedia


Overview

Syntax: es_event setfloat <event-name> <name> <float>

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_xevent setfloat

Description

Sets for the initialized event <event-name> the event_var(<name>)to the <float>

Parameters

  • event-name - The name of the event you want to use
  • name - The name of the event_var()
  • float - String to set the event_var() after a float


Examples

//eventscripts_noisy 1
event player_death
{
	if (event_var(headshot) == 1) do
	{
		// set vars
		es_set x "0"
		es_set y "0"
		es_set z "0"
		es_set vectorstring "0"
		
		// get the playerlocation of the victim
		es_getplayerlocation x y z event_var(userid)
		
		// add 70 to get the head position
		es_math z + 70
 
		// prepare a event player_headshot to be fired
		es_event initialize player_headshot
		es_event setint player_headshot userid event_var(attacker)
		es_event setfloat player_headshot head_x server_var(x)
		es_event setfloat player_headshot head_y server_var(y)
		es_event setfloat player_headshot head_z server_var(z)
		es_event fire player_headshot
	}
}
 
event player_headshot
{
	// do some effects with the victims head :)
}


Notes

  • This command is best for mathresults or playerloctations.
  • First introduced in EventScripts v1.5


See also

  • es_event -- see all other es_event commands.
blog comments powered by Disqus