Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. task SyncUp[60000]() {
  2. new tmphour,tmpminute,tmpsecond,hour,minn,sec,da,mo,ye,minute,second;
  3. gettime(hour,minn,sec);
  4. gettime(tmphour, tmpminute, tmpsecond);
  5. getdate(ye, mo, da);
  6. FixHour(tmphour);
  7. tmphour = shifthour;
  8. gString[0] = (EOS);
  9. if ((tmphour > ghour) || (tmphour == 0 && ghour == 23)) {
  10. ghour = tmphour;
  11. PayDay();
  12. if(hour == 23) {
  13. mysql_tquery(SQL,"UPDATE cars SET Inscarprice = Inscarprice+50","","");
  14. foreach(new i : Player) {
  15. for(new v; v < MAX_PERSONAL_VEHICLES; v++) {
  16. if(PlayerInfo[i][pCar][v] != -1) PlayerInfo[i][pCarInsPrice][v] += 50;
  17. }
  18. }
  19. mysql_tquery(SQL,"UPDATE `users` SET `OnlineToday` = '0'","","");
  20. foreach( new i : Player) {
  21. if(IsPlayerConnected(i)) {
  22. mysql_format(SQL,gString,256,"UPDATE `users` SET `OnlineToday` = '1' WHERE `name`='%s' LIMIT 1",PlayerInfo[i][pNormalName]);
  23. mysql_tquery(SQL,gString,"","");
  24. }
  25. }
  26. mysql_tquery(SQL,"UPDATE users SET ClanTime = ClanTime+1 WHERE Clan > 0","","");
  27. }
  28. if(hour == 7) {
  29. mysql_tquery( SQL, "UPDATE `users` SET `FactionTime` = `FactionTime` + '1' WHERE `Member` > '0'" );
  30. mysql_tquery( SQL, "UPDATE `users` SET `QuestOne` = '0', `QuestTwo` = '0', `QuestProgressOne` = '0', `QuestProgressTwo` = '0', `QuestCompletedOne` = '0', `QuestCompletedTwo` = '0'");
  31. foreach( new x : Player ) {
  32. SCM(x, -1, "");
  33. giveDailyQuests( x );
  34. }
  35. }
  36. if(GetWeekDay() == 2 && hour == 23) {
  37. mysql_format(SQL,gString,256,"UPDATE `users` SET `OnlineLastWeek` = '1', `OnlineThisWeek` = '0' WHERE `OnlineThisWeek`='1'");
  38. mysql_tquery(SQL,gString,"","");
  39. foreach( new i : Player) {
  40. if(IsPlayerConnected(i)) {
  41. mysql_format(SQL,gString,256,"UPDATE `users` SET `OnlineThisWeek` = '1' WHERE `name`='%s'",PlayerInfo[i][pNormalName]);
  42. mysql_tquery(SQL,gString,"","");
  43. }
  44. }
  45. }
  46. if(hour == 19 || hour == 20 || hour == 21 || hour == 22) SetWorldTime(hour);
  47. else SetWorldTime(hour);
  48. }
  49. gettime(hour, minute, second);
  50. return true; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement