Cheque - Mysql
#9

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Did like you said:

times[playerid][cTime] = strval(field[3]); // Time from mysql "1282217431" stored with gettime();
new DAY;
printf("%s",ConvertTime(times[playerid][cTime], .ctd=DAY));

This prints 14840 days, 11 hours, 30 minutes, 31 seconds.

Do you see where i did go wrong?
Yes, its because i was short with you lol.

The gettime() function returns the number of days since january 1st 1997, this means nothing to us lol. So what you would have to do is subtract the time from another time.

I'll try to explain the best i can. Lets say a player joins your server, and its been 3 days since the last time you stored the time with gettime().

When he connects what you would want to do is: gettime()-oldtime and that will get the amount of time it has been since his last time storage. Pretty simple, right?

Once you give him the money, you have to update his time to gettime() once again.
Reply


Messages In This Thread
Cheque - Mysql [ Solved ] - by Cameltoe - 09.08.2010, 15:23
Re: Cheque - Mysql - by Cameltoe - 10.08.2010, 10:27
Re: Cheque - Mysql - by Grim_ - 10.08.2010, 10:54
Re: Cheque - Mysql - by Cameltoe - 10.08.2010, 11:54
Re: Cheque - Mysql - by Cameltoe - 18.08.2010, 19:27
Re: Cheque - Mysql - by Cameltoe - 19.08.2010, 08:07
Re: Cheque - Mysql - by Kyosaur - 19.08.2010, 09:23
Re: Cheque - Mysql - by Cameltoe - 19.08.2010, 11:38
Re: Cheque - Mysql - by Kyosaur - 19.08.2010, 11:44
Re: Cheque - Mysql - by Cameltoe - 19.08.2010, 11:51

Forum Jump:


Users browsing this thread: 2 Guest(s)