Hours , Mins saving system in Mysql - 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: Hours , Mins saving system in Mysql (
/showthread.php?tid=579007)
Hours , Mins saving system in Mysql -
STONEGOLD - 23.06.2015
Well, I want to know how to save hours , mins.
I know how to save but idk how does it work . I mean, where should i put "PlayerInfo[playerid][Phours]" ? under function of time? or what. Can u give me function.
Re: Hours , Mins saving system in Mysql -
Inn0cent - 23.06.2015
Do you even have player time online system in your script?
Re: Hours , Mins saving system in Mysql -
AlonzoTorres - 23.06.2015
Gettime
Re: Hours , Mins saving system in Mysql -
STONEGOLD - 23.06.2015
Nah, I don't have. I just have mysql saving system. But it does not save because i need a function where i can put this "PlayerInfo[playerid][Pmins]" so it saves players total mins of playing.
I didn't get this gettime function. Can you explain me more please. I mean, Where should i put this on gettime so it can save my online time.
Re: Hours , Mins saving system in Mysql -
Inn0cent - 23.06.2015
Код:
public OnPlayerLogin(playerid, password)
{
Give a MySQL query to load a time online of player from the db then set it to variable.
playerOnline[playerid] = Data Fetched from the DB;
curronline[playerid] = gettime();
}
public OnPlayerDisconnect(playerid, password)
{
new time_new = playerOnline[playerid] + (gettime() - curronline[playerid]);
And give a MySQL query to save a time online of a player.
And it will save the time in milliseconds.
}