Last time when player was online
#1

How can I make when a type some command then print my a last date when player was online if you know what I mean. Thanks
Reply
#2

gettime() returns the UNIX timestamp.
Use it when disconnecting, save it somewhere and use an include to convert the UNIX timestamp to a human-readable date.
Reply
#3

more details
Reply
#4

..?

pawn Код:
public OnPlayerDisconnect(playerid)
{
    // Then save this variable somewhere in your user system file, most likely in the user's file.
    new disconnect = gettime();
    return 1;
}
Use this for UNIX to timestamp: https://sampforum.blast.hk/showthread.php?tid=254915
Reply
#5

There's no need for an include as long as you don't want to know the time. If you just need the date, all you need to do is:

pawn Код:
new year, month, day;
getdate(year, month, day);
Then save those values in your player's saving system.

Then after a player logs in do something like this:
pawn Код:
new string[64];
format(string, sizeof(string), "You last logged in on: %i/%i/%i", month, day, year); // Change month, day, and year to the variables you saved the values to.
SendClientMessage(playerid, -1, string);
Reply
#6

I don't understand I have player vaariable lastlogged in yini file

LastLogged = 24/7/2014 that is example how i want that if you know what I mean
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)