Advertisement
Guest User

Untitled

a guest
Sep 13th, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. YCMD:ad(playerid, params[], help) {
  2. if(AdTimer[playerid] != 0) return SCM(playerid, COLOR_LGREEN, "Ai pus un anunt recent. Foloseste comanda /myad pentru a-l vedea.");
  3. new string[264],sendername[25],idx, str[184];
  4. if(!PlayerInfo[playerid][pPhone]) return SCM(playerid, COLOR_LGREEN, "Nu ai un telefon.");
  5. if(PlayerInfo[playerid][pMuted] == 1) {
  6. format(string, sizeof(string), "Nu poti folosi chatul deoarece ai mute. (%d seconds)",PlayerInfo[playerid][pMuteTime]);
  7. SCM(playerid, COLOR_GREY, string);
  8. return 1;
  9. }
  10. if(PlayerInfo[playerid][pLevel] < 5) return SCM(playerid, COLOR_GREY, "Ai nevoie de nivel 5 pentru a da un anunt!");
  11. GetPlayerName(playerid, sendername, sizeof(sendername));
  12. new length = strlen(params);
  13. while ((idx < length) && (params[idx] <= ' ')) idx++;
  14. new offset = idx, result[264];
  15. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
  16. result[idx - offset] = params[idx];
  17. idx++;
  18. }
  19. result[idx - offset] = EOS;
  20. new totalads = TotalAds()+1;
  21. new adtimer;
  22. new payout = BizzInfo[14][bFee];
  23. new payout2 = BizzInfo[33][bFee];
  24. new payout3 = BizzInfo[34][bFee];
  25. if(!IsAtCNN(playerid)) return SCM(playerid, -1, "Eroare: Nu esti la un CNN!");
  26. if(!strlen(result)) return SCM(playerid, COLOR_GREY, "Sintaxa: {FFFFFF}/ad <Text>");
  27. if(FaceReclama(result)) return Reclama(playerid, result);
  28. if(IsAtCNN(playerid)) {
  29.  
  30. if(payout)
  31. {
  32. if(IsPlayerInRangeOfPoint(playerid, 5.0, 1111.2168,-1796.9795,16.5938)) {
  33. if(GetPlayerCash(playerid) < payout) {
  34. format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumber(payout));
  35. SCM(playerid, COLOR_WHITE, string);
  36. return 1;
  37. }
  38. GivePlayerCash(playerid, - payout);
  39. format(string, sizeof(string), "~r~Ai platit $%d~n~~w~Mesajul contine: %d caractere", payout, idx);
  40. GameTextForPlayer(playerid, string, 5000, 5);
  41. format(AdText[playerid], 256, result);
  42.  
  43. format(string, sizeof(string), "Anunt publicat de %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
  44. SendStaffMessage(0x00D900FF, string);
  45. AdTimer[playerid] = totalads*60;
  46.  
  47. adtimer = SetTimerEx("Advertisment", totalads*60000, 0, "d", playerid);
  48. SetPVarInt(playerid, "AdTimer", adtimer);
  49. format(string, sizeof(string), "Anuntul tau va fi afisat in %d minute (%d secunde).", AdTimer[playerid]/60, AdTimer[playerid]);
  50. SCM(playerid, -1, string);
  51. BizzInfo[14][bBalance] += payout;
  52.  
  53. format(str,sizeof(str),"UPDATE 'bizz' SET `Till`='%d',`Products`='%d' WHERE `ID`='14'", BizzInfo[14][bBalance], BizzInfo[14][bProducts]);
  54. mysql_query(SQL,str);
  55. }
  56. }
  57. else if(payout2)
  58. {
  59. if(IsPlayerInRangeOfPoint(playerid, 5.0, -1942.8354,556.0744,35.1719)) {
  60. if(GetPlayerCash(playerid) < payout2) {
  61. format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumber(payout2));
  62. SCM(playerid, COLOR_WHITE, string);
  63. return 1;
  64. }
  65. GivePlayerCash(playerid, - payout2);
  66. format(string, sizeof(string), "~r~Ai platit $%d~n~~w~Mesajul contine: %d caractere", payout2, idx);
  67. GameTextForPlayer(playerid, string, 5000, 5);
  68. format(AdText[playerid], 256, result);
  69.  
  70. format(string, sizeof(string), "Anunt publicat de %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
  71. SendStaffMessage(0x00D900FF, string);
  72. AdTimer[playerid] = totalads*60;
  73.  
  74. adtimer = SetTimerEx("Advertisment", totalads*60000, 0, "d", playerid);
  75. SetPVarInt(playerid, "AdTimer", adtimer);
  76. format(string, sizeof(string), "Anuntul tau va fi afisat in %d minute (%d secunde).", AdTimer[playerid]/60, AdTimer[playerid]);
  77. SCM(playerid, -1, string);
  78. BizzInfo[33][bBalance] += payout2;
  79.  
  80. format(str,sizeof(str),"UPDATE 'bizz' SET `Till`='%d',`Products`='%d' WHERE `ID`='33'", BizzInfo[33][bBalance], BizzInfo[33][bProducts]);
  81. mysql_query(SQL,str);
  82. }
  83. }
  84. else if(payout3)
  85. {
  86. if(IsPlayerInRangeOfPoint(playerid, 5.0, 2078.6926,2045.8528,11.0579)) {
  87. if(GetPlayerCash(playerid) < payout3) {
  88. format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumber(payout3));
  89. SCM(playerid, COLOR_WHITE, string);
  90. return 1;
  91. }
  92. GivePlayerCash(playerid, - payout3);
  93. format(string, sizeof(string), "~r~Ai platit $%d~n~~w~Mesajul contine: %d caractere", payout3, idx);
  94. GameTextForPlayer(playerid, string, 5000, 5);
  95. format(AdText[playerid], 256, result);
  96.  
  97. format(string, sizeof(string), "Anunt publicat de %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
  98. SendStaffMessage(0x00D900FF, string);
  99. AdTimer[playerid] = totalads*60;
  100.  
  101. adtimer = SetTimerEx("Advertisment", totalads*60000, 0, "d", playerid);
  102. SetPVarInt(playerid, "AdTimer", adtimer);
  103. format(string, sizeof(string), "Anuntul tau va fi afisat in %d minute (%d secunde).", AdTimer[playerid]/60, AdTimer[playerid]);
  104. SCM(playerid, -1, string);
  105. BizzInfo[34][bBalance] += payout3;
  106.  
  107. format(str,sizeof(str),"UPDATE 'bizz' SET `Till`='%d',`Products`='%d' WHERE `ID`='34'", BizzInfo[34][bBalance], BizzInfo[34][bProducts]);
  108. mysql_query(SQL,str);
  109. }
  110. }
  111. }
  112. return 1;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement