Is it possible to see what is the date of the register for the player??
#1

is that possible ?
Reply
#2

Yes, it's possible but you will have to use the function getdate(..) on your register dialog.
pawn Код:
new year, month, day, str[128];
getdate(year, month, day);
format(str, sizeof(str), "%d/%d/%d", day, month, year);
//..store it according to your user system
Reply
#3

thanks for replying, but "GetDate" considering on what ? his pc date ?
2nd: what do you mean by this //..store it according to your user system
can u explain
Reply
#4

What user system do you have? Y_INI? I can show you with Y_INI.
Reply
#5

Quote:
Originally Posted by SyntaxQ
Посмотреть сообщение
What user system do you have? Y_INI? I can show you with Y_INI.
yes i do, it Y_INI
Reply
#6

Basically, whenever a player registers you use the GetDate() to store on a single variable as "SyntaxQ" explained.

And the GetDate returns the date of the server.
Reply
#7

i want to know how to use it, somebody please explain how to use it in YINI
Reply
#8

First read this: https://sampforum.blast.hk/showthread.php?tid=175565

Then you will know what happens here:
I will just use "SyntaxQ" example...

pawn Код:
new year,
    month,
    day,
    str[128],
    INI:file = INI_Open("Player.ini"); // here you define the file you are going to open

getdate(year, month, day);
format(str, sizeof(str), "%d/%d/%d", day, month, year);
INI_WriteString(file, "DateRegistered", str); // here you write the variable DateRegistered of the file
You will have to place this on the function that you use to register your players. If you still do not understand then i recommend you reading some documentation.
Reply
#9

thank you i will try that, but now how to make command that shows which date did he register ?
what variable can i use ?
Reply
#10

It will depend on the system that you made, for example

Normaly on gamemodes they do:

pawn Код:
enum pInfo
{
    pDateRegistered[11]
};
new PlayerInfo[MAX_PLAYERS][pInfo];

//then you add a command, if you have zcmd

CMD:dateregistered(playerid, params[])
{
    new id, string[64];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "/dateregistered <playerid>.");
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Type a valid user ID.");
    format(string, sizeof(string), "He registered at %s", PlayerInfo[id][pDateRegistered]);
    SendClientMessage(playerid, -1, string);
    return true;
}
I've just made a simple command for you to understand, you must go in detail if you'd like to see it better.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)