Advertisement
Guest User

public payday()

a guest
Jul 26th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.89 KB | None | 0 0
  1. BPS::PayDay()
  2. {
  3. new Conta,interest, dia, mes, ano;
  4. new rent = 0;
  5. timeinc = 0;
  6. teveguerra=false;
  7. teveprevisao=false;
  8. ResetSeq();
  9. new stringpayday[128];
  10.  
  11. getdate(ano, mes, dia);
  12. format( stringpayday, sizeof stringpayday, "%s",VerSemana(dia,mes,ano));
  13. TextDrawSetString(Reloginho3, stringpayday);
  14.  
  15. foreach(Player, i)
  16. {
  17. SetPVarInt(i, #VarFlood1, 0);
  18. SetPVarInt(i, #VarFlood2, 0);
  19. SetPVarInt(i, #VarFlood3, 0);
  20. SetPVarInt(i, #VarFlood4, 0);
  21. SetPVarInt(i, #VarFlood5, 0);
  22. SetPVarInt(i, #VarFlood6, 0);
  23. SetPVarInt(i, #VarFlood7, 0);
  24. SetPVarInt(i, #VarFlood8, 0);
  25. SetPVarInt(i, #VarFlood9, 0);
  26. SetPVarInt(i, #VarFlood10, 0);
  27. SetPVarInt(i, #VarFlood11, 0);
  28. SetPVarInt(i, #VarFlood13, 0);
  29. SetPVarInt(i, #VarFlood14, 0);
  30. SetPVarInt(i, #VarGranaBar1, 0);
  31. SetPVarInt(i, #VarGranaBar2, 0);
  32. SetPVarInt(i, #VarGranaBar3, 0);
  33. SetPVarInt(i, #VarGranaBar4, 0);
  34. SetPVarInt(i, #VarGranaBar5, 0);
  35. SetPVarInt(i, #VarFloodLocalizar, 0);
  36. SetPVarInt(i, #VarFloodsprunk, 0);
  37. SetPVarInt(i, "VarDano", 0);
  38. SetPVarInt(i, "timeLastVeh", 0);
  39. if(gPlayerLogged[i])
  40. {
  41. if(PlayerInfo[i][pLevel] > 0)
  42. {
  43. if(MoneyMessage[i]==1)
  44. {
  45. SendClientMessage(i, COR_TRIADS, "Você devia ter debitado suas dívidas, lhe enviaram um pedido de prisão.");
  46. GameTextForPlayer(i, "~r~apreendido !", 2000, 1);
  47. SetPlayerInterior(i, 6);
  48. SetPlayerPos(i, 264.6288,77.5742,1001.0391);
  49. PlayerInfo[i][pJailed] = 1;
  50. ResetPlayerWeapons(i);
  51. WantedPoints[i] = 0;
  52. PlayerInfo[i][pJailTime] = 240;
  53. format(stringpayday, sizeof(stringpayday), "Você foi preso por %d segundos. Fiança: Desativada", PlayerInfo[i][pJailTime]);
  54. SendClientMessage(i, COLOR_LIGHTBLUE, stringpayday);
  55. }
  56. new playername2[MAX_PLAYER_NAME];
  57. GetPlayerName(i, playername2, sizeof(playername2));
  58. new key = PlayerInfo[i][pPHousekey];
  59. if(key != 500)
  60. {
  61. rent = HouseInfo[key][hRent];
  62. if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
  63. {
  64. rent = 0;
  65. }
  66. else if(rent > GetPlayerMoney(i))
  67. {
  68. PlayerInfo[i][pPHousekey] = 500;
  69. SendClientMessage(i, COLOR_WHITE, "Você foi expulso(a).");
  70. rent = 0;
  71. }
  72. HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
  73. }
  74. new tmpintrate;
  75. if(PlayerInfo[i][pVIP] == 1)
  76. {
  77. tmpintrate = 14;
  78. PlayerInfo[i][pExp]+=2;
  79. }
  80. else if(PlayerInfo[i][pVIP] == 2)
  81. {
  82. tmpintrate = 18;
  83. PlayerInfo[i][pExp]+=5;
  84. }
  85. else if(PlayerInfo[i][pVIP] == 5)
  86. {
  87. tmpintrate = 24;
  88. PlayerInfo[i][pExp]+=10;
  89. }
  90. else if(PlayerInfo[i][pVIP] == 6)
  91. {
  92. tmpintrate = 30;
  93. PlayerInfo[i][pExp]+=13;
  94. }
  95. else
  96. {
  97. tmpintrate = 6;
  98. PlayerInfo[i][pExp]++;
  99. }
  100. if(PlayerInfo[i][pPayDay] >= 3)
  101. {
  102. //new Conta = PlayerInfo[i][pConta];
  103. Tax += TaxValue;//Shorld work for every player online
  104. new Aleatoriedade = random(2000);
  105. new Aleatoriedade2 = random(9999);
  106. if(Aleatoriedade < 10000) Aleatoriedade += Aleatoriedade2;
  107. PlayerInfo[i][pConta] -= TaxValue;
  108. new checks = PlayerInfo[i][pSalario]*Aleatoriedade;
  109. new ebill = PlayerInfo[i][pLevel]*1000;
  110. new Febill = random(1500);
  111. new PGLT = random(300000);
  112. if(PGLT < 100000) PGLT += 100000;
  113. if(checks > 200000) checks = Aleatoriedade;
  114. if(checks < 30000) checks += 30000;
  115. if(checks < 0) checks = 100000;
  116. GiveDinheiro(i, checks);
  117. GiveDinheiro(i, -TaxValue);
  118. if(PlayerInfo[i][pConta] > 0)
  119. {
  120. PlayerInfo[i][pConta] -= ebill;
  121. SBizzInfo[4][sbTill] += ebill;
  122. PLO += ebill;
  123. DepositarOrgGrana(7,ebill);
  124. }
  125. else
  126. {
  127. ebill = 0;
  128. }
  129. Conta = PlayerInfo[i][pConta];
  130. interest = (PlayerInfo[i][pConta]/1000)*(tmpintrate);
  131. PlayerPlaySound(i, 1185, 0.0, 0.0, 0.0);
  132. //SgD = PlayerInfo[i][pLevel]*1000;
  133. PlayerInfo[i][pConta] = Conta+interest;
  134. //PlayerInfo[i][pConta] = Conta+SgD;
  135. DepositarOrgGrana(7,TaxValue);
  136. SendClientMessage(i, 0x808080AA, "» ~~~~~~~~ Salario {33CCFF}Project Show {808080}~~~~~~~~");
  137. format(stringpayday, sizeof(stringpayday), "» Pagamento:{00FF00} R$%d {808080}Imposto: {FF0000}-R$%d", checks, TaxValue);
  138. SendClientMessage(i, 0x808080AA, stringpayday);
  139. format(stringpayday, sizeof(stringpayday), "» Plano de saude: {FF0000}-R$300");
  140. SendClientMessage(i, 0x808080AA, stringpayday);
  141. if(PlayerInfo[i][pPHousekey] != 500 || PlayerInfo[i][pPbiskey] != 255)
  142. {
  143. format(stringpayday, sizeof(stringpayday), "» Energia [%s]: {FF0000}-R$%d ", SBizzInfo[4][sbMessage], ebill);
  144. SendClientMessage(i, 0x808080AA, stringpayday);
  145. PMH += Febill;
  146. PDU += Febill;
  147. SacarOrgGrana(7,Febill);
  148. }
  149. if(PlayerInfo[i][pPFazkey] != 255)
  150. {
  151. format(stringpayday, sizeof(stringpayday), "» Empresa d'agua: {FF0000}-R$%d", ebill);
  152. SendClientMessage(i, 0x808080AA, stringpayday);
  153. PME += Febill;
  154. PDU += Febill;
  155. SacarOrgGrana(7,Febill);
  156. }
  157. if(Conta > 0)
  158. {
  159. format(stringpayday, sizeof(stringpayday), "» Conta Bancaria: {00FF00}R$%s", ConvertMoney(Conta));
  160. SendClientMessage(i, 0x808080AA, stringpayday);
  161. }
  162. else
  163. {
  164. format(stringpayday, sizeof(stringpayday), "» Conta Bancaria: {FF0000}R$-%s", ConvertMoney(Conta));
  165. SendClientMessage(i, 0x808080AA, stringpayday);
  166. }
  167. format(stringpayday, sizeof(stringpayday), "» Juros: {00FF00}0.%d {B4B5B7}por cento {808080}Aluguel: {FF0000}-R$%d",tmpintrate, rent);
  168. SendClientMessage(i, 0x808080AA, stringpayday);
  169. format(stringpayday, sizeof(stringpayday), "» Valor ganho com Juros {33FF00}R$%d", interest);
  170. SendClientMessage(i, 0x808080AA, stringpayday);
  171. SalarioPlayer(i);
  172. SendClientMessage(i, 0x808080AA, "» ~~~~~~~~ Salario {33CCFF}Project Show {808080}~~~~~~~~");
  173. DepositarOrgGrana(7,interest);
  174. if(PlayerInfo[i][pConta] > 1)
  175. {
  176. format(stringpayday, sizeof(stringpayday), "» Novo Saldo Bancario: {00FF00}R$%s", ConvertMoney(PlayerInfo[i][pConta]));
  177. SendClientMessage(i, 0x808080AA, stringpayday);
  178. }
  179. else if(PlayerInfo[i][pConta] < 1)
  180. {
  181. format(stringpayday, sizeof(stringpayday), "» Novo Saldo Bancario: {FF0000}-R$%s", ConvertMoney(PlayerInfo[i][pConta]));
  182. SendClientMessage(i, 0x808080AA, stringpayday);
  183. }
  184. if(PlayerInfo[i][pLider] == 7)
  185. {
  186. if(CofreOrg[7][Dinheiro] >= 1000000)
  187. {
  188. PGLT = random(2000);
  189. }
  190. format(stringpayday, sizeof(stringpayday), " Lucros do Governo: {00FF00}R$%s", ConvertMoney(PGLT));
  191. SendClientMessage(i, COLOR_LIGHTBLUE, stringpayday);
  192. DepositarOrgGrana(7,PGLT);
  193. }
  194. if(PlayerInfo[i][pEmprego] > 0)
  195. {
  196. if(PlayerInfo[i][pContractTime] < 5)
  197. {
  198. PlayerInfo[i][pContractTime] ++;
  199. }
  200. }
  201. SetTimerEx("PararMusica", 7900, 0, "i", i);
  202. GameTextForPlayer(i, "~g~Salario~n~~w~BPS", 5000, 1);
  203. rent = 0;
  204. PlayerInfo[i][pPayDay] = 0;
  205. PlayerInfo[i][pCaixinha] = 0;
  206. PlayerInfo[i][pCaixaCash] = 0;
  207. PlayerInfo[i][pSalario] = 0;
  208. PlayerInfo[i][pLimparb] = 0;
  209. PlayerInfo[i][pConnectTime] += 1;
  210. if(PlayerInfo[i][pTempoConce] != 0)
  211. {
  212. PlayerInfo[i][pTempoConce] -= 1;
  213. }
  214. if(PlayerInfo[i][pTempoConce] <= 0)
  215. {
  216. PlayerInfo[i][pTempoConce] = 0;
  217. }
  218. if(MoneyMessage[i]==1)
  219. {
  220. SendClientMessage(i, COLOR_LIGHTRED, "Você não pagou a sua dívida e foi preso.");
  221. GameTextForPlayer(i, "~r~Preso!", 2000, 1);
  222. SetPlayerInterior(i, 6);
  223. SetPlayerPos(i, 264.6288,77.5742,1001.0391);
  224. PlayerInfo[i][pJailed] = 1;
  225. ResetPlayerWeapons(i);
  226. WantedPoints[i] = 0;
  227. storeexit[i] = 66;
  228. SetPlayerWantedLevelEx(i, 0);
  229. PlayerInfo[i][pJailTime] = 240;
  230. format(stringpayday, sizeof(stringpayday), "Você foi preso por %d segundos.", PlayerInfo[i][pJailTime]);
  231. SendClientMessage(i, COLOR_LIGHTBLUE, stringpayday);
  232. }
  233. Atividade[i][dia]++;
  234. SalvarAtividade(i);
  235. }
  236. else
  237. {
  238. SendClientMessage(i, COLOR_LIGHTRED, "* Você não jogou tempo suficiente para receber salário!");
  239. }
  240. }
  241. }
  242. new lolbagui;
  243. lolbagui = PlayerInfo[i][pExp];
  244. new nxtlevel = PlayerInfo[i][pLevel]+1;
  245. if(lolbagui >= nxtlevel*levelexp)
  246. {
  247. GameTextForPlayer(i, "~w~~h~Respeito Adquirido~n~~g~Digite /comprarnivel", 5000, 1);
  248. }
  249. }
  250. if(TriadMatou > HitmanMatou){
  251. format(stringpayday, 128, "Sua Organização Ganhou o Kit Bônus {FFFF00}[Contratos Triad %d x %d Contratos Hitmans]", TriadMatou, HitmanMatou);
  252. SendFamilyMessage(22, 0xFFFFFFFF, stringpayday);
  253. OrgVencedora = 22;
  254. }
  255. else if(HitmanMatou > TriadMatou){
  256. format(stringpayday, 128, "Sua Organização Ganhou o Kit Bônus {FFFF00}[Contratos Hitman %d x %d Contratos Triad]", HitmanMatou, TriadMatou);
  257. SendFamilyMessage(8, 0xFFFFFFFF, stringpayday);
  258. OrgVencedora = 8;
  259. }
  260. else{
  261. //format(stringpayday, 128, "[BONUS]: Nenhuma agência de assassinos ganhou o kit bônus neste payday.");
  262. OrgVencedora = 0;
  263. }
  264.  
  265. TriadMatou = 0;
  266. HitmanMatou = 0;
  267. //SendClientMessageToAll(0xFFFF00FF, stringpayday);
  268.  
  269. for(new i; i != MAX_TERRITORIOS; i++)
  270. {
  271. if(trLS[i][trCreated])
  272. trLS[i][trLiberarGuerra] = 0;
  273.  
  274. }
  275. for(new k=1; k != MAX_ORGS; k++)
  276. {
  277. if(RadioDesativado[k] == 1)
  278. RadioDesativado[k] = 0;
  279. }
  280. Checkproop();
  281. return true;
  282. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement