Mass DestroyObject() ?
#8

if you have all objects created at once than you should go with vince's solution, but if you have it scattered around the script then add this to the top right after the includes:
pawn Код:
new FSObject[MAX_OBJECTS] = {-1,...};
stock FSOBJ_CreateObject(modelid,Float:X,Float:Y,Float:Z,Float:rX,Float:rY,Float:rZ,Float:DrawDistance = 0.0)
{
    new i;
    for(i=0;i<MAX_OBJECTS;i++)
    {
        if(FSObject[i] == -1)break;
    }
    return FSObject[i] = CreateObject(modelid,X,Y,Z,rX,rY,rZ,DrawDistance);
}
#if defined _ALS_CreateObject
    #undef CreateObject
#else
    #define _ALS_CreateObject
#endif
#define CreateObject FSOBJ_CreateObject

stock FSOBJ_DestroyObject(objectid)
{
    for(new i=0;i<MAX_OBJECTS;i++)
    {
        if(FSObject[i] == objectid)
        {
            FSObject[i] = -1;
            break;
        }
    }
    return DestroyObject(objectid);
}
#if defined _ALS_DestroyObject
    #undef DestroyObject
#else
    #define _ALS_DestroyObject
#endif
#define DestroyObject FSOBJ_DestroyObject

stock DestroyAllFSObjects()
{
    for(new i=0;i<MAX_OBJECTS;i++)
    {
        if(FSObject[i] !=-1)
        {
            DestroyObject(FSObject[i]);
            FSObject[i] = -1;
        }
    }
    return 1;
}
and use DestroyAllFSObjects() to destroy all objects Created in the filterscript
Reply


Messages In This Thread
Mass DestroyObject() ? - by Makaveli93 - 11.08.2012, 09:07
Re: Mass DestroyObject() ? - by Joe Staff - 11.08.2012, 09:12
Re: Mass DestroyObject() ? - by Makaveli93 - 11.08.2012, 09:15
Re: Mass DestroyObject() ? - by Joe Staff - 11.08.2012, 09:23
Re: Mass DestroyObject() ? - by IceMeteor - 11.08.2012, 09:29
Re: Mass DestroyObject() ? - by Makaveli93 - 11.08.2012, 10:58
Re: Mass DestroyObject() ? - by Vince - 11.08.2012, 11:09
Re: Mass DestroyObject() ? - by MeDaKewlDude - 11.08.2012, 12:44

Forum Jump:


Users browsing this thread: 1 Guest(s)