Destroy Object.
#1

Hey guys I have a fire system ( https://sampforum.blast.hk/showthread.php?tid=226953 ) and I tried to do that the fire will Extiguishing itself by timer and I did like that but it doesn't work:

pawn Код:
new firec;
new fire1;
new fire2;
new fire3;

    SetTimer("DestroyFireTimer", 70000, 1);

    fire1 = CreateFire(RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
    fire2 = CreateFire(RandomSpawn[rand][0]-2, RandomSpawn[rand][1], RandomSpawn[rand][2]+3);
    fire3 = CreateFire(RandomSpawn[rand][0]+3, RandomSpawn[rand][1], RandomSpawn[rand][2]+5);

    forward DestroyFireTimer(id);
    public DestroyFireTimer(id)
    {
     DestroyObject(Flame[id][Flame_id]);
     Flame[id][Flame_Exists] = 0;
     Flame[id][Flame_pos][0] = 0.0;
     Flame[id][Flame_pos][1] = 0.0;
     Flame[id][Flame_pos][2] = 0.0;
     DestroyObject(fire1);
     DestroyObject(fire2);
     DestroyObject(fire3);
     RemoveSmokeFromFire(id);
     DestroyFire(id);
   }
Can someone track the problem..?
Reply
#2

Use DestroyFire(fire1); and so on. Look at the fire script you've downloaded your using CreateFire to make a fire and when you want it to destroy you must use DestroyFire.
Reply
#3

Quote:
Originally Posted by DexterC
Посмотреть сообщение
Use DestroyFire(fire1); and so on. Look at the fire script you've downloaded your using CreateFire to make a fire and when you want it to destroy you must use DestroyFire.
I tried to to like that:

pawn Код:
public DestroyFireTimer(id)
    {
     DestroyObject(Flame[id][Flame_id]);
     Flame[id][Flame_Exists] = 0;
     Flame[id][Flame_pos][0] = 0.0;
     Flame[id][Flame_pos][1] = 0.0;
     Flame[id][Flame_pos][2] = 0.0;
     DestroyFire(fire1);
     DestroyFire(fire2);
     DestroyFire(fire3);
     RemoveSmokeFromFire(id);
    for(new x = 0; x < MAX_PLAYERS; x++)
    {
    SendClientMessage(x, COLOR_RED, "dsadsa");
    }
   }
But its the same .. :\
Reply
#4

UP..
Reply
#5

Do this:
pawn Код:
new firec;
new fire1;
new fire2;
new fire3;

fire1 = CreateFire(RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
fire2 = CreateFire(RandomSpawn[rand][0]-2, RandomSpawn[rand][1], RandomSpawn[rand][2]+3);
fire3 = CreateFire(RandomSpawn[rand][0]+3, RandomSpawn[rand][1], RandomSpawn[rand][2]+5);

SetTimerEx("DestroyFire", 70000, "d", fire1);
SetTimerEx("DestroyFire", 70000, "d", fire2);
SetTimerEx("DestroyFire", 70000, "d", fire3);
Reply
#6

Quote:
Originally Posted by Meta
Посмотреть сообщение
Do this:
pawn Код:
new firec;
new fire1;
new fire2;
new fire3;

fire1 = CreateFire(RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
fire2 = CreateFire(RandomSpawn[rand][0]-2, RandomSpawn[rand][1], RandomSpawn[rand][2]+3);
fire3 = CreateFire(RandomSpawn[rand][0]+3, RandomSpawn[rand][1], RandomSpawn[rand][2]+5);

SetTimerEx("DestroyFire", 70000, "d", fire1);
SetTimerEx("DestroyFire", 70000, "d", fire2);
SetTimerEx("DestroyFire", 70000, "d", fire3);
Hey bro thanks for replaying man I really thankful for that however I get some errors..

pawn Код:
C:\Program Files\GTA - San Andreas\Server\gamemodes\base.pwn(20748) : error 035: argument type mismatch (argument 3)
C:\Program Files\GTA - San Andreas\Server\gamemodes\base.pwn(20749) : error 035: argument type mismatch (argument 3)
C:\Program Files\GTA - San Andreas\Server\gamemodes\base.pwn(20750) : error 035: argument type mismatch (argument 3)

Lines:
    SetTimerEx("DestroyFire1", 60000, "d", fire1);
    SetTimerEx("DestroyFire1", 60000, "d", fire2);
    SetTimerEx("DestroyFire1", 60000, "d", fire3);
Reply
#7

Quote:
Originally Posted by kubeba59
Посмотреть сообщение
Hey bro thanks for replaying man I really thankful for that however I get some errors..

Код:
C:\Program Files\GTA - San Andreas\Server\gamemodes\base.pwn(20748) : error 035: argument type mismatch (argument 3)
C:\Program Files\GTA - San Andreas\Server\gamemodes\base.pwn(20749) : error 035: argument type mismatch (argument 3)
C:\Program Files\GTA - San Andreas\Server\gamemodes\base.pwn(20750) : error 035: argument type mismatch (argument 3)

Lines:
    SetTimerEx("DestroyFire1", 60000, "d", fire1);
    SetTimerEx("DestroyFire1", 60000, "d", fire2);
    SetTimerEx("DestroyFire1", 60000, "d", fire3);
Oops.
pawn Код:
SetTimerEx("DestroyFire", 60000, false, "d", fire1);
SetTimerEx("DestroyFire", 60000, false, "d", fire2);
SetTimerEx("DestroyFire", 60000, false, "d", fire3);
Reply
#8

Quote:
Originally Posted by Meta
Посмотреть сообщение
Oops.
pawn Код:
SetTimerEx("DestroyFire", 60000, false, "d", fire1);
SetTimerEx("DestroyFire", 60000, false, "d", fire2);
SetTimerEx("DestroyFire", 60000, false, "d", fire3);
Bro its still not dissapiring plz help..
Reply
#9

UP plz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)