Es event setstring

From EventScripts Community Encyclopedia


Overview

Syntax: es_event setstring <event-name> <name> <string>

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 setstring

Description

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

Parameters

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


Examples

event player_chat
{
	// Bring said text to lowercase
	es_xset saidtext event_var(text) "the string in lowercase"
	forcecase saidtext lower
	// Initalize event, set textstring to lowercase and fire event
	es_xevent initialize player_spoke
	es_event setstring player_spoke textstring server_var(saidtext)
	es_event setint player_spoke userid event_var(userid)
	es_xevent fire player_spoke
}
 
event player_spoke
{
	// Show the player his lowercase text
	es_tell event_var(userid) event_var(textstring)
}


Notes

  • This command is recommended for strings only. For numbers like userid use es_event setint
  • Only es_event set* command whichs is a zero terminated string
  • First introduced in EventScripts v1.5


See also

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