Apologies if this is a dumb question, I'm a java developer by trade, this may just be me not understanding c++ that well.
I am trying to create a simple mod, disable killcam if a player is killed and their flag is not at base - since then you can use killcam to find the flag carrier.
I noticed the _ctf script file has self.flag.atbase and other.flag.atbase. So first step is to see if I can access those values.
To _killcam I added:
It returns error:Code:if(isdefined(allied_flag.atbase)) { println( "DEBUG: self flag exists" ); println( "DEBUG: self flag value" ); if (allied_flag.atbase) { println( "DEBUG: self flag value is TRUE" ); } else { println( "DEBUG: self flag value is FALSE" ); } } else { println( "DEBUG: self flag does NOT exist" ); }
uninitialised variable 'allied_flag'
I have tried every variable I can think of, they all return uninitialised , which is odd, thought whole point of isdefined is so it wouldn't throw error.
The most success I've had is with if(isdefined(self.flag)). This does not throw error, but hits my else statement and says it does not exist.
What am I doing wrong?