Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerUpdate(playerid)
- {
- if(PlayerInfo[playerid][pConnectHours] == 24) // If the 24 hours is reached.
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- new file[127], pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(file, sizeof(file), "Time/%s.ini", pname);
- if(!dini_Exists(file))
- dini_Create(file);
- PlayerInfo[playerid][pConnectHours] -= 24;
- dini_IntSet(file, "Hours", PlayerInfo[playerid][pConnectHours]);
- PlayerInfo[playerid][pConnectDays] += 1;
- dini_IntSet(file, "Days", PlayerInfo[playerid][pConnectDays]);
- }
- }
- if( PlayerInfo[playerid][pConnectMinutes] < 120 && PlayerInfo[playerid][pConnectMinutes] > 60) // If the 60 minutes is reached.
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- new file[128], pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(file, sizeof(file), "Time/%s.ini", pname);
- if(!dini_Exists(file))
- dini_Create(file);
- PlayerInfo[playerid][pConnectMinutes] -= 60;
- dini_IntSet(file, "Minutes", PlayerInfo[playerid][pConnectMinutes]);
- PlayerInfo[playerid][pConnectHours] += 1;
- dini_IntSet(file, "Hours", PlayerInfo[playerid][pConnectHours]);
- }
- }
- if(PlayerInfo[playerid][pConnectSeconds] == 59) // If the 60 seconds is reached.
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- new file[129], pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(file, sizeof(file), "Time/%s.ini", pname);
- if(!dini_Exists(file))
- dini_Create(file);
- PlayerInfo[i][pConnectSeconds] -= 60;
- dini_IntSet(file, "Seconds", PlayerInfo[playerid][pConnectSeconds]);
- PlayerInfo[i][pConnectMinutes] += 1;
- dini_IntSet(file, "Minutes", PlayerInfo[playerid][pConnectMinutes]);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement