26.02.2012, 07:00
Okay well it's basically simple:-
I am on phone sorry for any mistake hope this helps you.
Use CreateObject from the following link:-
https://sampwiki.blast.hk/wiki/CreateObject
-FalconX
pawn Код:
new totalobj[TOTALNUMBER_OF_OBJECTS];
public OnGameModeInit()
{
totalobj[0] = CreateObject();
totalobj[1] = CreateObject();
totalobj[2] = CreateObject();
// rest if the objects
SetTimer("RespawnAllObj", 60000, 1); // here it keeps on repeating the respawn process on every 60 seconds you can increase the time if you want.
}
forward RespawnAllObj();
public RespawnAllObj() // main function which the timer does. After every 60 seconds this process is repeated.
for(new i = 0; i < sizeof(totalobj); i ++) // this is a loop which take all the objects from totalobj and destroys.
{
DestroyObject(totalobj[i]);
}
//Then recreate them, just use the code you used in OnGameModeInit to create them:
totalobj[0] = CreateObject();
totalobj[1] = CreateObject();
totalobj[2] = CreateObject();
// ... Rest of the objects.
}
Use CreateObject from the following link:-
https://sampwiki.blast.hk/wiki/CreateObject
-FalconX