08.04.2011, 01:04
On Top
when player disconnect
when the player registers
player log in
forward
when i do /stats after 3minute it shows HOURS: 0 MINUTES : 0
pawn Код:
enum pData
{
AdminLevel,
Cash,
Score,
vip,
Hour,
Minute
};
new PlayerData[MAX_PLAYERS][pData];
pawn Код:
dini_IntSet(file, "Hour", PlayerData[playerid][Hour]);
dini_IntSet(file, "Minute", PlayerData[playerid][Minute]);
pawn Код:
PlayerData[playerid][Hour] = dini_Int(file, "Hour");
PlayerData[playerid][Minute] = dini_Int(file, "Minute");
pawn Код:
PlayerData[playerid][Hour] = dini_Int(file, "Hour");
PlayerData[playerid][Minute] = dini_Int(file, "Minute");
pawn Код:
forward OnlineTimeUpdate(playerid);
public OnlineTimeUpdate(playerid)
{
PlayerData[playerid][Minute] ++;
if(PlayerData[playerid][Minute] == 60)
{
PlayerData[playerid][Hour] ++;
PlayerData[playerid][Minute] = 0;
}
}
pawn Код:
format(string, sizeof(string), " {FFB300}Name: %s \n\n Adminlevel: %d %s\n\n Vip: %d\n\n Cash: %d\n\n Score: %d\n\n Hours: %i\n\n Minutes: %i",Name,PlayerData[playerid][AdminLevel],AdminRank,PlayerData[playerid][vip],GetPlayerMoney(playerid),GetPlayerScore(playerid),PlayerData[playerid][Hour],PlayerData[playerid][Minute]);
ShowPlayerDialog(playerid,10000,DIALOG_STYLE_MSGBOX, "Stats",string,"Close","");