Help with explosion timer
#1

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;
}
Reply
#2

Add this into your public boomtimer.

PHP код:
KillTimer(BoomTimer); 
Reply
#3

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;

Reply
#4

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.
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)