[HELP] last activity
#1

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
Reply
#2

mysql I try with set as string int and date but nothing it not works
Reply
#3

you can save the date on the player file " Playername.ini " and onplayerconnect get the date, and it's done.
you can save it with:
1-Dini: http://dracoblue.net/download/dini-16/35/
2-Dutils: http://dracoblue.net/download/dutils-110/30/
3-dudb: http://dracoblue.net/download/dudb-24/31/
4-Double-O-File: http://www.2shared.com/file/WknuA7r2...e-O-Files.html
-------------------------------------------
OH ok wasn't read
Reply
#4

If its a INT it will not work with a string.
Reply
#5

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
Reply
#6

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.
Reply
#7

I also was try with int and nothing know it's stored as varchar I tryed also with date but nothing
Reply
#8

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.
Reply
#9

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
Reply
#10

Try this.
pawn Код:
mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `LastActivity` = '%s' WHERE WHERE `ID` = '%d'",PlayerInfo[playerid][LastActivity],PlayerInfo[playerid][ID]);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)