Tiny timer help!
#1

Ok i made this command,
Quote:

if(strcmp(cmdtext, "/activatebomb", true) == 0) // car bomb
{
new playa[128];
GetPlayerName(playerid, playa, 24);
if (Cbomb[playerid] == 1)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(carbomb[playerid],X,Y,Z);
SetVehicleHealth(carbomb[playerid],-999);
CreateExplosion(X+1,Y+1,Z+1, 7, 7);
CreateExplosion(X+1,Y+1,Z+1, 7, 7);
}
return 1;
}

I want to add more createexplosion to it, But that explosion should happen 1 sec after the previous explosion, I hope you understand
Reply
#2

pawn Код:
public NewExplosion(vehicleid)
{
    new Float:X,Float:Y,Float:Z;
    GetVehiclePos(vehicleid,X,Y,Z);
    CreateExplosion(X+1,Y+1,Z+1, 7, 7);
}
/activatebomb
pawn Код:
SetTimerEx("NewExplosion", 1000, false, "d", carbomb[playerid]); // 1000 ms = 1 sec
Reply
#3

Erm.. Sorry for this noob question Will it work like this?
SetTimerEx("NewExplosion", 1000, false, "d", carbomb[playerid]);
SetTimerEx("NewExplosion", 2000, false, "d", carbomb[playerid]);
SetTimerEx("NewExplosion", 3000, false, "d", carbomb[playerid]);
Like three bombs simultaneosly in 3 seconds?
Reply
#4

Quote:
Originally Posted by Swiftz
Посмотреть сообщение
Erm.. Sorry for this noob question Will it work like this?
SetTimerEx("NewExplosion", 1000, false, "d", carbomb[playerid]);
SetTimerEx("NewExplosion", 2000, false, "d", carbomb[playerid]);
SetTimerEx("NewExplosion", 3000, false, "d", carbomb[playerid]);
Like three bombs simultaneosly in 3 seconds?
Yes, all bombs explode 1 sec after the last one.
Reply
#5

Ok thanks Mademan P.S:- Another think should i forward as "NewExplosion(Max_Vehicles)?
Reply
#6

Ok i did this i made these timers
Код:
           SetTimerEx("Cexplosion", 500, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 800, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 1000, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 1300, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 1600, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 1800, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 2000, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 2400, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 2700, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 2800, false, "d", carbomb[playerid]);
           SetTimerEx("Cexplosion", 3000, false, "d", carbomb[playerid]);
But all explosions take place at the same time, But i need it to explode one after the other, like time gap half a sec , So please tell what do do, Thnx
And
Код:
public Cexplosion(vehicleid)
{
	for(new i; i < MAX_PLAYERS; i++)
	{
       new Float:X,Float:Y,Float:Z;
       GetVehiclePos(carbomb[i],X,Y,Z);
       CreateExplosion(X+1,Y+1,Z+1, 7, 7);
       CreateExplosion(X+2,Y+2,Z+2, 7, 10);
       CreateExplosion(X+4,Y+4,Z+4, 7, 10);
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)