Saving player's account per x secs.
#8

Quote:
Originally Posted by lQs
View Post
Yeah but i dont have damn idea how to do it. My stats command:
pawn Code:
CMD:stats(playerid, params[])
{
    new Float:gihp, Float:giar;
    GetPlayerHealth(playerid, gihp);
    GetPlayerArmour(playerid, giar);
    GetPlayerWantedLevel(playerid);
    new temp[1000];
    new info[1000];

    format(temp, sizeof(temp), "Cash: %i$\n",PlayerInfo[playerid][pCash]);
    strcat(info, temp);

    format(temp, sizeof(temp), "Skin ID: %d\n",PlayerInfo[playerid][pSkin]);
    strcat(info, temp);

    format(temp, sizeof(temp), "Admin Level: %d\n",PlayerInfo[playerid][pAdmin]);
    strcat(info, temp);

    format(temp, sizeof(temp), "Kills: %i\n",PlayerInfo[playerid][pKills]);
    strcat(info, temp);

    format(temp, sizeof(temp), "Deaths: %i\n",PlayerInfo[playerid][pDeaths]);
    strcat(info, temp);

    format(temp, sizeof(temp), "Health: %0.1f\n",PlayerInfo[playerid][pHealth]);
    strcat(info, temp);

    format(temp, sizeof(temp), "Armour: %0.1f\n",PlayerInfo[playerid][pArmour]);
    strcat(info, temp);

    format(temp, sizeof(temp), "Level: %d)\n",PlayerInfo[playerid][pLevel]);
    strcat(info, temp);

    format(temp, sizeof(temp), "Score: %i\n",GetPlayerScore(playerid));
    strcat(info, temp);

    ShowPlayerDialog(playerid, 14, DIALOG_STYLE_MSGBOX,"{53C506}Your Stats",info,"Close","");
    return true;
}
Firstly, you say, that get information from the file, but you dont do that in your script. You dont need timer to save stats, just do it in the OnPlayerDisconnect. And if you worry about data lost, you can save stats once per 5-10 minutes or after changing priority variables.
Reply


Messages In This Thread
Saving player's account per x secs. - by lQs - 27.04.2013, 20:52
Re: Saving player's account per x secs. - by Tom1412 - 27.04.2013, 20:54
Re: Saving player's account per x secs. - by RVRP - 27.04.2013, 20:55
Re: Saving player's account per x secs. - by Vince - 27.04.2013, 21:07
Re: Saving player's account per x secs. - by lQs - 27.04.2013, 21:10
Re: Saving player's account per x secs. - by stabker - 27.04.2013, 21:19
Re: Saving player's account per x secs. - by lQs - 27.04.2013, 21:23
Re: Saving player's account per x secs. - by stabker - 27.04.2013, 21:30
Re: Saving player's account per x secs. - by lQs - 27.04.2013, 21:33
Re: Saving player's account per x secs. - by Scenario - 28.04.2013, 05:41

Forum Jump:


Users browsing this thread: 1 Guest(s)