Count-down [+rep]
#1

Hey guys, now im trying to create count down with timers but i have a prob


the prob. is...when i write /test the 1,2,3 countdowns dont appear as gametext...only the final one (boom)



here is the code:
Quote:

forward boom();
forward one();
forward two();
forward tre();
new ob;


//onfsinit
ob = CreateObject(srry private code);

//onplayercommandtext
{
if(strcmp(cmdtext, "/test", true, 10)==0)
{
SetTimer("boom", 4000, 0);
SetTimer("tre", 1000, 0);
SetTimer("two", 2000, 0);
SetTimer("one", 3000, 0);
return 1;
}
return 0;
}









public boom()
{
MoveObject(ob, srry private code);
GameTextForAll("~r~BOOM!", 3000,3);
return 1;
}

public one()
{
GameTextForAll("3 seconds until launch", 3000,3);
return 1;
}

public two()
{
GameTextForAll("2 seconds until launch", 3000,3);
return 1;
}

public tre()
{
GameTextForAll("1 seconds until launch", 3000,3);
return 1;
}

Reply
#2

Under the
Код:
SetTimer("boom", 4000, 0);
Type This
Код:
SetTimer("one", 4000, 0);
SetTimer("two", 4000, 0);
SetTimer("tre", 4000, 0);
Reply
#3

Quote:
Originally Posted by Phyrunx
Посмотреть сообщение
Under the
Код:
SetTimer("boom", 4000, 0);
Type This
Код:
SetTimer("one", 4000, 0);
SetTimer("two", 4000, 0);
SetTimer("tre", 4000, 0);
all timers to 4 sec.? -_-

btw did read my post? there are aearly these strings...
Reply
#4

Try this:
pawn Код:
new countn,counttimer;
forward BOOM(playerid);
COMMAND:test(playerid,params[])
{
   countn=3;
   counttimer=SetTimerEx("BOOM",1000,true,"i",playerid);
}
public BOOM(playerid)
{
   countn--;
   new string[128];
   format(string,sizeof(string),"%d",countn);
   GameTextForPlayer(playerid,string,3000,4);
   if(count<=-1)
   {
     KillTimer(counttimer);
     GameTextForPlayer(playerid,"BOOM",1500,4);
   }
 return 1;
}
replace your whole code with what I gave you
Reply
#5

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
Try this:
pawn Код:
new countn,counttimer;
forward BOOM(playerid);
COMMAND:test(playerid,params[])
{
   countn=3;
   counttimer=SetTimerEx("BOOM",1000,true,"i",playerid);
}
public BOOM(playerid)
{
   countn--;
   new string[128];
   format(string,sizeof(string),"%d",countn);
   GameTextForPlayer(playerid,string,3000,4);
   if(count<=-1)
   {
     KillTimer(counttimer);
     GameTextForPlayer(playerid,"BOOM",1500,4);
   }
 return 1;
}
replace your whole code with what I gave you
thx u <3 +1 rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)