SA-MP Forums Archive
Time difference in minutes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Time difference in minutes (/showthread.php?tid=333384)



Time difference in minutes - Atrox95 - 11.04.2012

Hello,
I need the function GetTimeDifference(minute, second, day, month, year)
This function should return the difference from the current time in minutes.
I have it with days, but minutes would be better for my plan.

Thank you!

PHP код:
stock GetDateDifference(daymonthyear)
{
    new 
tDaytMonthtYeardays;
    
getdate(tYeartMonthtDay);
    
loop_start:
    if(
day != tDay || month != tMonth || year != tYear)
    {
        
days++;
        
day++;
        if(
day>28 && month == 2)
        {
            
day=1;
            
month++;
        }
        if(
day>30 && (month == || month == || month == || month == 11))
        {
            
day=1;
            
month++;
        }
        if(
day>31 && (month == || month == || month == || month == || month == || month == 10 ||  month == 12))
        {
            
day=1;
            
month++;
        }
        if(
month>12)
        {
            
day=1;
            
month=1;
            
year++;
        }
        goto 
loop_start;
    }
    return 
days;




AW: Time difference in minutes - Atrox95 - 11.04.2012

Thanks for you answer. I will use this plugin: https://sampforum.blast.hk/showthread.php?tid=294054