PDA

View Full Version : logo destroy



malyczolg
17th February 2013, 08:07
Hello

Why Logorank1 is not destroy
Who can help me ?


czolgowo()
{

if(self.rankc > 0)
{
self.logorank1 = newClientHudElem(self);
self.logorank1.x = 30;
self.logorank1.y = 30;
self.logorank1.alignX = "right";
self.logorank1.alignY = "middle";
self.logorank1.sort = -3;
self.logorank1.alpha = 1;
self.logorank1.fontScale = 1.3;
self.logorank1.archived = true;
self.logorank1.label = &"^1RANK";
}

if(self.rankc > 5)
{
if(isDefined(self.logorank1)) self.logorank1 destroy();
self.logorank2 = newClientHudElem(self);
self.logorank2.x = 20;
self.logorank2.y = 20;
self.logorank2.alignX = "right";
self.logorank2.alignY = "middle";
self.logorank2.sort = -3;
self.logorank2.alpha = 1;
self.logorank2.fontScale = 1.3;
self.logorank2.archived = true;
self.logorank2.label = &"^2RANK";
}
}

kat_
5th March 2013, 20:15
you forgot to use { } in third if, try this


czolgowo()
{

if(self.rankc > 0)
{
self.logorank1 = newClientHudElem(self);
self.logorank1.x = 30;
self.logorank1.y = 30;
self.logorank1.alignX = "right";
self.logorank1.alignY = "middle";
self.logorank1.sort = -3;
self.logorank1.alpha = 1;
self.logorank1.fontScale = 1.3;
self.logorank1.archived = true;
self.logorank1.label = &"^1RANK";
}

if(self.rankc > 5)
{
if(isDefined(self.logorank1))
{
self.logorank1 destroy();
self.logorank2 = newClientHudElem(self);
self.logorank2.x = 20;
self.logorank2.y = 20;
self.logorank2.alignX = "right";
self.logorank2.alignY = "middle";
self.logorank2.sort = -3;
self.logorank2.alpha = 1;
self.logorank2.fontScale = 1.3;
self.logorank2.archived = true;
self.logorank2.label = &"^2RANK";
}
}
}

IzNoGoD
5th March 2013, 20:40
What have you tried to debug yourself?

I see a clear lack of any debugging in all of your code you post.

Are you familiar with the purpose of debugging? It is to find why certain things are happening in the code. Add a few iprintlns on strategic locations in the code and try to debug it yourself.