Page 1 of 1

Switch flags?

Posted: Sun Jan 18, 2009 9:27 am
by Rawing
I wanted to make a new game type: The blue flag spawns in red base and the red flag spawns in blue base. What I did is this in G_CallSpawn:

Code: Select all

if( g_gametype.integer == GT_CTT ) {// TROPHIES
		if(Q_stricmp(ent->classname, "team_ctf_redflag") == 0) {
			strcpy(ent->classname, "team_ctf_blueflag"); 
		} else
		if(Q_stricmp(ent->classname, "team_ctf_blueflag") == 0) {
			strcpy(ent->classname, "team_ctf_redflag"); 
		}
	}
What happens is just NOTHING. Both team's base is just empty. I can spawn any weapon, armor, health, holdable,... but flags won't work.

Re: Switch flags?

Posted: Wed Aug 12, 2009 4:40 am
by Rawing
Works like this:

Code: Select all

strcpy(ent->classname, "team_CTF_redflag"); 
<.<
>.>

Re: Switch flags?

Posted: Sun Aug 16, 2009 7:00 pm
by ^misantropia^
The devil is in the details, isn't he? =)

Re: Switch flags?

Posted: Mon Aug 17, 2009 3:34 am
by Rawing
yeah, swell (=
I didn't think of that coz it was like:

Code: Select all

if ( !Q_stricmp(ent->classname, "team_ctf_redflag") ) {
	strcpy(ent->classname, "team_ctf_blueflag"); 
}
and

Code: Select all

if ( !Q_stricmp(ent->classname, "team_ctf_redflag") )
was definitely true >:E