Advertisement
AndreiAndre777

Untitled

Nov 20th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.87 KB | None | 0 0
  1. CMD:ad( playerid, params [ ] )
  2. {
  3. new
  4. sendername[25],
  5. string[128],
  6. result;
  7.  
  8. if(IsPlayerConnected(playerid))
  9. {
  10. if(P_DATA[playerid][pMuted] >= 1)
  11. {
  12. SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nu poti da un /ad, ai mute!");
  13. return 1;
  14. }
  15. if( sscanf( params, "d", result ) )
  16. return SendClientMessage( playerid, -1, "{00FF00}Folosire:{FFFFFF} /ad [text]" );
  17. if(gPlayerLogged[playerid] == 0)
  18. {
  19. SendClientMessage(playerid, COLOR_GREY, "** Nu esti logat inca !");
  20. return 1;
  21. }
  22. if(P_DATA[playerid][pLevel] < 2)
  23. {
  24. SendClientMessage(playerid, COLOR_GREY, "** Iti trebuie minim level 2 !");
  25. return 1;
  26. }
  27. if(!PlayerToPoint(3.0, playerid, SBizzInfo[7][sbEntranceX], SBizzInfo[7][sbEntranceY], SBizzInfo[7][sbEntranceZ]) && !PlayerToPoint(3.0, playerid, SBizzInfo[8][sbEntranceX], SBizzInfo[8][sbEntranceY], SBizzInfo[8][sbEntranceZ]))
  28. {
  29. SendClientMessage(playerid, COLOR_GREY, "** Nu esti la sediul CNN.");
  30. return 1;
  31. }
  32. GetPlayerName(playerid, sendername, sizeof(sendername));
  33.  
  34. if (AdTimer[playerid] > 0)
  35. {
  36. format(string, sizeof(string), "** Asteapta %d secunde inainte de a mai plasa un anunt !", (addtimerls/1000));
  37. SendClientMessage(playerid, COLOR_GRAD2, string);
  38. return 1;
  39. }
  40. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "{0066FF}AD: {FFFFFF}Nu poti plasa un anunt dintr-un vehicul!");
  41.  
  42. for(new i; i < sizeof(TLD); i++)
  43. {
  44. if(strfind(result, TLD[i], true) != -1)
  45. {
  46. new reclama2[MAX_PLAYER_NAME];
  47. GetPlayerName(playerid, reclama2, sizeof(reclama2));
  48. SendClientMessage(playerid, COLOR_RED, "{0066FF}Reclama: {FFFFFF}Nu face reclama!");
  49. format(string, 256, "{0066FF}Warnings: {FF0000}%s {FFFFFF}a incercat sa faca reclama. {0066FF}Mesaj : {FFFFFF}%s .", reclama2, result);
  50. ABroadCast(COLOR_YELLOW,string,1);
  51. return 0;
  52. }
  53.  
  54. }
  55. if(GoIP(result))
  56. {
  57. new reclama[MAX_PLAYER_NAME];
  58. GetPlayerName(playerid, reclama, sizeof(reclama));
  59. SendClientMessage(playerid, 0xFF0000FF, "{0066FF}Reclama: {FFFFFF}Nu face reclama!");
  60. format(string, 256, "{0066FF}Warnings: {FF0000}%s {FFFFFF}a incercat sa faca reclama. {0066FF}Mesaj : {FFFFFF}%s .", reclama, result);
  61. ABroadCast(COLOR_YELLOW,string,1);
  62. return 0;
  63. }
  64. if(PlayerToPoint(3.0,playerid,SBizzInfo[7][sbEntranceX], SBizzInfo[7][sbEntranceY], SBizzInfo[7][sbEntranceZ]) || PlayerToPoint(3.0,playerid,SBizzInfo[8][sbEntranceX], SBizzInfo[8][sbEntranceY], SBizzInfo[8][sbEntranceZ]))
  65. {
  66. new payout;
  67. if(PlayerToPoint(3.0,playerid,SBizzInfo[8][sbEntranceX], SBizzInfo[8][sbEntranceY], SBizzInfo[8][sbEntranceZ])) payout = idx * SBizzInfo[8][sbEntranceCost]; else payout = idx * SBizzInfo[7][sbEntranceCost];
  68. if(GetPlayerCash(playerid) < payout)
  69. {
  70. format(string, sizeof(string), "** Ai folosit %d caractere costand $%s, si nu detii aceasta suma.", offset, FormatNumber(payout));
  71. SendClientMessage(playerid, COLOR_WHITE, string);
  72. return 1;
  73. }
  74. GivePlayerMoneyEx(playerid, - payout);
  75. if(PlayerToPoint(3.0,playerid,SBizzInfo[7][sbEntranceX], SBizzInfo[7][sbEntranceY], SBizzInfo[7][sbEntranceZ]))
  76. {
  77. SBizzInfo[7][sbTill] += payout;
  78. ExtortionSBiz(7, payout);
  79. }
  80. if(PlayerToPoint(3.0,playerid,SBizzInfo[8][sbEntranceX], SBizzInfo[8][sbEntranceY], SBizzInfo[8][sbEntranceZ]))
  81. {
  82. SBizzInfo[8][sbTill] += payout;
  83. ExtortionSBiz(8, payout);
  84. }
  85.  
  86. for(new x = 0; x < sizeof(AdList); x++) {
  87. if(!strlen(AdList[x])) {
  88. format(AdList[x], 200, "Advertisement placed by %s (Phone: {FFFFFF}%d{00D900}): %s", sendername, P_DATA[playerid][pPnumber], (result));
  89. format(string, sizeof(string), "~r~-~g~$~r~%s", FormatNumber(strlen(result)*SBizzInfo[1][sbEntranceCost]));
  90. GameTextForPlayer(playerid, string, 5000, 5);
  91. SendClientMessage(playerid,COLOR_WHITE,"{C90000}Advertisement: {FFFFFF}Your ad has been added to the list. An ad is sent every 10 seconds!");
  92. SBizzInfo[1][sbTill] += strlen(result)*SBizzInfo[1][sbEntranceCost];
  93. SBizzInfo[1][sbProducts]--;
  94. format(string,sizeof(string),"UPDATE sbizz SET `Till`='%d',`Products`='%d' WHERE `ID`='1'",SBizzInfo[1][sbTill],SBizzInfo[1][sbProducts]);
  95. mysql_query(mysql, string);
  96. AdTimer[playerid] = 1;
  97. return 1;
  98. }
  99. }
  100. SendClientMessage(playerid, -1, "Error: Message queue is full!");
  101. }
  102. }
  103. return 1;
  104. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement