Posts: 1,018
Threads: 320
Joined: Jul 2010
Hello how can I make on onplayerdisconnect when player leave a server then in his acc is written the date when he was last on server if you know what I mean? Thanks
Posts: 1,018
Threads: 320
Joined: Jul 2010
mysql I try with set as string int and date but nothing it not works
Posts: 912
Threads: 116
Joined: Jun 2012
Reputation:
0
If its a INT it will not work with a string.
Posts: 1,018
Threads: 320
Joined: Jul 2010
I also have that but I use string for dates and it give me something.0 993942394 instead 2/4/2014 that is problem aand I don't know what cause that
Posts: 686
Threads: 17
Joined: Mar 2013
Reputation:
0
Is the variable storing the date declared as a INT or a VARCHAR in the SQL database?
This is the main thing i can see wrong, I haven't worked with MySQL before.
Posts: 1,018
Threads: 320
Joined: Jul 2010
I also was try with int and nothing know it's stored as varchar I tryed also with date but nothing
Posts: 686
Threads: 17
Joined: Mar 2013
Reputation:
0
Post the code where you try to save it correctly in the OnPlayerDisconnect callback so someone might see what's wrong.
Not sure if I will be able to help but someone else will hopefully reply.
Posts: 1,018
Threads: 320
Joined: Jul 2010
first is this
pawn Код:
new string[128],day,month,year;
getdate(day,month,year);
format(string,sizeof(string),"%d/%d/%d",day,month,year);
and here is saving
pawn Код:
mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `LastActivity` = %s WHERE WHERE `ID` = '%d'",
and heere I try set string beacuse from string is getting date and I try this PlayerInfo[playerid][LastActivity],PlayerInfo[playerid][ID]
and in database it give me this when I disconnect from server
251.750000000000000000 instead of
2/4/2014