Time!
#2

On very top

pawn Код:
forward GMChange(playerid);
Under OnGameModeInit

pawn Код:
SetTimer("GMChange",3000000,false); // 5 minutes
pawn Код:
public GMChange(playerid)
{
    SendRconCommand("changemode YOURGMNAME");
    return 1;
}
--------------------------------------------------------------------------
Visual (author:Jeffry)

Very top

pawn Код:
forward UpdateTime();
pawn Код:
new Time, TimeM, TimeS;
new Text:Timer;
Under OnGameModeInit

pawn Код:
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);
pawn Код:
public UpdateTime()
{
    new Str[34];
    TimeS --;
    if(TimeM == 0 && TimeS == 0)
    {
        KillTimer(Time);
    }
    if(TimeS == -1)
    {
        TimeM--;
        TimeS = 59;
    }
    format(Str, sizeof(Str), "%02d:%02d", TimeM, TimeS);
    TextDrawSetString(Timer, Str);
    return 1;
}
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)