Advertisement
Andrei001

Untitled

Jul 2nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.20 KB | None | 0 0
  1. YCMD:getgift(playerid, params[], help) {
  2. if(SpecialWeek == 0) return SCM(playerid, COLOR_LGREEN, "Giftbox-ul nu este activ!");
  3. new string[180], won[256];
  4. if(PlayerInfo[playerid][pGiftPoints] >= 2)
  5. {
  6. if(PlayerInfo[playerid][pConnectTime] < 1) return SCM(playerid, COLOR_LGREEN, "Ai nevoie de 2 ore jucate pentru a putea lua acest cadou!");
  7. if(PlayerToPoint(25.0, playerid, 192.0716,-1825.4077,7.2670))
  8. {
  9. new rand = random(310);
  10. PlayerInfo[playerid][pGiftPoints] = 2;
  11. Update(playerid, pGiftPointsx);
  12. if(rand < 270)
  13. {
  14. new randmoney = 1000000 + random(4500000);
  15. PlayerInfo[playerid][pCash] += randmoney;
  16. GivePlayerCash(playerid, randmoney);
  17. format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
  18. format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
  19. InsertLog(playerid, string, LOG_GIFTBOX);
  20. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  21. GiftMoney += randmoney;
  22. }
  23. else if(rand >= 270 && rand < 280)
  24. {
  25. new randrp = 2 + random(6);
  26. PlayerInfo[playerid][pPremiumPoints] += randrp;
  27. Update(playerid, pPremiumPointsx);
  28. format(won, sizeof(won), "Ai castigat %d puncte premium din gift box!", randrp);
  29. format(string, sizeof(string), "%s a castigat %d puncte premium din giftbox.", GetName(playerid), randrp);
  30. InsertLog(playerid, string, LOG_GIFTBOX);
  31. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  32. GiftGold += randrp;
  33. format(string, sizeof(string), "(( AdmBot: %s a castigat %d puncte premium din giftbox! ))", GetName(playerid), randrp);
  34. SendClientMessageToAll(COLOR_CLIENT, string);
  35. }
  36. else if(rand >= 280 && rand < 297)
  37. {
  38. new randrp = 1 + random(4);
  39. PlayerInfo[playerid][pExp] += randrp;
  40. Update(playerid, pRP);
  41. format(won, sizeof(won), "Ai castigat %d respect points din gift box!", randrp);
  42. format(string, sizeof(string), "%s a castigat %d RP-uri din giftbox.", GetName(playerid), randrp);
  43. InsertLog(playerid, string, LOG_GIFTBOX);
  44. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  45. GiftRP += randrp;
  46. UpdateProgress(playerid, 0);
  47. }
  48. else if(rand >= 297 && rand <= 300) {
  49. if(GiftVehicle < 60) {
  50. if(GetSlots(playerid) == GetVehicles(playerid)) {
  51. new randmoney = 1000000 + random(4500000);
  52. PlayerInfo[playerid][pCash] += randmoney;
  53. GivePlayerCash(playerid, randmoney);
  54. format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
  55. format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
  56. InsertLog(playerid, string, LOG_GIFTBOX);
  57. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  58. GiftMoney += randmoney;
  59. }
  60. else {
  61. GiftVehicle++;
  62. format(won, sizeof(won), "Felicitari! Ai castigat vehiculul Stretch din giftbox.");
  63. GiveVehicle(playerid, 409);
  64. format(string, sizeof(string), "(( AdmBot: %s a castigat vehiculul Stretch din giftbox! ))", GetName(playerid));
  65. SendClientMessageToAll(COLOR_CLIENT, string);
  66. format(string, sizeof(string), "(( AdmBot: Mai sunt %d vehicule disponibile. ))", 60-GiftVehicle);
  67. SendClientMessageToAll(COLOR_CLIENT, string);
  68. format(string, sizeof(string), "%s a castigat un Stretch din giftbox.", GetName(playerid));
  69. InsertLog(playerid, string, LOG_GIFTBOX);
  70. }
  71. }
  72. }
  73. else if(rand > 300 && rand < 305)
  74. {
  75. new str[128];
  76. PlayerInfo[playerid][pCarLic] = 1;
  77. PlayerInfo[playerid][pCarLicT] += 250;
  78. PlayerInfo[playerid][pCarLicS] = 0;
  79. PlayerInfo[playerid][pFlyLic] = 1;
  80. PlayerInfo[playerid][pFlyLicT] += 250;
  81. PlayerInfo[playerid][pFlyLicS] = 0;
  82. PlayerInfo[playerid][pBoatLic] = 1;
  83. PlayerInfo[playerid][pBoatLicT] += 250;
  84. PlayerInfo[playerid][pBoatLicS] = 0;
  85. PlayerInfo[playerid][pGunLic] = 1;
  86. PlayerInfo[playerid][pGunLicT] += 250;
  87. PlayerInfo[playerid][pGunLicS] = 0;
  88. format(str,128,"UPDATE users SET `CarLic`='1',`CarLicT`='%d',`CarLicS`='0' WHERE `ID`='%d'",PlayerInfo[playerid][pCarLicT],PlayerInfo[playerid][pSQLID]);
  89. mysql_query(SQL,str);
  90. format(str,128,"UPDATE users SET `FlyLic`='1',`FlyLicT`='%d',`FlyLicS`='0' WHERE `ID`='%d'",PlayerInfo[playerid][pFlyLicT],PlayerInfo[playerid][pSQLID]);
  91. mysql_query(SQL,str);
  92. format(str,128,"UPDATE users SET `BoatLic`='1',`BoatLicT`='%d',`BoatLicS`='0' WHERE `ID`='%d'",PlayerInfo[playerid][pBoatLicT],PlayerInfo[playerid][pSQLID]);
  93. mysql_query(SQL,str);
  94. format(str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='%d', `GunLicS`='0' WHERE `ID`='%d'",PlayerInfo[playerid][pGunLicT],PlayerInfo[playerid][pSQLID]);
  95. mysql_query(SQL,str);
  96. format(won, sizeof(won), "Ai primit toate licentele pentru inca 250 de ore!");
  97. format(string, sizeof(string), "%s a primit toate licentele pentru inca 250 de ore.", GetName(playerid));
  98. InsertLog(playerid, string, LOG_GIFTBOX);
  99. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  100. }
  101. else if(rand > 305 && rand < 306) {
  102. if(PlayerInfo[playerid][pFpunish] == 0) {
  103. new randmoney = 1000000 + random(4500000);
  104. PlayerInfo[playerid][pCash] += randmoney;
  105. GivePlayerCash(playerid, randmoney);
  106. format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
  107. format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
  108. InsertLog(playerid, string, LOG_GIFTBOX);
  109. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  110. GiftMoney += randmoney;
  111. }
  112. else {
  113. PlayerInfo[playerid][pFpunish] = 0;
  114. Update(playerid, pFpunishx);
  115. format(won, sizeof(won), "Felicitari! Ai ramas fara FP-uri.");
  116. format(string, sizeof(string), "%s a ramas fara FP-uri.", GetName(playerid));
  117. InsertLog(playerid, string, LOG_GIFTBOX);
  118. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  119. }
  120. }
  121. else if(rand > 306) {
  122. if(PlayerInfo[playerid][pWarns] == 0) {
  123. new randmoney = 1000000 + random(4500000);
  124. PlayerInfo[playerid][pCash] += randmoney;
  125. GivePlayerCash(playerid, randmoney);
  126. format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
  127. format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
  128. InsertLog(playerid, string, LOG_GIFTBOX);
  129. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  130. GiftMoney += randmoney;
  131. }
  132. else {
  133. PlayerInfo[playerid][pWarns] = 0;
  134. Update(playerid, pWarnsx);
  135. format(won, sizeof(won), "Felicitari! Ti-au fost sterse warn-urile.");
  136. format(string, sizeof(string), "%s a ramas fara warn-uri.", GetName(playerid));
  137. InsertLog(playerid, string, LOG_GIFTBOX);
  138. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  139. }
  140. }
  141. else {
  142. new randmoney = 1000000 + random(4500000);
  143. PlayerInfo[playerid][pCash] += randmoney;
  144. GivePlayerCash(playerid, randmoney);
  145. format(won, sizeof(won), "Ai castigat $%s din gift box!", FormatNumber(randmoney));
  146. format(string, sizeof(string), "%s a castigat $%s din giftbox.", GetName(playerid), FormatNumber(randmoney));
  147. InsertLog(playerid, string, LOG_GIFTBOX);
  148. ProxDetector(30.0,playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  149. GiftMoney += randmoney;
  150. }
  151. UpdateGift();
  152. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Giftbox", won, "Ok", "");
  153. }
  154. else return SendClientMessage(playerid, COLOR_GREY, "Nu esti la loc-ul getgift-ului ,acesta se afla pe plaja Los Santos");
  155. }
  156. else {
  157. format(string, sizeof(string), "Poti lua acest cadou peste %d ore.", 2-PlayerInfo[playerid][pGiftPoints]);
  158. SendClientMessage(playerid, COLOR_YELLOW, string);
  159. SCM(playerid, COLOR_YELLOW, "Orele se contorizeaza doar in momentul in care ai jucat cel putin 30 minute pana la payday.");
  160. }
  161. return 1;
  162. }
  163.  
  164. function UpdateGift() {
  165. if(SpecialWeek == 0) return 1;
  166. new string[500];
  167. format(string, sizeof(string), "Giftbox (/getgift)\nBani castigati: {FC6A6A}$%s{FFFFFF}\nRP-uri castigate: {FC6A6A}%s{FFFFFF}\nPuncte premium castigate: {FC6A6A}%s{FFFFFF}\nVehicule castigate: {FC6A6A}%s{FFFFFF}", FormatNumber(GiftMoney), FormatNumber(GiftRP), FormatNumber(GiftGold), FormatNumber(GiftVehicle));
  168. UpdateDynamic3DTextLabelText(GiftText, -1, string);
  169. new query[256];
  170. format(query, sizeof(query), "UPDATE `stuff` SET `GiftMoney`='%d', `GiftRP`='%d', `GiftGold`='%d', `GiftLevel`='%d', `GiftFP`='%d', `GiftVehicle`='%d'", GiftMoney, GiftRP, GiftGold, GiftLevel, GiftFP, GiftVehicle);
  171. mysql_tquery(SQL, query, "", "");
  172. return 1;
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement