Question Trying to make a antiquit for zombies

s3rp4ntxxx

Known Member
Messages
5
Reaction score
0
Points
101
I am trying to make an antiquit for zombies and I have tried this
Code:
antiQuit(enabled)
{
    if(enabled)
        self thread doAntiQuit();
    else
        self notify("stop_antiquit");
}
doAntiQuit()
{
    self endon("disconnect");
    self endon("stop_antiquit");
    for(;;)
    {
        foreach(player in level.players)
            player maps/mp/gametypes_zm/_globallogic_ui::closemenus();
        wait 0.05;
    }
}
and it does not work when I call antiQuit, am I doing something wrong here?
 

CF4_99

Veteran
Messages
145
Reaction score
57
Points
888
Here is a simple toggle for it.


C++:
AntiQuit()
{
    if(!isDefined(level.AntiQuit))
    {
        level.AntiQuit = true;
        level thread AntiQuitLoop();
    }
    else
        level.AntiQuit = undefined;
}

AntiQuitLoop()
{
    while(isDefined(level.AntiQuit))
    {
        foreach(player in level.players)
            player maps/mp/gametypes_zm/_globallogic_ui::closemenus();
        wait .05;
    }
}
 
Top