Time!
#6

Thats not the problem.
you forgot alot of obvious things.
pawn Код:
//top
forward UpdateTime();
new Time, TimeM, TimeS;
new Text:Timer;

//Under OnGameModeInit

    Timer = TextDrawCreate(550.000000, 30.000000, "5:00");
    TextDrawFont(Timer, 3);
    TextDrawLetterSize(Timer, 0.600000, 1.100000);
    TextDrawSetOutline(Timer, 1);
    TextDrawSetShadow(Timer, 0);

    TimeM = 5;
    TimeS = 0;
    Time = SetTimer("UpdateTime", 1000, true);

public UpdateTime()
{
    new Str[34];
    TimeS --;
    if(TimeM == 0 && TimeS == 0)
    {
        KillTimer(Time);
        SendRconCommand("gmx"); // restart server
       //perform other functions
    }
    if(TimeS == -1)
    {
        TimeM--;
        TimeS = 59;
    }
    format(Str, sizeof(Str), "%02d:%02d", TimeM, TimeS);
    TextDrawSetString(Timer, Str);
    return 1;

}
pawn Код:
TextDrawShowForPlayer(playerid,Timer);
//Add this under onplayerspawn
Credits to Jeffry for making the script.
And freshorange for the post, i just added some things to make it work.
Reply


Messages In This Thread
Time! - by Setkus - 16.07.2011, 13:10
Re: Time! - by freshOrange - 16.07.2011, 13:26
Re: Time! - by Setkus - 16.07.2011, 13:29
Re: Time! - by Setkus - 16.07.2011, 13:59
Re: Time! - by freshOrange - 16.07.2011, 14:03
Re: Time! - by Jay. - 16.07.2011, 14:04
Re: Time! - by Setkus - 16.07.2011, 14:07
Re: Time! - by Setkus - 16.07.2011, 14:10
Re: Time! - by freshOrange - 16.07.2011, 14:11
Re: Time! - by Setkus - 16.07.2011, 15:50

Forum Jump:


Users browsing this thread: 3 Guest(s)