PDA

View Full Version : Saving played time with y_ini (NEED HELP)


Scrillex
02/04/2014, 09:37 PM
Hello dear samp members I need your help, maybe you could help me a little bit out...
So here is my code. Now I'm thinking how to call out the stock to get it saved...

Basically it ain't saving because stock isn't called no where in script. Just don't know where to put it..

OnDialog:
{
INI_WriteInt(File,"Seconds",0);
INI_WriteInt(File,"Minutes",0);
INI_WriteInt(File,"Hours",0);
INI_WriteInt(File,"ConnectTime",0);
}

public OnPlayerDisconnect(playerid, reason)
{
INI_WriteInt(File,"Seconds",PlayerInfo[playerid][pSeconds]);
INI_WriteInt(File,"Minutes",PlayerInfo[playerid][pMinutes]);
INI_WriteInt(File,"Hours",PlayerInfo[playerid][pHour]);
INI_WriteInt(File,"ConnectTime",PlayerInfo[playerid][pConnectTime]);
}

stock TotalGameTime(playerid, &hour=0, &min=0, &sec=0)
{
PlayerInfo[playerid][pTotalTime] =
(
(gettime() - PlayerInfo[playerid][pConnectTime]) + (PlayerInfo[playerid][pHours]*60*60) + (PlayerInfo[playerid][pMinutes]*60) + (PlayerInfo[playerid][pSeconds])
);

hour = floatround(PlayerInfo[playerid][pTotalTime] / 3600, floatround_floor);
min = floatround(PlayerInfo[playerid][pTotalTime] / 60, floatround_floor) % 60;
sec = floatround(PlayerInfo[playerid][pTotalTime] % 60, floatround_floor);
return PlayerInfo[playerid][pTotalTime];
}

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Seconds",PlayerInfo[playerid][pSeconds]);
INI_Int("Minutes",PlayerInfo[playerid][pMinutes]);
INI_Int("Hours",PlayerInfo[playerid][pHours]);
INI_Int("TotalTime",PlayerInfo[playerid][pTotalTime]);
INI_Int("ConnectTime",PlayerInfo[playerid][pConnectTime]);
}



With best regards Scrillex.

Scrillex
02/04/2014, 10:51 PM
some one ?

NEXT0LIFE0RP
02/04/2014, 11:44 PM
Too difficult

Scrillex
03/04/2014, 01:44 PM
BUMP!

Scrillex
12/12/2015, 07:17 AM
\\\bump