How to create a custom cvar, example:
swhud 0
swhud 1
to do, something like this:
Code:if swhud == 0 { showhuds } else { hidehuds }
How to create a custom cvar, example:
swhud 0
swhud 1
to do, something like this:
Code:if swhud == 0 { showhuds } else { hidehuds }
getcvar "swhud"
setcvar "swhud"
but I recommend using level scope variables instead,
level.swhud
Discord: RyBack#4239
fb: https://www.facebook.com/mohabhassan312
If you use setcvar you can set any cvar you whant.
If you check the cvar on the script it will act as the cvar is already created:
Code:local.cvar = getcvar "swhud" if(local.cvar == "1") { //swhud 1 //code } else { //swhud 0 //code }
Last edited by DoubleKill; May 29th, 2018 at 06:01 AM.
Very well, thank you, for the help.
I was able to do the following script with cvar,
It consists of displaying message by console
in case of changing the value of cvar "msg" to "1"
Code:main: level waittill playerspawn thread mensaje end mensaje: while(1) { level.msg = getcvar(msg) if (level.msg == "1"){ stuffsrv "say msg = 1" setcvar "msg" "0" } waitframe } end