Map timer problem..
#1

Hi..
I really can't describe the problem, so I recorded a video. Here it is:
http://www.youtube.com/watch?v=57a8M...ature=*********
It skips 30 seconds everytime..
Here's the code:
pawn Код:
// at the top
new GameMinutes =5;
new GameSeconds =30;
//-------------//
public MainTimer() // my own timer, updates every 1 second.
{
        if(GameSeconds || GameMinutes) {
        GameSeconds--;
        if(GameSeconds <= -1) {
            GameMinutes--;
            GameSeconds=30;
        }
        new TimeString[128];
        format(TimeString,sizeof(TimeString),"~b~%02d:%02d",GameMinutes,GameSeconds);
        TextDrawSetString(Textdraw5,TimeString);
    }
}
//---------------//
public NewRound(playerid) {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SpawnPlayer(i);
        switch(CurrentMap)
        {
            case 0:
            {
                SetPlayerInterior(i,0);
                GameMinutes =5;
                GameSeconds =30;
            }
            case 1:
            {
                SetPlayerInterior(i,0);
                GameMinutes =5;
                GameSeconds =30;
            }
            case 2:
            {
                SetPlayerInterior(i,0);
                GameMinutes =5;
                GameSeconds =30;
            }
            case 3:
            {
                SetPlayerInterior(i,0);
                GameMinutes =5;
                GameSeconds =30;
            }
            case 4:
            {
                SetPlayerInterior(i,0);
                GameMinutes =5;
                GameSeconds =30;
            }
            case 5:
            {
                SetPlayerInterior(i,0);
                GameMinutes =5;
                GameSeconds =30;
            }
        }
    }
    return 1;
}
I took this map switching system from The Renaissance project by vasillis.
Reply
#2

On line 8 of your code you are resetting the GameSeconds variable to 30. This should be 59.
Reply
#3

lol! Sorry for failing :P

Thank you, it works, but now it switches the map and there are 2 minutes left.. :/
Reply
#4

uhm ?
Reply
#5

Guys.. ?
Reply
#6

For God's sake. I need to host this server soon! Someone help me..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)