Switch flags?

Locked
Rawing
Posts: 107
Joined: Tue Oct 23, 2007 1:40 pm

Switch flags?

Post 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.
[color=#FF0000]/callvote kick all_enemies[/color]
Rawing
Posts: 107
Joined: Tue Oct 23, 2007 1:40 pm

Re: Switch flags?

Post by Rawing »

Works like this:

Code: Select all

strcpy(ent->classname, "team_CTF_redflag"); 
<.<
>.>
[color=#FF0000]/callvote kick all_enemies[/color]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Switch flags?

Post by ^misantropia^ »

The devil is in the details, isn't he? =)
Rawing
Posts: 107
Joined: Tue Oct 23, 2007 1:40 pm

Re: Switch flags?

Post 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
[color=#FF0000]/callvote kick all_enemies[/color]
Locked