Page 1 of 1
player.dmteam=freeforall
Posted: Tue May 18, 2004 12:32 am
by wacko
I did a search in the forum and there are many posts stating (like the Game Module Classes) that player.dmteam can return spectator, allies, axis and... freeforall.
But when does it? I have a test map where I start in FFA, choose a team (I have to, cant start as a FreeForAll

) and then player.dmteam well it returns the team i've chosen.
Or is there another way to let the script know whether that level was started as FFA or TDM?
Posted: Tue May 18, 2004 1:12 am
by lizardkid
if(g_gametype = 2)
{
//FFA
iprintln "we got us a FFA here billy!"
}
else{
iprintln "aw shucks...."
}
not certain 2 is FFA, check with jv_map
gametype 1
Posted: Tue May 18, 2004 2:45 am
by tltrude
Sorry LizardKid, but that wont work. FFA is gametype 1, and you didn't put "getcvar" or "==".
Code: Select all
game_check:
wait 20
iprintln "Game is: " (getcvar g_gametypestring) // text
iprintln "Game type: " (getcvar g_gametype) // number
end
You can also apply those values to variables.
level.gametxt = (getcvar g_gametypestring)
level.gamenum = (getcvar g_gametype)
Type "cvarlist" in the console, during a game, to see all the stuff you can "get".
Posted: Tue May 18, 2004 7:06 am
by wacko
hey Tom
thanks a lot!
I knew there ought to be a way.
Posted: Tue May 18, 2004 8:20 am
by wacko
getcvar g_gametype returns a string not a value, so this would be LizardKid's lines the way they ought to work:
Code: Select all
if(getcvar g_gametype == "1")
{
//FFA
iprintln "we got us a FFA here billy!"
}
else
{
iprintln "aw shucks...."
}
Posted: Tue May 18, 2004 9:47 am
by bdbodger
try if(int (getcvar g_gametype) == 1)
I had the same problem you have to use int or float for numbers
Posted: Tue May 18, 2004 2:03 pm
by wacko
thnx, bodger, but why should i? the way i did (with quotes) is working perfectly...
