02.04.2014, 21:37
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..
With best regards Scrillex.
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.