18.12.2012, 12:38
Hello, i have a problem.
In this /register command (which it works), i save the registration date (date and time) when the player register, but there is problem!
I have a /astats cmd (for admins) and if i look the register date of that player, it says me: Register date: 00/00/0000 - 00:00:00
Why it doesnt save it?
Command:
And this are the variables i read with /astats:
pInfo enum:
Thanks very much.
In this /register command (which it works), i save the registration date (date and time) when the player register, but there is problem!
I have a /astats cmd (for admins) and if i look the register date of that player, it says me: Register date: 00/00/0000 - 00:00:00
Why it doesnt save it?
Command:
pawn Code:
CMD:register(playerid, params[])
{
new filestring[128];
new kname[24];
GetPlayerName(playerid, kname, 24);
format(filestring, sizeof(filestring), "/Users/%s.ini", kname);
if(fexist(filestring)) return SCM(playerid, COLOR_ORANGE, "You are already registered, please /login.");
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),hashpass);
if(sscanf(params, "s[129]", hashpass)) return SendClientMessage(playerid, -1, "{F70505}Usage: {FFFFFF}/register [password]");
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
new INI:File = INI_Open(Path(playerid));
INI_SetTag(File,"data");
INI_WriteString(File,"Password",hashpass);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"NoPm",0);
INI_WriteInt(File,"Mute",0);
INI_WriteInt(File,"Vip",0);
INI_WriteInt(File,"C4",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Cookies",0);
INI_WriteInt(File,"Warn",0);
INI_WriteInt(File,"RegisterDate_day", Day);
INI_WriteInt(File,"RegisterDate_mon", Month);
INI_WriteInt(File,"RegisterDate_year",Year);
INI_WriteInt(File,"RegisterDate_hour",Hour);
INI_WriteInt(File,"RegisterDate_min", Minute);
INI_WriteInt(File,"RegisterDate_sec", Second);
INI_WriteInt(File,"Jailed", 0);
INI_WriteInt(File,"Logged", 1);
INI_WriteInt(File,"AdminActions", 0);
INI_WriteInt(File, "Rank", 0);
INI_Close(File);
PlayerInfo[playerid][pLogged] ++;
TotalRegister++;
SendClientMessage(playerid, COLOR_SYSTEM, "System: Registered and autologged! Next time you join be sure to /login!");
GameTextForPlayer(playerid, "~r~Registered ~w~and ~r~autologged~w~! Next time you join be sure to ~g~/login!", 5000, 3);
new echo[250];
new echo2[140];
new admin[140];
new IP[16];
GetPlayerIp(playerid, IP, 16);
format(echo,sizeof(echo),"0,3System: %s (%d) (IP: %s) has registered a new account - %02d:%02d:%02d - %02d:%02d:%02d",kname,playerid,IP,Day,Month,Year,Hour,Minute,Second);
format(echo2,sizeof(echo2),"0,3System: %s (%d) has registered a new account - Total Accounts: %d",kname,playerid,TotalRegister);
format(admin,sizeof(admin),"System: %s (%d) (IP: %s) has registered a new account - Total Accounts: %d.",kname,playerid,IP,TotalRegister);
IRC_GroupSay(gGroupID, IRC_ACHANNEL, echo);
IRC_GroupSay(gGroupID, IRC_CHANNEL, echo2);
SendMessageToAdmins(0x00FFFFFF,admin);
return 1;
}
pawn Code:
Register Date: %02d/%02d/%02d - %02d:%02d:%02d\n",PlayerInfo[giveplayerid][RegisterDate_day],PlayerInfo[giveplayerid][RegisterDate_mon],PlayerInfo[giveplayerid][RegisterDate_year],PlayerInfo[giveplayerid][RegisterDate_hour],PlayerInfo[giveplayerid][RegisterDate_min],PlayerInfo[giveplayerid][RegisterDate_sec]);
pawn Code:
RegisterDate_day,
RegisterDate_mon,
RegisterDate_year,
RegisterDate_hour,
RegisterDate_min,
RegisterDate_sec