Originally Posted by
kung foo man
Instead of while (1) you can check while (isDefined(self)) or use endon at top of method
After doing this:
PHP Code:
if (isAlive(self) && !self.flagAttached && self.pers["team"] == "allies" || self.pers["team"] == "axis")
should i do like this?
my code is resistant to this if you have properly organized code (default, standard from .iwd) and use "thread"
try set self.flagAttached = false by default
p.s: and try fix some by self, if you write all time when has error - you not learning
use .iwd, this is how i do it.
I have no clue how this is done.
I'm trying to solve the errors myself, I'm testing. If I can't solve it, I write it here, not every mistake.
for example
PHP Code:
(team == "allies" || team == "axis"))
fixed the error like this
PHP Code:
self.pers["team"] == "allies" || self.pers["team"] == "axis")
////
this is the last edit. I couldn't fix the flag bearer.
PHP Code:
self.previousPosition = self.origin;
self.campTik = 0;
while (1)
{
if (isAlive(self) && !self.flagAttached && self.pers["team"] == "allies" || self.pers["team"] == "axis")
{
if (distance(self.previousPosition, self.origin) > level.campradius)
{
self.previousPosition = self.origin;
self.campTik = 0;
}
else
self.campTik++;
campingTime = (self.campTik * waitTime);
if (campingTime == level.campsecswarn)
self iprintlnBold("stop camp or be kill!");
if (campingTime == level.campsecspunish)
{
self.campTik = 0;
self iprintlnBold("Camper!");
self suicide();
}
}
wait waitTime;
}
}
this is the last one.