25.02.2013, 19:38
i am using Yini like this
anybody help for total time stats:
ho wmuhc mins secs and hours player played in server.
PHP код:
enum CNR_user
{
pPass[129],
aLevel,
vLevel,
pCash,
pScore,
pKills,
pDeaths,
phit,
PHP код:
stock SaveUserStats(playerid)
{
if(IsPlayerConnected(playerid) && IsLoggedIn{playerid} == 1)
{
new file[40];
new score = GetPlayerScore(playerid), cash = GetPlayerCash(playerid), wanted = GetPlayerWantedLevel(playerid), jail = JailTime[playerid];
new Float:armour, Float:health;
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
PlayerInfo[playerid][pScore] = score;
PlayerInfo[playerid][pCash] = cash;
PlayerInfo[playerid][pWanted] = wanted;
PlayerInfo[playerid][pArmour] = armour;
PlayerInfo[playerid][pHealth] = armour;
PlayerInfo[playerid][jTime] = jail;
GetPlayerArmour(playerid, armour);
format(file, sizeof(file), USER_FILE, GetName(playerid));
new INI:ufile = INI_Open(file);
INI_WriteString(ufile, "pPass", PlayerInfo[playerid][pPass]);
INI_WriteInt(ufile, "aLevel",PlayerInfo[playerid][aLevel]);
INI_WriteInt(ufile, "vLevel",PlayerInfo[playerid][vLevel]);
INI_WriteInt(ufile, "pCash", cash);
INI_WriteInt(ufile, "pScore", score);
INI_WriteInt(ufile, "pKills", PlayerInfo[playerid][pKills]);
INI_WriteInt(ufile, "pDeaths", PlayerInfo[playerid][pDeaths]);
PHP код:
public LoadUser_data(playerid, name[], value[])
{
INI_String("pPass", PlayerInfo[playerid][pPass], 129);
INI_Int("aLevel", PlayerInfo[playerid][aLevel]);
INI_Int("vLevel", PlayerInfo[playerid][vLevel]);
INI_Int("pCash", PlayerInfo[playerid][pCash]);
INI_Int("pScore", PlayerInfo[playerid][pScore]);
INI_Int("pKills", PlayerInfo[playerid][pKills]);
ho wmuhc mins secs and hours player played in server.