Countdown Help
#1

Hey guys. I just wondering is there any way to make the texdraws who say the count visible only for players in range?
Here is the command.

Код:
    if (strcmp("/count", cmdtext, true, 10) == 0)
	{
    SetTimer("five", 1000, 0);
    SetTimer("four", 2000, 0);
    SetTimer("three", 3000, 0);
    SetTimer("two", 4000, 0);
    SetTimer("one", 5000, 0);
    SetTimer("start", 7000, 0);
    {
    return 1;
    }
+Rep for the dude who help me.
Reply
#2

Use wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint
Reply
#3

Do what he said ^.

And this is absolutely the WORST method of making a countdown in the world.

This is recommended:

pawn Код:
SetTimer("five", 1000, 0);
SetTimer("four", 2000, 0);
SetTimer("three", 3000, 0);
SetTimer("two", 4000, 0);
SetTimer("one", 5000, 0);
SetTimer("start", 7000, 0);

// Into...

new countdown == 5;

SetTimerEx("countdowntimer", 1000, true, "i", countdown);

forward countdowntimer(count);

public countdowntimer(count)
{
    countdown --;
    if(countdown == 0)
    {
        //If timer is 0, write "start" here
        KillTimer(countdowntimer);
        countdown == 5; //So if we re-do the SetTimerEx, we do not need to reset the variable.
    }
    return 1;
}
This is much faster and easier.
Reply
#4

Quote:
Originally Posted by Kindred
Посмотреть сообщение
Do what he said ^.

And this is absolutely the WORST method of making a countdown in the world.

This is recommended:

pawn Код:
SetTimer("five", 1000, 0);
SetTimer("four", 2000, 0);
SetTimer("three", 3000, 0);
SetTimer("two", 4000, 0);
SetTimer("one", 5000, 0);
SetTimer("start", 7000, 0);

// Into...

new countdown == 5;

SetTimerEx("countdowntimer", 1000, true, "i", countdown);

forward countdowntimer(count);

public countdowntimer(count)
{
    countdown --;
    if(countdown == 0)
    {
        //If timer is 0, write "start" here
        KillTimer(countdowntimer);
    }
    return 1;
}
This is much faster and easier.
yeah, fast function and better.
Reply
#5

Thanks guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)