command
#1

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

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

dini is auto saving it
Reply
#4

no one ?
Reply
#5

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

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;
}
Reply
#7

thank you i will test it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)