can't destroy element
Hello guys.
I have a problem. I made little test mod to do something.
When you kill someone you got an icon at topright. It works.
After death Icon will destroyed. But it doesn't work.
_rank.gsc
[php]#include <...>
displayIcon()
{
self endon("disconnect");
self endon("death");
self waittill("killed_enemy");
self iPrintlnBold("^1Ta-da!");
pr8_icon = createIcon("rank_prestige8", 40, 40);
pr8_icon setPoint("CENTER", "TOPRIGHT", -50, 50);
pr8_icon.hideWhenInMenu = true;
pr8_icon.foreground = true;
}
destroyIcon()
{
self endon("disconnect");
for(;
{
self waittill("death");
self.pr8_icon destroyElem();
wait 1;
}
}
init()
{
<...>
precacheShader("white");
precacheShader("rank_prestige8");
<...>
}
<...>
onPlayerSpawned()
{
self endon("disconnect");
for(;
{
self waittill("spawned_player");
self thread displayIcon();
self thread destroyIcon();
}
}
<...>
[/php]
Sorry for lame english. I hope you understand me.
I have a problem. I made little test mod to do something.
When you kill someone you got an icon at topright. It works.
After death Icon will destroyed. But it doesn't work.
_rank.gsc
[php]#include <...>
displayIcon()
{
self endon("disconnect");
self endon("death");
self waittill("killed_enemy");
self iPrintlnBold("^1Ta-da!");
pr8_icon = createIcon("rank_prestige8", 40, 40);
pr8_icon setPoint("CENTER", "TOPRIGHT", -50, 50);
pr8_icon.hideWhenInMenu = true;
pr8_icon.foreground = true;
}
destroyIcon()
{
self endon("disconnect");
for(;

{
self waittill("death");
self.pr8_icon destroyElem();
wait 1;
}
}
init()
{
<...>
precacheShader("white");
precacheShader("rank_prestige8");
<...>
}
<...>
onPlayerSpawned()
{
self endon("disconnect");
for(;

{
self waittill("spawned_player");
self thread displayIcon();
self thread destroyIcon();
}
}
<...>
[/php]
Sorry for lame english. I hope you understand me.

