Guest User

Untitled

a guest
Jan 11th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. //----------------------------------[advertise]-----------------------------------------------
  2. if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
  3. {
  4. if(IsPlayerConnected(playerid))
  5. {
  6. if(gPlayerLogged[playerid] == 0)
  7. {
  8. SendClientMessage(playerid, COLOR_GREY, "You havent logged in yet !");
  9. return 1;
  10. }
  11. if(PlayerInfo[playerid][pLevel] < 2)
  12. {
  13. SendClientMessage(playerid, 0x4FA7FFFF, "*** You must be level 2 to use /ad");
  14. return 1;
  15. }
  16. if(PlayerInfo[playerid][pMuted] == 1)
  17. {
  18. SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't speak, you have been silenced !");
  19. return 1;
  20. }
  21. GetPlayerName(playerid, sendername, sizeof(sendername));
  22. new length = strlen(cmdtext);
  23. while ((idx < length) && (cmdtext[idx] <= ' '))
  24. {
  25. idx++;
  26. }
  27. new offset = idx;
  28. new result[64];
  29. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  30. {
  31. result[idx - offset] = cmdtext[idx];
  32. idx++;
  33. }
  34. result[idx - offset] = EOS;
  35. result[0] = toupper(result[0]);
  36. if(!strlen(result))
  37. {
  38. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/ad)vertise [advert text]");
  39. return 1;
  40. }
  41. if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
  42. {
  43. format(string, sizeof(string), " Please try again later %d seconds between Advertisements !", (addtimer/1000));
  44. SendClientMessage(playerid, COLOR_GRAD2, string);
  45. return 1;
  46.  
  47. }
  48. new payout = idx * 25;
  49. if(GetPlayerCash(playerid) < payout)
  50. {
  51. format(string, sizeof(string), "* You used %d characters which cost $%d, you don't have enough.", offset, payout);
  52. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  53. return 1;
  54. }
  55. if(FindIP(result)) /// Anti-Reclama
  56. {
  57. SendClientMessage(playerid, COLOR_RED, "You have kicked for Guardian , because you write an IP Adrees.");
  58. new advertiser[MAX_PLAYER_NAME];
  59. GetPlayerName(playerid, advertiser, sizeof(advertiser));
  60. BanLog(string);
  61. Ban(playerid);
  62. return 1;
  63. }
  64. if(anty(result) && PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)
  65. {
  66. new advertiser[MAX_PLAYER_NAME];
  67. GetPlayerName(playerid, advertiser, sizeof(advertiser));
  68. format(string, sizeof(string), "SS Bot: {FFFF00}%s was kicked with reason: Reclama pe /ad",advertiser);
  69. SendClientMessageToAll(COLOR_RED,string);
  70. Kick(playerid);
  71. return 0;
  72. }
  73. if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pHelper] == 0)
  74. {
  75. for(new i=0; i<MAX_ENTRY; i++)
  76. {
  77. if(!Swear[i][0]) continue;
  78. Cenzura(result,Swear[i]);
  79. }
  80. }
  81. GivePlayerCash(playerid, - payout);
  82. SBizzInfo[7][sbTill] += payout;
  83. ExtortionSBiz(7, payout);
  84. format(string, sizeof(string), "Anunt publicat de Contact: %s (Telefon: %d): %s", result, sendername,PlayerInfo[playerid][pPnumber]);
  85. OOCNews(0x00FF0096,string);
  86. format(string, sizeof(string), "~r~Paid $%d~n~~w~Message contained: %d Characters", payout, idx);
  87. GameTextForPlayer(playerid, string, 5000, 5);
  88. if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
  89. }
  90. return 1;
  91. }
  92. if(strcmp(cmd, "/collect", true) == 0)//garbagejob
  93. {
  94. if(IsPlayerConnected(playerid))
  95. {
  96. if(PlayerInfo[playerid][pJob] != 19)
  97. {
  98. SendClientMessage(playerid, COLOR_GREY, " You are not a Garbage Collector. ");
  99. return 1;
  100. }
  101. new tmpcar = GetPlayerVehicleID(playerid);
  102. if(IsAGarbageTruck(tmpcar))
  103. {
  104. if(PlayerInfo[playerid][pGarbageTime] == 0)
  105. {
  106. if(IsCollectingRubbish[playerid] == 0)
  107. {
  108. SendClientMessage(playerid, COLOR_LIGHTBLUE, " INFO: Head to all the check points, then return to the depositt for a pay check.");
  109. SetPlayerCheckpoint(playerid, 2272.6401,-1918.6245,13.1102, 5.0);
  110. IsCollectingRubbish[playerid] = 1;
  111. PlayerInfo[playerid][pGarbageTime] += 900;
  112. }
  113. else
  114. {
  115. SendClientMessage(playerid, COLOR_GRAD2, " You are already collecting rubbish!");
  116. }
  117. }
  118. else
  119. {
  120. SendClientMessage(playerid, COLOR_GRAD2, " Wait until the next garbage run is available!");
  121. return 1;
  122. }
  123. }
  124. else
  125. {
  126. SendClientMessage(playerid, COLOR_GRAD2, " You are not in a Garbage Truck.");
  127. return 1;
  128. }
  129. }
  130. return 1;
  131. }
Add Comment
Please, Sign In to add comment