MapTimer Help
#1

Hello...

I have a map changing system and it got 13 maps at all.
I want that once the case reaches to 13, which means MapChange==13, it should set it back to 0.

My Code -
Код:
public NewMapTimer(playerid)                      // The callback we forwarded on the beginning of the tutorial
{
	if(MapChange == 13)
	{
	    MapChange=0;
	}
    MapChange++;                                  // this makes it to go to the second MapChange++ part basically does it
    GameTextForAll("~b~Loading ~n~~g~Next Map",4000,3);
    SetTimer("StartedNewRound",4000,false);       // Starts a new timer for the MapChangechange 4 seconds this basically starts the new MapChangeand always must be in false
    return 1;
}
It doesnt give any error but it isn't working.
Reply
#2

Quote:
Originally Posted by sTreamE
Посмотреть сообщение
Read before posting...
Reply
#3

It can never be zero because you have this code which increases it by one AFTER setting it to zero:

pawn Код:
MapChange ++;
Just move that MapChange increment code to above the 'if' statement and it should be fine.

pawn Код:
public NewMapTimer(playerid)                      // The callback we forwarded on the beginning of the tutorial
{
    MapChange ++; // this makes it to go to the second MapChange++ part basically does it
    if(MapChange == 13)
    {
        MapChange=0;
    }
    GameTextForAll("~b~Loading ~n~~g~Next Map",4000,3);
    SetTimer("StartedNewRound",4000,false);       // Starts a new timer for the MapChangechange 4 seconds this basically starts the new MapChangeand always must be in false
    return 1;
}
Reply
#4

Quote:
Originally Posted by [KHK]Khalid
Посмотреть сообщение
It can never be zero because you have this code which increases it by one AFTER setting it to zero:

pawn Код:
MapChange ++;
Just move that MapChange increment code to above the 'if' statement and it should be fine.

pawn Код:
public NewMapTimer(playerid)                      // The callback we forwarded on the beginning of the tutorial
{
    MapChange ++; // this makes it to go to the second MapChange++ part basically does it
    if(MapChange == 13)
    {
        MapChange=0;
    }
    GameTextForAll("~b~Loading ~n~~g~Next Map",4000,3);
    SetTimer("StartedNewRound",4000,false);       // Starts a new timer for the MapChangechange 4 seconds this basically starts the new MapChangeand always must be in false
    return 1;
}
Same Problem, didnt worked.
Reply
#5

What do you mean didn't work? It didn't get to zero? Did it reach 13 then?
Reply
#6

Quote:
Originally Posted by [KHK]Khalid
Посмотреть сообщение
What do you mean didn't work? It didn't get to zero? Did it reach 13 then?
Sorry! Mate it worked.. I was doing it in a wrong way, Thank you man!
Cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)