destroy objects with the same id ?
#1

hi
etc i want destory all objects were created and all of them were id 1225

then how to destory all those objects with the same id ?

Код:
	for(new i; i<MAX_OBJECTS; i++)
	{
	     if(IsValidObject(i) && i==1225)
	          DestroyDynamicObject(i);
	}
Reply
#2

Dont confuse model id with object id.
Reply
#3

What you can do is create your own CreateObjectEx to detect the model ids.
pawn Код:
new ModelID[MAX_OBJECTS];//top of script
new ObjectID=0;//top of script

stock CreateObjectEx(modelid,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz)
{
        ObjectID++;
    CreateObject(modelid,x,y,z,rx,ry,rz);
        ModelID[ObjectID]=modelid;
}

//place this where you want it
for(new i; i<MAX_OBJECTS; i++)
{
    if(IsValidObject(i) && ModelID[i]==1225)
    DestroyDynamicObject(i);
}
I didnt tested the code so tell me if you have issues.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)