17.04.2014, 15:46
Hi, I am using Y_INI for this and follow the 2nd post in this topic https://sampforum.blast.hk/showthread.php?tid=284740
I just have no idea where to put the saving and loading function, everytime I do that, the minutes,hours and seconds reset on connect, can I have some help please
I am using this
forward TimeOnServer(playerid);
public TimeOnServer(playerid)
{
PlayerInfo[playerid][Sec] ++;
if(PlayerInfo[playerid][Sec]>=60)
{
PlayerInfo[playerid][Min]++;
PlayerInfo[playerid][Sec]=0;
}
if(PlayerInfo[playerid][Min]>=60)
{
PlayerInfo[playerid][Min]=0;
PlayerInfo[playerid][Hour]++;
}
}
I have no idea where to put
PlayerInfo[playerid][Min] = GetPVarInt(playerid, "Min");
PlayerInfo[playerid][Hour] = GetPVarInt(playerid, "Hour");
PlayerInfo[playerid][Sec] = GetPVarInt(playerid, "Sec");
INI_WriteInt(File,"Min",PlayerInfo[playerid][Min]);
INI_WriteInt(File,"Hour",PlayerInfo[playerid][Hour]);
INI_WriteInt(File,"Sec",PlayerInfo[playerid][Sec]);
I just have no idea where to put the saving and loading function, everytime I do that, the minutes,hours and seconds reset on connect, can I have some help please

I am using this
forward TimeOnServer(playerid);
public TimeOnServer(playerid)
{
PlayerInfo[playerid][Sec] ++;
if(PlayerInfo[playerid][Sec]>=60)
{
PlayerInfo[playerid][Min]++;
PlayerInfo[playerid][Sec]=0;
}
if(PlayerInfo[playerid][Min]>=60)
{
PlayerInfo[playerid][Min]=0;
PlayerInfo[playerid][Hour]++;
}
}
I have no idea where to put
PlayerInfo[playerid][Min] = GetPVarInt(playerid, "Min");
PlayerInfo[playerid][Hour] = GetPVarInt(playerid, "Hour");
PlayerInfo[playerid][Sec] = GetPVarInt(playerid, "Sec");
INI_WriteInt(File,"Min",PlayerInfo[playerid][Min]);
INI_WriteInt(File,"Hour",PlayerInfo[playerid][Hour]);
INI_WriteInt(File,"Sec",PlayerInfo[playerid][Sec]);