Es copy

From EventScripts Community Encyclopedia


Overview

Syntax: es_copy <Variable1> <Variable2>

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_xcopy

Description

Copies the value of one variable to another

Parameters

  • Variable1 - Variable you would like to have a value copied to
  • Variable2 - Variable that will have its value copied to Variable1


Examples

Example 1:

 es_xsetinfo var1 "Hello, How are you?"
 es_xsetinfo var2 "I'm doing great"
 es_msg server_var(var1)
 es_copy var1 var2
 es_msg server_var(var1)

Output:

 Hello, How are you?
 I'm doing great

Example 2:

 es_xsetinfo value 0
 
 es_xsetinfo command sv_gravity
 es_copy value server_var(command)
 es_msg Server Gravity: server_var(value)
 
 es_xsetinfo command sv_airaccelerate
 es_copy value server_var(command)
 es_msg Server Air Acceleration: server_var(value)

Output:

 Server Gravity: 800
 Server Air Acceleration: 10


Notes

  • Quicker than 'es_setinfo var1 server_var(var2)'
  • Useful for dynamically deciding what var to copy (see second example above)
  • If you want to broadcast server variables, use es_msg server_var(CvarHere)


See also


blog comments powered by Disqus