SA-MP Forums Archive
Saving played time with y_ini (NEED HELP) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Saving played time with y_ini (NEED HELP) (/showthread.php?tid=504227)



Saving played time with y_ini (NEED HELP) - Scrillex - 02.04.2014

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..
pawn Код:
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.


Re: Saving played time with y_ini (NEED HELP) - Scrillex - 02.04.2014

some one ?


Re: Saving played time with y_ini (NEED HELP) - NEXT0LIFE0RP - 02.04.2014

Too difficult


Re: Saving played time with y_ini (NEED HELP) - Scrillex - 03.04.2014

BUMP!


Re: Saving played time with y_ini (NEED HELP) - Scrillex - 12.12.2015

\\\bump