Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
How to get gamemode
10 replies![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)
1
parse("sv_gm value")
0 - standart
1- Deathmatch (I think xD)
2 - Team Deathmatch
3 - Construction
4 - Zombies !
![user](img/i_friend.png)
1
parse("sv_gm value")
0 - standart
1- Deathmatch (I think xD)
2 - Team Deathmatch
3 - Construction
4 - Zombies !
i don't want parse, i want get.
![](img/smiles/wink.gif)
Use
![cs2d lua cmd](img/i_codehelp.png)
1
gameMode=game("sv_gm")
1
game(sv_gm)
![user](img/i_friend.png)
He asked how to get it, not how to set it
Use
game
Note that the returned value will be a string
![](img/smiles/wink.gif)
Use
![cs2d lua cmd](img/i_codehelp.png)
1
gameMode=game("sv_gm")
Thanks DC. i searched
![cs2d lua cmd](img/i_codehelp.png)
version: the current game version
dedicated: boolean, true if server is dedicated, false otherwise
phase: game phase, 0 for freezetime, 1 for actual game
round: current round
score_t: score of terrorists (rounds won)
score_ct: score of counter-terrorists (rounds won)
winrow_t: rounds won in a row by terrorists
winrow_ct: rounds won in a row by counter-terrorists
nextmap: the next map in the map cycle (sys/mapcycle.cfg)
port: UDP port used by the server
bombplanted: boolean, true if bomb is currently planted and blinking, false otherwise
Thanks
![](img/smiles/smile.gif)
![](img/smiles/wink.gif)
Quote
You can use ALL settings like sv_name to get their current value as string(!).
![user](img/i_friend.png)
You should read the entire description
![](img/smiles/wink.gif)
Quote
You can use ALL settings like sv_name to get their current value as string(!).
oops
![](img/smiles/bigsmile.gif)
![](img/smiles/bigsmile.gif)
one question more :
1
game("sv_gm")
what is return value ?
0
1
2
3
4
Or
"Standard"
"Deathmatch"
....
..
?_
edited 1×, last 07.04.13 07:23:43 pm
Also standard is with a d at the end.
![user](img/i_friend.png)
Go and see what it returns. Most likely 0-4 seeing as you set it with these values.
Also standard is with a d at the end.
Also standard is with a d at the end.
i tested. it returns Number string value.
"0"
"1"
"2"
"3"
"4"
edited 1×, last 07.04.13 07:24:22 pm
"0","1","2" etc.
(this command returns everything as string when used with settings)
![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)