Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. public OnPlayerUpdate(playerid)
  2. {
  3. if(PlayerInfo[playerid][pConnectHours] == 24) // If the 24 hours is reached.
  4. {
  5. for(new i = 0; i < MAX_PLAYERS; i++)
  6. {
  7. new file[127], pname[MAX_PLAYER_NAME];
  8. GetPlayerName(playerid, pname, sizeof(pname));
  9. format(file, sizeof(file), "Time/%s.ini", pname);
  10. if(!dini_Exists(file))
  11. dini_Create(file);
  12. PlayerInfo[playerid][pConnectHours] -= 24;
  13. dini_IntSet(file, "Hours", PlayerInfo[playerid][pConnectHours]);
  14. PlayerInfo[playerid][pConnectDays] += 1;
  15. dini_IntSet(file, "Days", PlayerInfo[playerid][pConnectDays]);
  16. }
  17. }
  18. if( PlayerInfo[playerid][pConnectMinutes] < 120 && PlayerInfo[playerid][pConnectMinutes] > 60) // If the 60 minutes is reached.
  19. {
  20. for(new i = 0; i < MAX_PLAYERS; i++)
  21. {
  22. new file[128], pname[MAX_PLAYER_NAME];
  23. GetPlayerName(playerid, pname, sizeof(pname));
  24. format(file, sizeof(file), "Time/%s.ini", pname);
  25. if(!dini_Exists(file))
  26. dini_Create(file);
  27. PlayerInfo[playerid][pConnectMinutes] -= 60;
  28. dini_IntSet(file, "Minutes", PlayerInfo[playerid][pConnectMinutes]);
  29. PlayerInfo[playerid][pConnectHours] += 1;
  30. dini_IntSet(file, "Hours", PlayerInfo[playerid][pConnectHours]);
  31. }
  32. }
  33. if(PlayerInfo[playerid][pConnectSeconds] == 59) // If the 60 seconds is reached.
  34. {
  35. for(new i = 0; i < MAX_PLAYERS; i++)
  36. {
  37. new file[129], pname[MAX_PLAYER_NAME];
  38. GetPlayerName(playerid, pname, sizeof(pname));
  39. format(file, sizeof(file), "Time/%s.ini", pname);
  40. if(!dini_Exists(file))
  41. dini_Create(file);
  42. PlayerInfo[i][pConnectSeconds] -= 60;
  43. dini_IntSet(file, "Seconds", PlayerInfo[playerid][pConnectSeconds]);
  44. PlayerInfo[i][pConnectMinutes] += 1;
  45. dini_IntSet(file, "Minutes", PlayerInfo[playerid][pConnectMinutes]);
  46. }
  47. }
  48. return 1;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement