Forum

> > CS2D > Scripts > How to get gamemode
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to get gamemode

10 replies
To the start Previous 1 Next To the start

old Re: How to get gamemode

Rainoth
Moderator Off Offline

Quote
1
parse("sv_gm value")

0 - standart
1- Deathmatch (I think xD)
2 - Team Deathmatch
3 - Construction
4 - Zombies !

old Re: How to get gamemode

SnipeR95
User Off Offline

Quote
user Rainoth has written
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.

old Re: How to get gamemode

DC
Admin Off Offline

Quote
He asked how to get it, not how to set it
Use cs2d lua cmd game
1
gameMode=game("sv_gm")
Note that the returned value will be a string

old Re: How to get gamemode

SnipeR95
User Off Offline

Quote
user DC has written
He asked how to get it, not how to set it
Use cs2d lua cmd game
1
gameMode=game("sv_gm")
Note that the returned value will be a string


Thanks DC. i searched cs2d lua cmd game but i can't find "sv_gm" in this list.

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

old Re: How to get gamemode

DC
Admin Off Offline

Quote
You should read the entire description
Quote
You can use ALL settings like sv_name to get their current value as string(!).

old Re: How to get gamemode

SnipeR95
User Off Offline

Quote
user DC has written
You should read the entire description
Quote
You can use ALL settings like sv_name to get their current value as string(!).


oops i didn't see

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

old Re: How to get gamemode

Conscience
User Off Offline

Quote
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.

old Re: How to get gamemode

SnipeR95
User Off Offline

Quote
user Conscience has written
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.


i tested. it returns Number string value.
"0"
"1"
"2"
"3"
"4"
edited 1×, last 07.04.13 07:24:22 pm

old Re: How to get gamemode

DC
Admin Off Offline

Quote
It returns the numeric values but as strings.
"0","1","2" etc.
(this command returns everything as string when used with settings)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview