Question - Days counting system on MySQL sistem. [REP ++ for the best answer] - 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: Question - Days counting system on MySQL sistem. [REP ++ for the best answer] (
/showthread.php?tid=547420)
Question - Days counting system on MySQL sistem. [REP ++ for the best answer] -
buburuzu19 - 22.11.2014
Hello guys , i want to make an age for my personal car sistem and i really don't have any ideea of how to stock the days , how to count them by using mysql .. If someone know how to do this, please reply with the script.
I appreciate all the answers.
Thanks. I Rep ++
Re: Question - Days counting system on MySQL sistem. [REP ++ for the best answer] -
Vince - 22.11.2014
I'm not entirely sure where you want to go with this. You can save date and time either as a Unix timestamp or as a DateTime value. They can be converted into each other should the need arise, but the DateTime type has the advantage due the numerous functions that exist to manipulate these values, such as
datediff().
Re: Question - Days counting system on MySQL sistem. [REP ++ for the best answer] -
Abagail - 22.11.2014
You can do something like this, maybe?
pawn Код:
public OnVehicleCreation(vehicleid)
{
new day;
Born[vehicleid] = getdate(day, day, day);
return true;
}
stock GetCarAge(vehicleid)
{
new tmpage, day;
tmpage = Born[vehicleid] - getdate(day, day, day);
return tmpage;
}
Something like this? Or, if it's purely MySQL then see event scheduling,
https://sampforum.blast.hk/showthread.php?pid=3258877#pid3258877