SA-MP Forums Archive
Help with explosion timer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with explosion timer (/showthread.php?tid=657680)



Help with explosion timer - victory88 - 13.08.2018

When I type /boom the explosion work, I wait the 10000ms for the timer to stop, then the text in the timer "called" and the coordinates are both called and appear normally, however no explosion!!?? I am really not sure what's going on, been trying all kinds of things.

Код:
CMD:boom(playerid, params[])
{
    new Float:x, Float:y, Float:z;

    x = 38.24;
    y = -23.23;
    z = 1.17;
    
    CreateExplosion(x, y, z, 7, 13.0);

    SetTimerEx("BoomTimer", 10000, false, "fff", x,y,z);

    return 1;
}

forward BoomTimer(x,y,z);
public BoomTimer(x,y,z)
{
    SendClientMessageToAll(-1, "called");
	
    new string[32];

    format(string, sizeof(string), "%f %f %f", x,y,z);
    SendClientMessageToAll( -1, string);

    CreateExplosion(x, y, z, 7, 13.0);
    return 1;
}



Re: Help with explosion timer - RedRex - 13.08.2018

Add this into your public boomtimer.

PHP код:
KillTimer(BoomTimer); 



Re: Help with explosion timer - David (Sabljak) - 13.08.2018

I will rather try this and use global variable for x,y,z and have it multi functional. And use SetTimer not Ex

PHP код:
new Float:BoomXFloat:BoomYFloat:BoomZ//Somewhere on top

CMD:boom(playeridparams[])
{
    
BoomX 38.24;
    
BoomY = -23.23;
    
BoomZ 1.17;
    
CreateExplosion(BoomXBoomYBoomZ713.0);
    
SetTimer("BoomTimer"10000false);
    return 
1;
}

forward BoomTimer();
public 
BoomTimer()
{
    
SendClientMessageToAll(-1"called");
    new 
string[32];
    
format(stringsizeof(string), "%f %f %f"BoomX,BoomY,BoomZ);
    
SendClientMessageToAll( -1string);
    
CreateExplosion(BoomXBoomYBoomZ713.0);
    return 
1;




Re: Help with explosion timer - Kane - 13.08.2018

Your BoomTimer functions arguments need to have a Float tag.

i.e: Float:x, Float:y, Float:z.

Also, I DON'T recommend doing what David proposed.


Re: Help with explosion timer - victory88 - 13.08.2018

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Your BoomTimer functions arguments need to have a Float tag.

i.e: Float, Float:y, Float:z.

Also, I DON'T recommend doing what David proposed.
Yes that did solve it. That's exactly why I formatted a message to see the output, and the output was in point values. So that did not cross my mind. But it's very reasonable that it's the reason. Thank you.