-
logo destroy
Hello
Why Logorank1 is not destroy
Who can help me ?
Code:
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";
}
}
-
you forgot to use { } in third if, try this
PHP Code:
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";
}
}
}
-
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.