Advertisement
Guest User

payday

a guest
May 30th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.32 KB | None | 0 0
  1. //tajmer jednominutni
  2.  
  3. public Pay()
  4. {
  5. new string[256];
  6. new tmphour;
  7. new tmpminute;
  8. new tmpsecond;
  9. gettime(tmphour, tmpminute, tmpsecond);
  10. FixHour(tmphour);
  11. tmphour = shifthour;
  12. if((tmphour > ghour) || (tmphour == 0 && ghour == 23))
  13. {
  14. format(string, sizeof(string), "{0A9DC9}Zara Gaming RolePlay: {FFFFFF}Sada je {0A9DC9}%d:00 {FFFFFF}sati.",tmphour);
  15. BroadCast(WHITE,string);
  16. ghour = tmphour;
  17. PayDay();
  18. if (realtime)
  19. {
  20. SetWorldTime(tmphour);
  21. }
  22. }
  23. }
  24.  
  25. //PayDay
  26. public PayDay()
  27. {
  28. new string[128];
  29. new coordstring[128];
  30. new coordstring1[128];
  31. new coordstring2[128];
  32. new coordstring3[128];
  33. new coordstring4[180];
  34. new coordstring5[128];
  35. new coordstring6[128];
  36. new coordstring7[128];
  37. new coordstring8[128];
  38. new coordstring9[128];
  39. new coordstring10[128];
  40. new coordstring17[128];
  41. new coordstring11[128];
  42. new coordstring12[128];
  43. new coordstring13[128];
  44. new coordstring15[128];
  45. new coordstring16[128];
  46. new payday[1000];
  47. new account;
  48. new rent = 0;
  49. foreach (new i : Player)
  50. {
  51. new nxtlevel = PlayerInfo[i][pLevel]+1;
  52. new expamount = nxtlevel*levelexp;
  53. new infostring[128];
  54. if(PlayerInfo[i][pLevel] > 0)
  55. {
  56. if(PlayerInfo[i][pKredit] > 0)
  57. {
  58. PlayerInfo[i][pKredit] -= 500;
  59. AC_GivePlayerMoneyMinus(i,500);
  60. account -= 500;
  61. SCM(i, COLOR_LIGHTRED, "Odplatili ste 500$ kredita (/kreditinfo)");
  62. }
  63. if(MoneyMessage[i]==1)
  64. {
  65. if(PlayerInfo[i][pJailed] >= 1)
  66. {
  67. SCM(i, COLOR_LIGHTRED, "Niste odplatili ratu za kredit, produzuje vam se zatvorska kazna.");
  68. PlayerInfo[i][pJailTime] += 240;
  69. }
  70. else if(PlayerInfo[i][pJailed] == 0)
  71. {
  72. new rand1 = random(sizeof(gPrisonSpawn));
  73. SCM(i, COLOR_LIGHTRED, "Niste odplatili ratu za kredit, idete u zatvor.");
  74. GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
  75. SetPlayerInterior(i, 0);
  76. PlayerInfo[i][pInt] = 0;
  77. SetPlayerPos(i, gPrisonSpawn[rand1][0], gPrisonSpawn[rand1][1], gPrisonSpawn[rand1][2]);
  78. PlayerInfo[i][pJailed] = 2;
  79. AC_ResetPlayerWeapons(i);
  80. WantedLevel[i] = 0;
  81. PlayerInfo[i][pJailTime] = 240;
  82. format(string, sizeof(string), "Uhapseni ste na %d sekundi. Kaucija: Nedostupna", PlayerInfo[i][pJailTime]);
  83. SendClientMessage(i, SVETLOPLAVA, string);
  84. }
  85. }
  86. new playername2[MAX_PLAYER_NAME];
  87. GetPlayerName(i, playername2, sizeof(playername2));
  88. account = PlayerInfo[i][pAccount];
  89. new key = PlayerInfo[i][pPhousekey];
  90. if(key != 255)
  91. {
  92. rent = HouseInfo[key][hRent];
  93. if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
  94. {
  95. rent = 0;
  96. }
  97. else if(rent > PlayerInfo[i][pCash])
  98. {
  99. PlayerInfo[i][pPhousekey] = 255;
  100. SendClientMessage(i, COLOR_WHITE, "Iseljeni ste.");
  101. rent = 0;
  102. }
  103. else
  104. {
  105. HouseInfo[key][hMoney] = HouseInfo[key][hMoney]+rent;
  106. }
  107. }
  108. if(PlayerInfo[i][pPayDay] >= 5)
  109. {
  110. Tax += TaxValue;//Should work for every player online
  111. PlayerInfo[i][pAccount] -= TaxValue;
  112. new struja, voda, komunalije, promotersupporterplaca, drzavnaplaca, umirovljenikplaca;
  113. if(PlayerInfo[i][pPhousekey] != 255)
  114. {
  115. struja = 200 + (random(20));
  116. voda = 100 + (random(20));
  117. komunalije = 50 + (random(20));
  118. }
  119. if(PlayerInfo[i][pPbiskey] != 255)
  120. {
  121. struja = struja + (50 + (random(34)));
  122. voda = voda + (35 + (random(21)));
  123. komunalije = komunalije + (50 + (random(33)));
  124. }
  125. if(PlayerInfo[i][pPhousekey] == 255)
  126. {
  127. struja = 0;
  128. voda = 0;
  129. komunalije = 0;
  130. }
  131. new kamatnastopa, interes;
  132. if(PlayerInfo[i][pVip] == 4 || PlayerInfo[i][pAdministrator] >= 1 || CFG[0][cHappy] == 1)
  133. {
  134. PlayerInfo[i][pExp]++;
  135. }
  136. if(PlayerInfo[i][pPromoter] >= 1 || PlayerInfo[i][pSupporter] >= 1)
  137. {
  138. promotersupporterplaca = 5000;
  139. }
  140. if(PlayerInfo[i][pUmirovljenik] == 1)
  141. {
  142. umirovljenikplaca = 10000;
  143. }
  144. if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1 || PlayerInfo[i][pLeader] == 2 || PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pLeader] == 3 || PlayerInfo[i][pMember] == 3 || PlayerInfo[i][pMember] == 4 || PlayerInfo[i][pLeader] == 4 ||
  145. PlayerInfo[i][pMember] == 7 || PlayerInfo[i][pLeader] == 7 || PlayerInfo[i][pMember] == 8 || PlayerInfo[i][pLeader] == 8 || PlayerInfo[i][pMember] == 9 || PlayerInfo[i][pLeader] == 9 || PlayerInfo[i][pMember] == 10 || PlayerInfo[i][pLeader] == 10 ||
  146. PlayerInfo[i][pMember] == 18 || PlayerInfo[i][pLeader] == 18 || PlayerInfo[i][pMember] == 24 || PlayerInfo[i][pLeader] == 24)
  147. {
  148. drzavnaplaca = 2000;
  149. }
  150. if(PlayerInfo[i][pVip] == 4 || PlayerInfo[i][pAdministrator] >= 1)
  151. {
  152. kamatnastopa = 5;
  153. }
  154. else
  155. {
  156. kamatnastopa = 2;
  157. }
  158. interes = (PlayerInfo[i][pAccount]/1000)*(kamatnastopa);
  159. account += promotersupporterplaca;
  160. account += drzavnaplaca;
  161. account += umirovljenikplaca;
  162. account += 700;
  163. account += interes;
  164. account -= struja;
  165. account -= voda;
  166. account -= komunalije;
  167. PlayerInfo[i][pAccount] = account;
  168. PlayerInfo[i][pExp]++;
  169. format(coordstring, sizeof(coordstring)," {0A9DC9}|___BANKARSKI IZVJESTAJ___|");
  170. format(coordstring1, sizeof(coordstring1),"\n{FFFFFF}Placa: $700");
  171. format(coordstring2, sizeof(coordstring2),"\n{FFFFFF}Stecen interes od novca u banci: $%d",interes);
  172. format(coordstring3, sizeof(coordstring3),"\n{FFFFFF}Kamatna stopa: 0.%d %",kamatnastopa);
  173. format(coordstring4, sizeof(coordstring4),"\n{0A9DC9}|---------- Racuni ----------|");
  174. format(coordstring5, sizeof(coordstring5), "\n{FFFFFF}Racun za struju: $%d",struja);
  175. format(coordstring6, sizeof(coordstring6),"\n{FFFFFF}Racun za vodu(Vodovod): $%d",voda);
  176. format(coordstring7, sizeof(coordstring7),"\n{FFFFFF}Racun za komunalije(Gradska Cistoca): $%d",komunalije);
  177. format(coordstring8, sizeof(coordstring8),"\n\n{0A9DC9}|--------------------|");
  178. format(coordstring9, sizeof(coordstring9),"\n{FFFFFF}Ukoliko ste Promoter/Supporter primate dodatnih 5000$ na placu");
  179. format(coordstring10, sizeof(coordstring10),"\n{FFFFFF}Ukoliko ste clan Departmenta primate dodatnih 2000$ na placu");
  180. format(coordstring17, sizeof(coordstring17),"\n{FFFFFF}Ukoliko ste Umirovljenik primate dodatnih 10.000$ na placu");
  181. format(coordstring11, sizeof(coordstring11),"\n{0A9DC9}|------------------------|");
  182. format(coordstring12, sizeof(coordstring12),"\n{FFFFFF}Staro Stanje: $%d", account - 700 - interes + (struja + voda + komunalije + rent));
  183. format(coordstring13, sizeof(coordstring13),"\n{FFFFFF}Novo Stanje: $%d",PlayerInfo[i][pAccount]);
  184. format(coordstring15, sizeof(coordstring15),"\n{0A9DC9}|----------------------------------------|");
  185. format(coordstring16, sizeof(coordstring16),"\n");
  186. format(payday, 1000," %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",coordstring,coordstring1,coordstring2,coordstring3,coordstring4,coordstring5,coordstring6,coordstring7,coordstring8,coordstring9,coordstring10,coordstring17,coordstring11,coordstring12,coordstring13,coordstring15,coordstring16);
  187. ShowPlayerDialog(i, 900, DIALOG_STYLE_MSGBOX, "{0A9DC9}PAYDAY - PLACA", payday , "OK", "OK");
  188. format(string, sizeof(string), "~b~Placa~n~~w~je stigla na vas racun");
  189. GameTextForPlayer(i, string, 5000, 1);
  190. rent = 0;
  191. PlayerInfo[i][pPayDay] = 0;
  192. PlayerInfo[i][pConnectTime] += 1;
  193. if (PlayerInfo[i][pExp] >= expamount)
  194. {
  195. PlayerInfo[i][pLevel]++;
  196. PlayerInfo[i][pExp] = 0;
  197. format(infostring, 256, "{0A9DC9}ZG Level Up: {FFFFFF}Cestitamo! Sada ste level {0A9DC9}%d", nxtlevel);
  198. SCM(i, WHITE, infostring);
  199. }
  200. }
  201. else
  202. {
  203. SendClientMessage(i,WHITE, "{FF0000}#Error: {FFFFFF}Nazalost niste igrali dovoljno dugo da biste dobili placu!");
  204.  
  205. }
  206. }
  207. }
  208. SaveAccounts();
  209. return 1;
  210. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement