player.dmteam=freeforall

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

player.dmteam=freeforall

Post 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 :wink: ) 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?
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

gametype 1

Post 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".
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

hey Tom :D
thanks a lot!
I knew there ought to be a way.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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...." 
} 
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

try if(int (getcvar g_gametype) == 1)

I had the same problem you have to use int or float for numbers
Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

thnx, bodger, but why should i? the way i did (with quotes) is working perfectly... :D
Post Reply