Confused :/
#1

Is there any way making this easyer?
Like i have a var called Mins so when he passed the checkpoint with more than 60(1 min) Mins = 1;
Ex:
pawn Код:
if(CountRaceTime[playerid][1] >= 60)
        {
            Mins = 1;
        }
        else if(CountRaceTime[playerid][1] >= 120)
        {
            Mins = 2;
        }
        else if(CountRaceTime[playerid][1] >= 180)
        {
            Mins = 3;
        }
        else if(CountRaceTime[playerid][1] >= 260)
        {
            Mins = 4;
        }
        else if(CountRaceTime[playerid][1] >= 320)
        {
            Mins = 5;
        }
        else if(CountRaceTime[playerid][1] >= 380)
        {
            Mins = 6;
        }
But like instead of writing that all the time.. Is there anyway of a macro or stock so I dont need to write like 60+ seconds?
Reply
#2

Код:
Mins=CountRaceTime[playerid][1]/60;
the Mins is an integer, it wont show values like 1.013, if you want to get the remaining seconds, simply use
Код:
RemainingSeconds=CountRaceTime[playerid][1]%60;
for 222 seconds, it will give you Mins=222/60=3, and RemainingSeconds=222%60=42, thats
3:42
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)