Forum

> > CS2D > Scripts > How to get gamemode
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How to get gamemode

10 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: How to get gamemode

Rainoth
Moderator Off Offline

Zitieren
1
parse("sv_gm value")

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

alt Re: How to get gamemode

SnipeR95
User Off Offline

Zitieren
user Rainoth hat geschrieben
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.

alt Re: How to get gamemode

DC
Admin Off Offline

Zitieren
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

alt Re: How to get gamemode

SnipeR95
User Off Offline

Zitieren
user DC hat geschrieben
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

alt Re: How to get gamemode

DC
Admin Off Offline

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

alt Re: How to get gamemode

SnipeR95
User Off Offline

Zitieren
user DC hat geschrieben
You should read the entire description
Zitat
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"
....
..

?_
1× editiert, zuletzt 07.04.13 19:23:43

alt Re: How to get gamemode

Conscience
User Off Offline

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

alt Re: How to get gamemode

SnipeR95
User Off Offline

Zitieren
user Conscience hat geschrieben
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"
1× editiert, zuletzt 07.04.13 19:24:22

alt Re: How to get gamemode

DC
Admin Off Offline

Zitieren
It returns the numeric values but as strings.
"0","1","2" etc.
(this command returns everything as string when used with settings)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht