18.03.2011, 18:50
In short: save the object ids, create a timer, destroy all saved ids in the timer function.
pawn Код:
//top of your script
new objectids[number_of_objects];
if (strcmp("/lol", cmdtext, true, 10) == 0)
{
objectids[0] = CreateObject(3666,-510.40856934,965.98443604,34.14291763,0.00000000,0.00000000,0.00000000);
objectids[1] = CreateObject(3666,-510.93872070,964.32263184,36.46486664,0.00000000,0.00000000,0.00000000);
// ...
SetTimer("DeleteObjects", 30000, 0);
//Somewhere in your script:
forward DeleteObjects();
public DeleteObjects()
{
for(new i = 0; i < sizeof(objectids); i ++) DestroyObject(objectids[i]);
}