How to make a object spawn back, when you have smashed it
#9

Just make a timer that respawns the glass...
on top:
pawn Код:
new glassobject[//the amount of glass objects you have + 1 goes here];
forward RespawnGlass();
in OnGameModeInIt:
pawn Код:
SetTimer("RespawnGlass",7000,1);
whereever you create the glass do like this for each glass object:
pawn Код:
glassobject[0] = CreateObject(................);
glassobject[1] = CreateObject(................);
glassobject[2] = CreateObject(................);
and so on until you reach the last object.

in bottom of the script
pawn Код:
public RespawnGlass()
{
    for(new i; i < sizeof(glassobject); i++)
    {
        DestroyObject(glassobject[i]);
        switch (i) {
        case 0: glassobject[0] = CreateObject(//The first glass cordinates go here);
        case 1: glassobject[1] = CreateObject(//The second glass cordinates go here);
        case 2: //and so on....
        }
     }
     return 1;
}



Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)