SA-MP Forums Archive
command - 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: command (/showthread.php?tid=500354)



command - d0nTtoucH - 12.03.2014

hey guys can someone give me command that tells me when a player has last visited my server
for example
/stats player name
d0nTtouch has last visited .....12/03/**


Re: command - Matess - 12.03.2014

And are you saving this information? Then how? Mysql or dini or..


Re: command - d0nTtoucH - 12.03.2014

dini is auto saving it


Re: command - d0nTtoucH - 14.03.2014

no one ?


Re: command - Matess - 14.03.2014

You are saving something and not loading? If you are loading other info then you must know how to load this info.


Re: command - Ruben_Alonso - 14.03.2014

If you want to make a command to show when the player has registered you just need the information saved, and if it is saved then you are halfway there.

Let's say you register the date everytime the player leaves the server on this variable:

pawn Код:
PlayerInfo[MAX_PLAYERS][pDateRegistered];
And let's suppose you have zcmd and sscanf included on your script, the command should be like this:

pawn Код:
CMD:stats(playerid, params[])
{
    new id, string[64], name[24]; // defining the target, the string, and the name to store
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "/stats<playerid>."); // checks and stores the target id
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Type a valid user ID."); // check if it is valid
    GetPlayerName(id, name, sizeof(name)); // stores the playername in name
    format(string, sizeof(string), "%s registered at %s", name, PlayerInfo[id][pDateRegistered]); //formats the string the way you want it
    SendClientMessage(playerid, -1, string); // sends the message
    return true;
}



Re: command - d0nTtoucH - 14.03.2014

thank you i will test it