Destroy all objects in one time?
#3

Quote:
Originally Posted by [NWA]Hannes
Посмотреть сообщение
In your fs:
pawn Код:
//Above main
new bool:ScriptObject[MAX_OBJECTS];

//At OnFilterScriptInit
DestroyScriptObjects();
CreateScriptObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ); //This does same thing as CreateObject and are the same params etc.

//At OnFilterScriptExit
DestroyScriptObjects();

//Somewhere in script
stock CreateScriptObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ)
{
    Snew objectid = CreateObject(modelid, X, Y, Z, rX, rY, rZ);
    ScriptObject[objectid] = true;
}

stock DestroyScriptObjects()
{
    for(new o=0; o<sizeof(ScriptObject); o++)
    {
        if(ScriptObject[o])
        {
            DestroyObject(o);
            ScriptObject[o]=false;
        }
    }
}
Use "CreateScriptObject" function instead of CreateObject.
Super! Ty!
Reply


Messages In This Thread
Destroy all objects in one time? - by Nameless303 - 19.08.2010, 11:00
Re: Destroy all objects in one time? - by [NWA]Hannes - 19.08.2010, 11:07
Re: Destroy all objects in one time? - by Nameless303 - 19.08.2010, 11:14
Re: Destroy all objects in one time? - by Claude - 19.08.2010, 11:18
Re: Destroy all objects in one time? - by Nameless303 - 19.08.2010, 11:22
Re: Destroy all objects in one time? - by Nameless303 - 19.08.2010, 11:24
Re: Destroy all objects in one time? - by Claude - 19.08.2010, 11:30
Re: Destroy all objects in one time? - by iggy1 - 19.08.2010, 11:42
Re: Destroy all objects in one time? - by Nameless303 - 19.08.2010, 12:40
Re: Destroy all objects in one time? - by [NWA]Hannes - 19.08.2010, 13:02

Forum Jump:


Users browsing this thread: 1 Guest(s)