Is it possible to see what is the date of the register for the player?? -
AnonScripter - 13.03.2014
is that possible ?
Re: Is it possible to see what is the date of the register for the player?? -
SyntaxQ - 13.03.2014
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
Re: Is it possible to see what is the date of the register for the player?? -
AnonScripter - 13.03.2014
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
Re: Is it possible to see what is the date of the register for the player?? -
SyntaxQ - 13.03.2014
What user system do you have? Y_INI? I can show you with Y_INI.
Re: Is it possible to see what is the date of the register for the player?? -
AnonScripter - 13.03.2014
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
Re: Is it possible to see what is the date of the register for the player?? -
Ruben_Alonso - 13.03.2014
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.
Re: Is it possible to see what is the date of the register for the player?? -
AnonScripter - 13.03.2014
i want to know how to use it, somebody please explain how to use it in YINI
Re: Is it possible to see what is the date of the register for the player?? -
Ruben_Alonso - 13.03.2014
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.
Re: Is it possible to see what is the date of the register for the player?? -
AnonScripter - 13.03.2014
thank you i will try that, but now how to make command that shows which date did he register ?
what variable can i use ?
Re: Is it possible to see what is the date of the register for the player?? -
Ruben_Alonso - 13.03.2014
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.