26.05.2015, 10:23
Hi, so I was fedup of the old way which isn't solved yet and I am trying a new way, alright so, what happens now is that it appears like
I know this is normal because they are the seconds counted since blablabla, well yeah so my question is, can someone show me how to convert it into date? yyyy/mm/dd or yyyy/m/d
Some of my code:
Oh, by the way, the command now doesnt work at all. it just shows your register date is, tho, the number I posted in the top, is in the localhost.
Thanks for whoever helps!
pawn Код:
1432606679
Some of my code:
pawn Код:
enum PDATA //We name our enumerator as PDATA (which stands for PlayerDATA). You can name it however you want.
{
ID, //Will be used later to store player's ID from database so we can use it anywhere later
Password[129], //We will load player's password into this varible from database
Admin, //We will load player's admin level from database into this variable so we can use it anywhere later.
VIP, //We will load player's VIP level from database into this variable so we can use it anywhere later.
Money, //We will load player's money from database into this variable so we can use it anywhere later.
Float:posX, //We will load player's X position from database into this variable so we can use it anywhere later.
Float:posY, //We will load player's Y position from database into this variable so we can use it anywhere later.
Float:posZ, //We will load player's Z from database into this variable so we can use it anywhere later.
Score,
Infections,
RegisteredOn[6],
Kills,
Deaths,
Reg_Time[16]
}
pawn Код:
mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `PosX` ,`PosY`, `PosZ`, `Score`, `Infections`, `RegisteredOn`, `Kills`, `Deaths`, `Reg_Time`) VALUES ('%e', '%s', '%s', 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, NOW(), 0, 0, '%d')", Name[playerid], pInfo[playerid][Password], IP[playerid], gettime());
pawn Код:
pInfo[playerid][Reg_Time] = cache_get_field_content_int(0, "Reg_Time");
pawn Код:
COMMAND:regdate(playerid, params[])
{
new rstring[120];
format(rstring, sizeof(rstring), "Your register date is %s", pInfo[playerid][Reg_Time]);
SendClientMessage(playerid, -1, rstring);
return 1;
}
Thanks for whoever helps!


