Guest User

Untitled

a guest
Dec 16th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. public SyncUp()
  2. {
  3. new string[128],
  4. tmphour,
  5. tmpminute,
  6. tmpsecond,
  7. hour,
  8. minn,
  9. sec,
  10. da,
  11. mo,
  12. ye;
  13. gettime(hour,minn,sec);
  14. gettime(tmphour, tmpminute, tmpsecond);
  15. getdate(ye, mo, da);
  16. FixHour(tmphour);
  17. tmphour = shifthour;
  18. if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
  19. {
  20. format(string, sizeof(string), "SERVER: The time is now %d:00 hours",hour);
  21. BroadCast(COLOR_WHITE,string);
  22. ghour = tmphour;
  23. PayDay();
  24. if(da == 1 && hour == 1)
  25. {
  26. mysql_tquery(SQL,"UPDATE `users` SET `Connected` = '0'","","");
  27. new string1[300];
  28. new query[300],result[300];
  29. new test[300];
  30. format(string1, sizeof(string1), "SELECT * FROM `users` WHERE Connected < 11 AND House < 999");
  31. new Cache: membresult = mysql_query(SQL, string1);
  32. for(new i, j = cache_get_row_count (); i != j; ++i)
  33. {
  34. cache_get_field_content(i, "name", result); format(query, 30, result);
  35. cache_get_field_content(i, "House", result); format(test, 300, result);
  36. new id = GetPlayerID(query);
  37. if(id != INVALID_PLAYER_ID)
  38. {
  39. HouseInfo[test][hHel] = 0;
  40. HouseInfo[test][hLicitatie] = 1;
  41. HouseInfo[test][hArm] = 0;
  42. HouseInfo[test][hLock] = 0;
  43. HouseInfo[test][hOwned] = 0;
  44. PlayerInfo[id][pRented] = 0;
  45. strmid(HouseInfo[test][hOwner], "The State", 0, strlen("The State"), 255);
  46. PlayerInfo[id][pPhousekey] = 999;
  47. PlayerInfo[id][pRented] = -1;
  48. if(PlayerInfo[id][pLocal] == test)
  49. {
  50. SetPlayerInterior(id,0);
  51. SetPlayerPosEx(id,HouseInfo[test][hEntrancex],HouseInfo[test][hEntrancey],HouseInfo[test][hEntrancez]);
  52. PlayerInfo[id][pInt] = 0;
  53. }
  54. Update(id,pRentedx);
  55. Update(id,pPhousekeyx);
  56. new str2[256];
  57. mysql_format(SQL,str2,sizeof(str2),"UPDATE `houses` SET `Hel`='0',`Licitatie`='1',`Arm`='0',`Lockk`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",HouseInfo[test][hID]);
  58. mysql_tquery(SQL,str2,"","");
  59. OnPropTextdrawUpdate(1,test);
  60. }
  61. else
  62. {
  63. HouseInfo[test][hHel] = 0;
  64. HouseInfo[test][hArm] = 0;
  65. HouseInfo[test][hLock] = 0;
  66. HouseInfo[test][hLicitatie] = 1;
  67. HouseInfo[test][hOwned] = 0;
  68. PlayerInfo[id][pRented] = 0;
  69. strmid(HouseInfo[test][hOwner], "The State", 0, strlen("The State"), 255);
  70. new str2[256];
  71. new str3[256];
  72. mysql_format(SQL,str3,sizeof(str3),"UPDATE `users` SET `House`='999' WHERE `name`='%s'",query);
  73. mysql_tquery(SQL,str3,"","");
  74. mysql_format(SQL,str2,sizeof(str2),"UPDATE `houses` SET `Hel`='0',`Licitatie`='1',`Arm`='0',`Lockk`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",HouseInfo[test][hID]);
  75. mysql_tquery(SQL,str2,"","");
  76. OnPropTextdrawUpdate(1,test);
  77. }
  78. }
  79. cache_delete(membresult);
  80. }
Advertisement
Add Comment
Please, Sign In to add comment