[HELP]What's Wrong?
#1

pawn Код:
#include <a_samp>
#pragma tabsize 0

forward public SetCountDownTime(hour,min,sec);
forward UpdateTime();
new update;
//--------------------------------------------------

public SetCountDownTime(hour,min,sec)
{
    printf("Time: %02d:%02d:%02d",hour,min,sec);
    update = SetTimer("UpdateTime",1000,0);
    sec --;
    if(sec == 0) {
        min --;
    }
    if(min == 0) {
        hour --;
    }
    if(hour == 0 && min == 0 && sec == 0) {
        printf("Time Over");
        KillTimer(update);
        return 1;
    }

    return 1;
}


public UpdateTime()
{
    SetTimer("SetCountDownTime",0,0);
}


public OnGameModeInit()
{
    SetCountDownTime(2,50,50); // Time Test - 2 Hour, 50 Min, 50 Sec
    return 1;
}
Reply
#2

You need to show the errors
Reply
#3

Quote:
Originally Posted by Joshb93
Посмотреть сообщение
You need to show the errors
Don't have errors, just the time don't count down, try test
Reply
#4

Quote:

#include <a_samp>
#pragma tabsize 0

forward public SetCountDownTime(hour,min,sec);
forward UpdateTime();
new update;
//--------------------------------------------------

public SetCountDownTime(hour,min,sec)
{
* * printf("Time: %d:%d:%d",hour,min,sec);
* * update = SetTimer("UpdateTime",1000,0);
* * sec --;
* * if(sec == 0) {
sec=60;
* * * * min --;
* * }
* * if(min == 0) {
min=60;
* * * * hour --;
* * }
* * if(hour == 0 && min == 0 && sec == 0) {
* * * * printf("Time Over");
* * * * KillTimer(update);
* * * * return 1;
* * }

* * return 1;
}


public UpdateTime()
{
* * SetTimer("SetCountDownTime",0,0);
}


public OnGameModeInit()
{
* * SetCountDownTime(2,50,50); // Time Test - 2 Hour, 50 Min, 50 Sec
* * return 1;
}

I think this is better cause now it counts down and there is no negative value anymore
Reply
#5

Not sure if this will work but worth giving it a try:

pawn Код:
#include <a_samp>
#pragma tabsize 0

forward public SetCountDownTime(hour,min,sec);
forward UpdateTime();
new update;
//--------------------------------------------------

public SetCountDownTime(hour,min,sec)
{
    printf("Time: %02d:%02d:%02d",hour,min,sec);
    update = SetTimer("UpdateTime",1000,0);
    sec --;
    if(sec == 0) {
        min --;
        sec = 59;
    }
    if(min == 0) {
        hour --;
        min = 59;
    }
    if(hour == 0 && min == 0 && sec == 0) {
        printf("Time Over");
        KillTimer(update);
        return 1;
    }

    return 1;
}


public UpdateTime()
{
    SetTimer("SetCountDownTime",0,0);
}


public OnGameModeInit()
{
    SetCountDownTime(2,50,50); // Time Test - 2 Hour, 50 Min, 50 Sec
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)