11.08.2012, 12:44
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:
and use DestroyAllFSObjects() to destroy all objects Created in the filterscript
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;
}