Code:destroyIcon() { self waittill("death"); self.pr8_icon destroy(); }
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.
Code:destroyIcon() { self waittill("death"); self.pr8_icon destroy(); }
Donate:
BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9
Handy Tools/Hacks:
Extreme Injector v3.7.3
A powerful and advanced injector in a simple GUI.
Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!
Minion Since: 13th January 2011
Moderator Since: 6th May 2011
Global Moderator Since: 29th April 2012
Super User/Unknown Since: 23rd July 2013
'Game Hacking' Team Since: 30th July 2013
--My Art--
[Roxas - Pixel Art, WIP]
[Natsu - Drawn]
[Natsu - Coloured]
All drawings are coloured using Photoshop.
--Gifts--
[Kyle]
Talamaur (10-24-2010)
Still not destroyed after death.
Someone can help me? I don't know why master131's solution didn't work. While creating this create-destroy-icon I took the example from Hide and Seek mod. It works there but not here.
Last edited by Blubb1337; 10-25-2010 at 09:39 AM.
Code:destroyIcon() { self endon("disconnect"); for(;;) { self waittill("death"); pr8_icon destroy(); } }
Talamaur (10-25-2010)
[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;
self waittill("death");
pr8_icon destroy();
wait 1;
}
init()
{
<...>
precacheShader("white");
precacheShader("rank_prestige8");
<...>
}
<...>
onPlayerSpawned()
{
self endon("disconnect");
for(;
{
self waittill("spawned_player");
self thread displayIcon();
}
}
<...>
[/php]
Talamaur (10-25-2010)
Avoid doubleposting
/Merged
Talamaur (10-25-2010)
Talamaur (10-25-2010)
Thank you guys for your answers. I solved the problem yourself. Realy wierd for me.
[php]#include <...>
displayIcon()
{
self endon("disconnect");
self endon("death");
self waittill("killed_enemy");
self iPrintlnBold("^1Ta-da!");
self.pr8_icon = createIcon("rank_prestige8", 40, 40);
self.pr8_icon setPoint("CENTER", "TOPRIGHT", -50, 50);
self.pr8_icon.hideWhenInMenu = true;
self.pr8_icon.foreground = true;
}
destroyIcon()
{
self endon("disconnect");
self waittill("death");
if(isDefined(self.pr8_icon))
{
self.pr8_icon destroyElem();
}
}
init()
{
<...>
precacheShader("white");
precacheShader("rank_prestige8");
<...>
}
<...>
onPlayerSpawned()
{
self endon("disconnect");
for(;
{
self waittill("spawned_player");
self thread displayIcon();
self thread destroyIcon();
}
}
<...> [/php]
I missed "self" before "pr8_icon".