English How to get gamemode

10 replies
Goto Page
To the start Previous 1 Next To the start
07.04.13 07:06:20 pm
Up
SnipeR95
User
Offline Off
How to get gamemode in lua ?
@file cs2d SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @file cs2d Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !
07.04.13 07:11:31 pm
Up
Rainoth
Moderator
Offline Off
Code:
1
parse("sv_gm value")


0 - standart
1- Deathmatch (I think xD)
2 - Team Deathmatch
3 - Construction
4 - Zombies !
07.04.13 07:13:13 pm
Up
SnipeR95
User
Offline Off
user Rainoth has written:
Code:
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.
@file cs2d SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @file cs2d Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !
07.04.13 07:13:21 pm
Up
DC
Admin
Offline Off
He asked how to get it, not how to set it
Use cs2d lua cmd game
Code:
1
gameMode=game("sv_gm")

Note that the returned value will be a string
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
07.04.13 07:13:23 pm
Up
Alistaire
User
Offline Off
Code:
1
game(sv_gm)
IMG:http://i.imgur.com/5zhwOTP.png
07.04.13 07:15:56 pm
Up
SnipeR95
User
Offline Off
user DC has written:
He asked how to get it, not how to set it
Use cs2d lua cmd game
Code:
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
@file cs2d SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @file cs2d Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !
07.04.13 07:17:04 pm
Up
DC
Admin
Offline Off
You should read the entire description
Quote:
You can use ALL settings like sv_name to get their current value as string(!).
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
07.04.13 07:19:44 pm
Up
SnipeR95
User
Offline Off
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 :

Code:
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
@file cs2d SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @file cs2d Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !
07.04.13 07:20:57 pm
Up
Conscience
User
Offline Off
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.
Remember to learn to forget. Whiskey shots and cheap cigarettes.
07.04.13 07:23:23 pm
Up
SnipeR95
User
Offline Off
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
@file cs2d SnipeR's Admin Script v1.1.5 (8) <-- MOUSE ADMIN CONTROL ! <-|-> @file cs2d Weapon Detector By SnipeR95[TR] v1.2 (17)<-- WEAPON DETECTOR !
07.04.13 07:23:43 pm
Up
DC
Admin
Offline Off
It returns the numeric values but as strings.
"0","1","2" etc.
(this command returns everything as string when used with settings)
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
To the start Previous 1 Next To the start