1
0

advisory.pwn 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Advisory System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. stock CBroadCast(color,string[],level)
  34. {
  35. foreach(new i: Player)
  36. {
  37. if (PlayerInfo[i][pHelper] >= level)
  38. {
  39. SendClientMessageEx(i, color, string);
  40. //printf("%s", string);
  41. }
  42. }
  43. return 1;
  44. }
  45. stock ShowNMuteFine(playerid)
  46. {
  47. new playername[MAX_PLAYER_NAME];
  48. GetPlayerName(playerid, playername, sizeof(playername));
  49. new totalwealth = PlayerInfo[playerid][pAccount] + GetPlayerCash(playerid);
  50. if(PlayerInfo[playerid][pPhousekey] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey]][hSafeMoney];
  51. if(PlayerInfo[playerid][pPhousekey2] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey2]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey2]][hSafeMoney];
  52. if(PlayerInfo[playerid][pPhousekey3] != INVALID_HOUSE_ID && HouseInfo[PlayerInfo[playerid][pPhousekey3]][hOwnerID] == GetPlayerSQLId(playerid)) totalwealth += HouseInfo[PlayerInfo[playerid][pPhousekey3]][hSafeMoney];
  53. new fine = 10*totalwealth/100;
  54. if(PlayerInfo[playerid][pNMuteTotal] < 4)
  55. {
  56. new string[64];
  57. format(string,sizeof(string),"Jail for %d Minutes\nCash Fine ($%d)",PlayerInfo[playerid][pNMuteTotal] * 15, fine);
  58. ShowPlayerDialogEx(playerid,NMUTE,DIALOG_STYLE_LIST,"Newbie Chat Unmute - Select your Punishment:",string,"Select","Cancel");
  59. }
  60. else if(PlayerInfo[playerid][pNMuteTotal] == 4) ShowPlayerDialogEx(playerid,NMUTE,DIALOG_STYLE_LIST,"Newbie Chat Unmute - Select your Punishment:","Prison for 1 Hour","Select","Cancel");
  61. else if(PlayerInfo[playerid][pNMuteTotal] == 5) ShowPlayerDialogEx(playerid,NMUTE,DIALOG_STYLE_LIST,"Newbie Chat Unmute - Select your Punishment:","Prison for 1 Hour and 15 Minutes","Select","Cancel");
  62. else if(PlayerInfo[playerid][pNMuteTotal] == 6) ShowPlayerDialogEx(playerid,NMUTE,DIALOG_STYLE_LIST,"Newbie Chat Unmute - Select your Punishment:","Prison for 1 Hour and 30 Minutes","Select","Cancel");
  63. }
  64. stock SendAdvisorMessage(color, string[])
  65. {
  66. foreach(new i: Player)
  67. {
  68. if((PlayerInfo[i][pAdmin] >= 1 || PlayerInfo[i][pHelper] >= 2 || PlayerInfo[i][pVIPMod] || PlayerInfo[i][pWatchdog] >= 1) && advisorchat[i])
  69. {
  70. ChatTrafficProcess(i, color, string, 15);
  71. }
  72. }
  73. }
  74. stock SendDutyAdvisorMessage(color, string[])
  75. {
  76. foreach(new i: Player)
  77. {
  78. if(PlayerInfo[i][pHelper] >= 2 && GetPVarInt(i, "AdvisorDuty") == 1)
  79. {
  80. SendClientMessageEx(i, color, string);
  81. }
  82. }
  83. }
  84. CMD:advisors(playerid, params[])
  85. {
  86. new string[128];
  87. if(PlayerInfo[playerid][pHelper] >= 1)
  88. {
  89. SendClientMessageEx(playerid, COLOR_GRAD1, "Advisors Online:");
  90. foreach(new i: Player)
  91. {
  92. new tdate[11], thour[9], i_timestamp[3];
  93. getdate(i_timestamp[0], i_timestamp[1], i_timestamp[2]);
  94. format(tdate, sizeof(tdate), "%d-%02d-%02d", i_timestamp[0], i_timestamp[1], i_timestamp[2]);
  95. format(thour, sizeof(thour), "%02d:00:00", hour);
  96. if(PlayerInfo[i][pHelper] != 0 && PlayerInfo[i][pHelper] <= PlayerInfo[playerid][pHelper])
  97. {
  98. if(PlayerInfo[i][pHelper] == 1 && PlayerInfo[i][pAdmin] < 2) {
  99. format(string, sizeof(string), "** JA: %s (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  100. }
  101. if(PlayerInfo[i][pHelper] == 2&&PlayerInfo[i][pAdmin]<2) {
  102. format(string, sizeof(string), "** GA: %s (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  103. }
  104. if(PlayerInfo[i][pHelper] == 3&&PlayerInfo[i][pAdmin]<2) {
  105. format(string, sizeof(string), "** SA: %s (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  106. }
  107. if(PlayerInfo[i][pHelper] >= 4&&PlayerInfo[i][pAdmin]<2) {
  108. format(string, sizeof(string), "** CA: %s (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  109. }
  110. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  111. }
  112. }
  113. }
  114. else if(PlayerInfo[playerid][pAdmin] >= 2) {
  115. SendClientMessageEx(playerid, COLOR_GRAD1, "Advisors Online:");
  116. foreach(new i: Player)
  117. {
  118. if(PlayerInfo[i][pHelper] >= 1) {
  119. new tdate[11], thour[9], i_timestamp[3];
  120. getdate(i_timestamp[0], i_timestamp[1], i_timestamp[2]);
  121. format(tdate, sizeof(tdate), "%d-%02d-%02d", i_timestamp[0], i_timestamp[1], i_timestamp[2]);
  122. format(thour, sizeof(thour), "%02d:00:00", hour);
  123. if(PlayerInfo[i][pHelper] == 1&&PlayerInfo[i][pAdmin]<2) {
  124. format(string, sizeof(string), "** Helper: %s (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  125. }
  126. if(PlayerInfo[i][pHelper] == 2&&PlayerInfo[i][pAdmin]<2) {
  127. if(GetPVarInt(i, "AdvisorDuty") == 1) {
  128. format(string, sizeof(string), "** Community Advisor: %s (On Duty) (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  129. }
  130. else {
  131. format(string, sizeof(string), "** Community Advisor: %s (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  132. }
  133. }
  134. if(PlayerInfo[i][pHelper] == 3&&PlayerInfo[i][pAdmin]<2) {
  135. if(GetPVarInt(i, "AdvisorDuty") == 1) {
  136. format(string, sizeof(string), "** Senior Advisor: %s (On Duty) (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  137. }
  138. else {
  139. format(string, sizeof(string), "** Senior Advisor: %s (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  140. }
  141. }
  142. if(PlayerInfo[i][pHelper] >= 4&&PlayerInfo[i][pAdmin]<2) {
  143. if(GetPVarInt(i, "AdvisorDuty") == 1) {
  144. format(string, sizeof(string), "** Chief Advisor: %s (On Duty) (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  145. }
  146. else {
  147. format(string, sizeof(string), "** Chief Advisor: %s (Requests This Hour: %d | Requests Today: %d)", GetPlayerNameEx(i), ReportHourCount[i], ReportCount[i]);
  148. }
  149. }
  150. SendClientMessageEx(playerid, COLOR_GRAD2, string);
  151. }
  152. }
  153. }
  154. else {
  155. SendClientMessageEx(playerid, COLOR_GRAD1, "If you have questions regarding gameplay, or the server use /newb.");
  156. SendClientMessageEx(playerid, COLOR_GRAD1, "If you see suspicious happenings/players /report [id] [reason].");
  157. }
  158. return 1;
  159. }
  160. CMD:caduty(playerid, params[])
  161. {
  162. if(PlayerInfo[playerid][pHelper] >= 2)
  163. {
  164. if(GetPVarInt(playerid, "AdvisorDuty") == 1)
  165. {
  166. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You are now off duty as a Advisor and will not receive calls anymore.");
  167. DeletePVar(playerid, "AdvisorDuty");
  168. Advisors -= 1;
  169. }
  170. else
  171. {
  172. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You are now on duty as a Advisor and will receive calls from people in need.");
  173. SetPVarInt(playerid, "AdvisorDuty", 1);
  174. Advisors += 1;
  175. }
  176. }
  177. else
  178. {
  179. SendClientMessageEx(playerid, COLOR_GRAD1, " You are not a Advisor!");
  180. }
  181. return 1;
  182. }
  183. CMD:nonewbie(playerid, params[])
  184. {
  185. if(PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pHelper] >= 4)
  186. {
  187. if (!nonewbie)
  188. {
  189. nonewbie = 1;
  190. SendClientMessageToAllEx(COLOR_GRAD2, "Newbie chat channel disabled by an Admin/Advisor!");
  191. }
  192. else
  193. {
  194. nonewbie = 0;
  195. SendClientMessageToAllEx(COLOR_GRAD2, "Newbie chat channel enabled by an Admin/Advisor!");
  196. }
  197. }
  198. else
  199. {
  200. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  201. }
  202. return 1;
  203. }
  204. CMD:checkrequestcount(playerid, params[])
  205. {
  206. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1 || PlayerInfo[playerid][pHelper] >= 3 || PlayerInfo[playerid][pPR] > 0)
  207. {
  208. new string[128], adminname[MAX_PLAYER_NAME], tdate[11];
  209. if(sscanf(params, "s[24]s[11]", adminname, tdate)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /checkrequestcount [advisor name] [date (YYYY-MM-DD)]");
  210. new giveplayerid = ReturnUser(adminname);
  211. if(IsPlayerConnected(giveplayerid))
  212. {
  213. mysql_format(MainPipeline, string, sizeof(string), "SELECT SUM(count) FROM `tokens_request` WHERE `playerid` = %d AND `date` = '%s'", GetPlayerSQLId(giveplayerid), tdate);
  214. mysql_tquery(MainPipeline, string, "QueryCheckCountFinish", "issi", playerid, GetPlayerNameEx(giveplayerid), tdate, 2);
  215. mysql_format(MainPipeline, string, sizeof(string), "SELECT `count`, `hour` FROM `tokens_request` WHERE `playerid` = %d AND `date` = '%s' ORDER BY `hour` ASC", GetPlayerSQLId(giveplayerid), tdate);
  216. mysql_tquery(MainPipeline, string, "QueryCheckCountFinish", "issi", playerid, GetPlayerNameEx(giveplayerid), tdate, 3);
  217. }
  218. else
  219. {
  220. new tmpName[MAX_PLAYER_NAME];
  221. mysql_escape_string(adminname, tmpName);
  222. mysql_format(MainPipeline, string, sizeof(string), "SELECT `id`, `Username` FROM `accounts` WHERE `Username` = '%s'", tmpName);
  223. mysql_tquery(MainPipeline, string, "QueryUsernameCheck", "isi", playerid, tdate, 1);
  224. }
  225. }
  226. return 1;
  227. }
  228. /*CMD:hlban(playerid, params[])
  229. {
  230. if(IsPlayerConnected(playerid))
  231. {
  232. if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pHelper] >= 1)
  233. {
  234. new string[128], giveplayerid;
  235. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /hlban [player]");
  236. if(IsPlayerConnected(giveplayerid))
  237. {
  238. if(PlayerInfo[giveplayerid][pHelper] >= 1 || PlayerInfo[giveplayerid][pAdmin] >= 1)
  239. {
  240. SendClientMessageEx(playerid, COLOR_GREY, "You can not ban admins/advisors/helpers from the helper channel!");
  241. return 1;
  242. }
  243. if(PlayerInfo[giveplayerid][pHelpMute] == 0)
  244. {
  245. PlayerInfo[giveplayerid][pHelpMute] = 1;
  246. foreach(new n: Player)
  247. {
  248. if(PlayerInfo[n][pToggledChats][0] == 0)
  249. {
  250. format(string, sizeof(string), "* %s has been banned from the helper channel by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  251. SendClientMessageEx(n, COLOR_JOINHELPERCHAT, string);
  252. }
  253. }
  254. if(PlayerInfo[playerid][pToggledChats][0] != 0)
  255. {
  256. format(string, sizeof(string), "* %s has been banned from the helper channel by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  257. SendClientMessageEx(playerid, COLOR_JOINHELPERCHAT, string);
  258. }
  259. PlayerInfo[giveplayerid][pToggledChats][0] = 1;
  260. format(string, sizeof(string), "You have been banned from helper channel by %s.", GetPlayerNameEx(playerid));
  261. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  262. format(string, sizeof(string), "AdmCmd: %s(%d) was banned from /hl by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  263. Log("logs/mute.log", string);
  264. }
  265. else
  266. {
  267. PlayerInfo[giveplayerid][pHelpMute] = 0;
  268. foreach(new n: Player)
  269. {
  270. if (PlayerInfo[n][pToggledChats][0] == 0)
  271. {
  272. format(string, sizeof(string), "* %s has been unbanned from the helper channel by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  273. SendClientMessageEx(n, COLOR_JOINHELPERCHAT, string);
  274. }
  275. }
  276. if(PlayerInfo[playerid][pToggledChats][0] != 0)
  277. {
  278. format(string, sizeof(string), "* %s has been unbanned from the helper channel by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  279. SendClientMessageEx(playerid, COLOR_JOINHELPERCHAT, string);
  280. }
  281. format(string, sizeof(string), "You have been unbanned from helper channel by %s.", GetPlayerNameEx(playerid));
  282. SendClientMessageEx(giveplayerid, COLOR_GRAD2, string);
  283. format(string, sizeof(string), "AdmCmd: %s(%d) was unbanned from /hl by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  284. Log("logs/mute.log", string);
  285. }
  286. }
  287. }
  288. else
  289. {
  290. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  291. }
  292. }
  293. return 1;
  294. }
  295. CMD:hl(playerid, params[])
  296. {
  297. if(gPlayerLogged{playerid} == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
  298. if(PlayerInfo[playerid][pTut] == 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't do that at this time.");
  299. if((nonewbie) && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an administrator!");
  300. if(PlayerInfo[playerid][pNMute] == 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are muted from the newbie chat channel.");
  301. if(PlayerInfo[playerid][pToggledChats][0]) return SendClientMessageEx(playerid, COLOR_GREY, "You have the channel toggled, /tog newbie to re-enable!");
  302. new string[128];
  303. if(gettime() < NewbieTimer[playerid])
  304. {
  305. format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", NewbieTimer[playerid]-gettime());
  306. SendClientMessageEx(playerid, COLOR_GREY, string);
  307. return 1;
  308. }
  309. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: (/newb)ie [text]");
  310. if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)
  311. {
  312. NewbieTimer[playerid] = gettime()+60;
  313. format(string, sizeof(string), "** Newbie %s: %s", GetPlayerNameEx(playerid), params);
  314. }
  315. if(PlayerInfo[playerid][pWatchdog] >= 1)
  316. {
  317. NewbieTimer[playerid] = gettime()+30;
  318. format(string, sizeof(string), "** Watchdog %s: %s", GetPlayerNameEx(playerid), params);
  319. }
  320. if(PlayerInfo[playerid][pHelper] == 1 && PlayerInfo[playerid][pAdmin] < 2)
  321. {
  322. NewbieTimer[playerid] = gettime()+30;
  323. format(string, sizeof(string), "** Helper %s: %s", GetPlayerNameEx(playerid), params);
  324. ReportCount[playerid]++;
  325. ReportHourCount[playerid]++;
  326. AddCAReportToken(playerid); // Advisor Tokens
  327. }
  328. if(PlayerInfo[playerid][pAdmin] == 1)
  329. {
  330. NewbieTimer[playerid] = gettime()+30;
  331. if(PlayerInfo[playerid][pSMod] == 1) format(string, sizeof(string), "** Senior Moderator %s: %s", GetPlayerNameEx(playerid), params);
  332. else format(string, sizeof(string), "** Moderator %s: %s", GetPlayerNameEx(playerid), params);
  333. }
  334. if(PlayerInfo[playerid][pHelper] == 2 && PlayerInfo[playerid][pAdmin] < 2)
  335. {
  336. NewbieTimer[playerid] = gettime()+10;
  337. format(string, sizeof(string), "** Advisor %s: %s", GetPlayerNameEx(playerid), params);
  338. }
  339. if(PlayerInfo[playerid][pHelper] == 3 && PlayerInfo[playerid][pAdmin] < 2)
  340. {
  341. NewbieTimer[playerid] = gettime()+10;
  342. format(string, sizeof(string), "** Senior Advisor %s: %s", GetPlayerNameEx(playerid), params);
  343. }
  344. if(PlayerInfo[playerid][pHelper] >= 4 && PlayerInfo[playerid][pAdmin] < 2)
  345. {
  346. NewbieTimer[playerid] = gettime()+10;
  347. format(string, sizeof(string), "** Chief Advisor %s: %s", GetPlayerNameEx(playerid), params);
  348. }
  349. if(PlayerInfo[playerid][pAdmin] >= 2) format(string, sizeof(string), "** %s %s: %s", GetAdminRankName(PlayerInfo[playerid][pAdmin]), GetPlayerNameEx(playerid), params);
  350. foreach(new n: Player)
  351. {
  352. ChatTrafficProcess(n, COLOR_HELPERCHAT, string, 0);
  353. }
  354. return 1;
  355. }
  356. CMD:joinhelp(playerid, params[])
  357. {
  358. if(PlayerInfo[playerid][pToggledChats][0] == 0)
  359. {
  360. SendClientMessageEx(playerid, COLOR_WHITE, "You are already in the helper channel!");
  361. return 1;
  362. }
  363. if(gettime() < HlKickTimer[playerid])
  364. {
  365. SendClientMessageEx(playerid, COLOR_WHITE, "You have just been kicked, you can not rejoin yet!");
  366. return 1;
  367. }
  368. if(PlayerInfo[playerid][pHelpMute] == 1)
  369. {
  370. SendClientMessageEx(playerid, COLOR_GREY, "You are banned from the helper channel.");
  371. return 1;
  372. }
  373. SendClientMessageEx(playerid, COLOR_YELLOW, "You have joined the helper chat, type /hl to ask your question or /leavehelp to leave!");
  374. foreach(new n : Player)
  375. {
  376. if(PlayerInfo[n][pToggledChats][0] == 0)
  377. {
  378. format(szMiscArray, sizeof(szMiscArray), "* %s has joined the helper channel.", GetPlayerNameEx(playerid));
  379. SendClientMessageEx(n, COLOR_JOINHELPERCHAT, szMiscArray);
  380. }
  381. }
  382. PlayerInfo[playerid][pToggledChats][0] = 0;
  383. return 1;
  384. }
  385. CMD:leavehelp(playerid, params[])
  386. {
  387. if(PlayerInfo[playerid][pToggledChats][0] == 1)
  388. {
  389. SendClientMessageEx(playerid, COLOR_WHITE, "You are not in the helper channel!");
  390. return 1;
  391. }
  392. format(szMiscArray, sizeof(szMiscArray), "* %s has left the helper channel.", GetPlayerNameEx(playerid));
  393. foreach(new n: Player) ChatTrafficProcess(n, COLOR_JOINHELPERCHAT, szMiscArray, 0);
  394. PlayerInfo[playerid][pToggledChats][0] = 1;
  395. return 1;
  396. }
  397. CMD:hlkick(playerid, params[])
  398. {
  399. if (PlayerInfo[playerid][pHelper] >= 1 || PlayerInfo[playerid][pAdmin] >= 1){
  400. new giveplayerid;
  401. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /hlkick [player]");
  402. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  403. if(PlayerInfo[giveplayerid][pToggledChats][0] == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "That person is not in the helper channel!");
  404. if(PlayerInfo[giveplayerid][pHelper] >= 1 || PlayerInfo[giveplayerid][pAdmin] >= 2) return SendClientMessageEx(playerid, COLOR_GREY, "You can not kick admins/advisors from the helper channel!");
  405. new string[128];
  406. HlKickTimer[giveplayerid] = gettime()+120;
  407. format(string, sizeof(string), "* %s has been kicked from the helper channel by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  408. foreach(new n: Player)
  409. {
  410. if(PlayerInfo[playerid][pToggledChats][0] == 0) {
  411. SendClientMessageEx(n, COLOR_JOINHELPERCHAT, string);
  412. }
  413. }
  414. PlayerInfo[giveplayerid][pToggledChats][0] = 1;
  415. }
  416. else {
  417. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  418. }
  419. return 1;
  420. }*/
  421. CMD:nunmute(playerid, params[])
  422. {
  423. if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pWatchdog] >= 2)
  424. {
  425. new string[128], giveplayerid;
  426. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /nunmute [player]");
  427. if(IsPlayerConnected(giveplayerid))
  428. {
  429. if(PlayerInfo[giveplayerid][pNMute] == 1)
  430. {
  431. format(string, sizeof(string), "AdmCmd: %s(%d) was unmuted from speaking in /newb by %s.", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid));
  432. Log("logs/admin.log", string);
  433. format(string, sizeof(string), "AdmCmd: %s was unmuted from speaking in /newb by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  434. ABroadCast(COLOR_LIGHTRED,string,2);
  435. PlayerInfo[giveplayerid][pNMute] = 0;
  436. PlayerInfo[giveplayerid][pNMuteTotal]--;
  437. }
  438. else
  439. {
  440. SendClientMessageEx(playerid, COLOR_LIGHTRED,"That person is not muted from /newb!");
  441. }
  442. }
  443. }
  444. return 1;
  445. }
  446. CMD:nmute(playerid, params[])
  447. {
  448. if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pHelper] >= 2 || PlayerInfo[playerid][pSMod] == 1 || PlayerInfo[playerid][pWatchdog] >= 2)
  449. {
  450. new string[128], giveplayerid;
  451. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /nmute [player]");
  452. if(IsPlayerConnected(giveplayerid))
  453. {
  454. if(PlayerInfo[giveplayerid][pAdmin] >= 1)
  455. {
  456. return SendClientMessageEx(playerid, COLOR_LIGHTRED, "You can't /nmute admins");
  457. }
  458. if(PlayerInfo[giveplayerid][pNMute] == 0)
  459. {
  460. SetPVarInt(giveplayerid, "UnmuteTime", gettime());
  461. PlayerInfo[giveplayerid][pNMute] = 1;
  462. PlayerInfo[giveplayerid][pNMuteTotal] += 1;
  463. format(string, sizeof(string), "AdmCmd: %s(%d) was muted from speaking in /newb by %s(%d).", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  464. Log("logs/admin.log", string);
  465. format(string, sizeof(string), "AdmCmd: %s was muted from speaking in /newb by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  466. ABroadCast(COLOR_LIGHTRED,string,2);
  467. if(PlayerInfo[giveplayerid][pNMuteTotal] > 6)
  468. {
  469. PlayerInfo[giveplayerid][pNMuteTotal] = 0;
  470. CreateBan(playerid, PlayerInfo[giveplayerid][pId], giveplayerid, PlayerInfo[giveplayerid][pIP], "Excessive Newb Mutes", 10);
  471. }
  472. if(PlayerInfo[playerid][pAdmin] == 1)
  473. {
  474. format(string, sizeof(string), "AdmCmd: %s was muted from speaking in /newb by an Admin.", GetPlayerNameEx(giveplayerid));
  475. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  476. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, "You were just muted from Newbie Chat [/newb] by an Admin.");
  477. }
  478. else
  479. {
  480. format(string, sizeof(string), "AdmCmd: %s was muted from speaking in /newb by %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  481. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  482. format(string, sizeof(string), "You were just muted from the newbie chat channel (/newb) by %s.", GetPlayerNameEx(playerid));
  483. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, string);
  484. }
  485. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, "Remember, the newbie chat channel is only for script/server related questions and may not be used for any other purpose, unless stated otherwise by an admin.");
  486. SendClientMessageEx(giveplayerid, COLOR_LIGHTRED, "If you wish to be unmuted, you will be fined or jailed. Future abuse could result in increased punishment. If you feel this was in error, contact a senior administrator.");
  487. format(string, sizeof(string), "AdmCmd: %s was just muted from using Newbie Chat [/newb] due to misuse.", GetPlayerNameEx(giveplayerid));
  488. SendClientMessageToAllEx(COLOR_LIGHTRED, string);
  489. }
  490. else
  491. {
  492. if(PlayerInfo[playerid][pAdmin] >= 2)
  493. {
  494. ShowNMuteFine(giveplayerid);
  495. format(string, sizeof(string), "You offered %s an unmute from /newb.", GetPlayerNameEx(giveplayerid));
  496. SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
  497. }
  498. else
  499. {
  500. SendClientMessageEx(playerid, COLOR_GRAD1, "That person is currently muted. You are unable to unmute players from the newbie chat as a Advisor.");
  501. }
  502. }
  503. }
  504. }
  505. else
  506. {
  507. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  508. }
  509. return 1;
  510. }
  511. CMD:makeadvisor(playerid, params[])
  512. {
  513. if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pPR] > 0 || PlayerInfo[playerid][pHelper] >= 3)
  514. {
  515. new string[128], giveplayerid, level;
  516. if(sscanf(params, "ud", giveplayerid, level)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /makeadvisor [player] [level(1-4)]");
  517. if(IsPlayerConnected(giveplayerid))
  518. {
  519. if(PlayerInfo[giveplayerid][pAdmin] > 1)
  520. {
  521. SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot make admins Advisors!");
  522. return 1;
  523. }
  524. if(PlayerInfo[playerid][pHelper] == 3 && level > 1) return SendClientMessageEx(playerid, COLOR_GREY, "You can only promote players to Helper!");
  525. if(PlayerInfo[playerid][pHelper] == 4 && level > 2) return SendClientMessageEx(playerid, COLOR_GREY, "You can only promote players to Helper/Community Advisor!");
  526. if(PlayerInfo[giveplayerid][pHelper] < level && PlayerInfo[giveplayerid][pHelper] >= PlayerInfo[playerid][pHelper] > 2) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot set someone's rank when they're the same as you!");
  527. if(PlayerInfo[giveplayerid][pStaffBanned] >= 1) return SendClientMessage(playerid, COLOR_WHITE, "That player is currently staff banned.");
  528. PlayerInfo[giveplayerid][pHelper] = level;
  529. switch(level)
  530. {
  531. case 1:
  532. {
  533. format(string, sizeof(string), "You have been made a Helper by %s", GetPlayerNameEx(playerid));
  534. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  535. format(string, sizeof(string), "You have given Helper to %s", GetPlayerNameEx(giveplayerid));
  536. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  537. format(string, sizeof(string), "%s(%d) has been made a Helper by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  538. Log("logs/admin.log", string);
  539. }
  540. case 2:
  541. {
  542. format(string, sizeof(string), "You have been made a Community Advisor by %s", GetPlayerNameEx(playerid));
  543. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  544. format(string, sizeof(string), "You have given Community Advisor to %s", GetPlayerNameEx(giveplayerid));
  545. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  546. format(string, sizeof(string), "%s(%d) has been made a Community Advisor by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  547. Log("logs/admin.log", string);
  548. }
  549. case 3:
  550. {
  551. format(string, sizeof(string), "You have been promoted to Senior Advisor by %s", GetPlayerNameEx(playerid));
  552. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  553. format(string, sizeof(string), "You have promoted %s to Senior Advisor", GetPlayerNameEx(giveplayerid));
  554. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  555. format(string, sizeof(string), "%s(%d) has been made a Senior Advisor by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  556. Log("logs/admin.log", string);
  557. }
  558. case 4:
  559. {
  560. format(string, sizeof(string), "You have been promoted to Chief Advisor by %s", GetPlayerNameEx(playerid));
  561. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  562. format(string, sizeof(string), "You have promoted %s to Chief Advisor", GetPlayerNameEx(giveplayerid));
  563. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  564. format(string, sizeof(string), "%s(%d) has been made a Chief Advisor by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  565. Log("logs/admin.log", string);
  566. }
  567. }
  568. }
  569. }
  570. else
  571. {
  572. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  573. }
  574. return 1;
  575. }
  576. CMD:takeadvisor(playerid, params[])
  577. {
  578. if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pHelper] >= 3 || PlayerInfo[playerid][pPR] > 0)
  579. {
  580. new string[128], giveplayerid;
  581. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /takeadvisor [player]");
  582. if(IsPlayerConnected(giveplayerid))
  583. {
  584. if(PlayerInfo[playerid][pHelper] == 3 && PlayerInfo[giveplayerid][pHelper] != 1) {
  585. SendClientMessageEx(playerid, COLOR_GREY, "You can only remove helpers.");
  586. return 1;
  587. }
  588. if(PlayerInfo[giveplayerid][pHelper] != 0)
  589. {
  590. if(GetPVarType(playerid, "AdvisorDuty"))
  591. {
  592. DeletePVar(playerid, "AdvisorDuty");
  593. Advisors -= 1;
  594. }
  595. PlayerInfo[giveplayerid][pHelper] = 0;
  596. format(string, sizeof(string), "%s has kicked you out from the Advisor team.", GetPlayerNameEx(playerid));
  597. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  598. format(string, sizeof(string), "You took %s's Advisor rank.", GetPlayerNameEx(giveplayerid));
  599. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  600. format(string, sizeof(string), "%s(%d) has had their advisor removed by %s(%d)", GetPlayerNameEx(giveplayerid), PlayerInfo[giveplayerid][pId], GetPlayerNameEx(playerid), PlayerInfo[playerid][pId]);
  601. Log("logs/admin.log", string);
  602. }
  603. }
  604. }
  605. else
  606. {
  607. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  608. }
  609. return 1;
  610. }
  611. CMD:requesthelp(playerid, params[])
  612. {
  613. if(Advisors < 1)
  614. {
  615. SendClientMessageEx(playerid, COLOR_GREY, " There are no Advisors On Duty at the moment, try again later!");
  616. return 1;
  617. }
  618. if(isnull(params))
  619. {
  620. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /requesthelp [reason]");
  621. return 1;
  622. }
  623. new string[128];
  624. if(PlayerInfo[playerid][pRHMutes] >= 4 || PlayerInfo[playerid][pRHMuteTime] > 0)
  625. {
  626. SendClientMessageEx(playerid, COLOR_GREY, "You are currently banned from requesting help.");
  627. return 1;
  628. }
  629. if(JustReported[playerid] > 0)
  630. {
  631. SendClientMessageEx(playerid, COLOR_GREY, "Wait 10 seconds after sending a next request!");
  632. return 1;
  633. }
  634. JustReported[playerid]=10;
  635. format(string, sizeof(string), "** %s (%i) is requesting help, reason: %s. (type /accepthelp %i)", GetPlayerNameEx(playerid), playerid, params, playerid);
  636. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  637. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have requested help from a Advisor, wait for a reply.");
  638. SetPVarInt( playerid, "COMMUNITY_ADVISOR_REQUEST", 1 );
  639. SetPVarInt( playerid, "HelpTime", 5);
  640. SetPVarString( playerid, "HelpReason", params);
  641. SetTimerEx( "HelpTimer", 60000, 0, "d", playerid);
  642. return 1;
  643. }
  644. CMD:showrequests(playerid, params[])
  645. {
  646. if(PlayerInfo[playerid][pHelper] >= 2 || PlayerInfo[playerid][pPR] || PlayerInfo[playerid][pAdmin] >= 2)
  647. {
  648. new string[128], reason[64];
  649. SendClientMessageEx(playerid, COLOR_GREEN, "____________________ HELP REQUESTS _____________________");
  650. foreach(new i: Player)
  651. {
  652. if(GetPVarInt(i, "COMMUNITY_ADVISOR_REQUEST"))
  653. {
  654. GetPVarString(i, "HelpReason", reason, 64);
  655. format(string, sizeof(string), "%s | ID: %i | Reason: %s | Expires in: %i minutes.", GetPlayerNameEx(i), i, reason, GetPVarInt(i, "HelpTime"));
  656. SendClientMessageEx(playerid, COLOR_REPORT, string);
  657. }
  658. }
  659. SendClientMessageEx(playerid, COLOR_GREEN, "_________________________________________________________");
  660. }
  661. return 1;
  662. }
  663. CMD:rhmute(playerid, params[])
  664. {
  665. if (PlayerInfo[playerid][pHelper] >= 2)
  666. {
  667. new string[128], giveplayerid;
  668. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /rhmute [player]");
  669. if(IsPlayerConnected(giveplayerid))
  670. {
  671. if(PlayerInfo[giveplayerid][pRHMuteTime] == 0)
  672. {
  673. if(PlayerInfo[giveplayerid][pRHMutes] == 0)
  674. {
  675. PlayerInfo[giveplayerid][pRHMutes] = 1;
  676. format(string, sizeof(string), "*** %s has given %s their first warning about help request abuse", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  677. SendAdvisorMessage(COLOR_COMBINEDCHAT, string);
  678. ShowPlayerDialogEx(giveplayerid, 7954, DIALOG_STYLE_MSGBOX, "Help request abuse warning", "A Advisor has warned you not to abuse /requesthelp.\n\nNote that future abuse of /requesthelp could result in a mute from /requesthelp or loss of that privilege altogether.", "Next", "");
  679. format(string, sizeof(string), "AdmCmd: %s(%d) has given %s(%d) their first warning about help request abuse", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid));
  680. Log("logs/mute.log", string);
  681. }
  682. else if(PlayerInfo[giveplayerid][pRHMutes] == 1)
  683. {
  684. PlayerInfo[giveplayerid][pRHMutes] = 2;
  685. PlayerInfo[giveplayerid][pRHMuteTime] = 30*60;
  686. format(string, sizeof(string), "*** %s has temporarily blocked %s from using /requesthelp", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  687. SendAdvisorMessage(COLOR_COMBINEDCHAT, string);
  688. ShowPlayerDialogEx(giveplayerid, 7954, DIALOG_STYLE_MSGBOX, "Temporarily blocked from /requesthelp", "You have been temporarily blocked from using /requesthelp\n\nAs this is the first time you have been blocked from requesting help, you will not be able to use /requesthelp for 30 minutes.\n\nTwo more mute will result in a total loss in privilege of the command.", "Next", "");
  689. format(string, sizeof(string), "AdmCmd: %s(d) was temporarily blocked from /requesthelp by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  690. Log("logs/mute.log", string);
  691. }
  692. else if(PlayerInfo[giveplayerid][pRHMutes] == 2)
  693. {
  694. PlayerInfo[giveplayerid][pRHMutes] = 3;
  695. PlayerInfo[giveplayerid][pRHMuteTime] = 90*60;
  696. format(string, sizeof(string), "*** %s has temporarily blocked %s from using /requesthelp", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  697. SendAdvisorMessage(COLOR_COMBINEDCHAT, string);
  698. ShowPlayerDialogEx(giveplayerid, 7954, DIALOG_STYLE_MSGBOX, "Temporarily blocked from /requesthelp", "You have been temporarily blocked from using /requesthelp\n\nAs this is the second time you have been blocked from requesting help, you will not be able to use /requesthelp for 1 hour and 30 minutes.\n\nOne more mute will result in a total loss in privilege of the command.", "Next", "");
  699. format(string, sizeof(string), "AdmCmd: %s(%d) was temporarily blocked from /requesthelp by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  700. Log("logs/mute.log", string);
  701. }
  702. else if(PlayerInfo[giveplayerid][pRHMutes] == 3)
  703. {
  704. PlayerInfo[giveplayerid][pRHMutes] = 4;
  705. format(string, sizeof(string), "*** %s has permanently blocked %s from using /requesthelp", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  706. SendAdvisorMessage(COLOR_COMBINEDCHAT, string);
  707. ShowPlayerDialogEx(giveplayerid,7954,DIALOG_STYLE_MSGBOX, "Permanently blocked from /requesthelp", "You have been permanently blocked from using /requesthelp.\n\nYou will need to contact an Administrator via /report to appeal this.", "Next", "");
  708. format(string, sizeof(string), "AdmCmd: %s(%d) was permanently blocked from /requesthelp by %s(%d)", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid));
  709. Log("logs/mute.log", string);
  710. }
  711. DeletePVar(giveplayerid, "COMMUNITY_ADVISOR_REQUEST");
  712. }
  713. else
  714. {
  715. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is already disabled from /requesthelp.");
  716. }
  717. }
  718. else return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  719. }
  720. else
  721. {
  722. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  723. }
  724. return 1;
  725. }
  726. CMD:rhmutereset(playerid, params[])
  727. {
  728. if (PlayerInfo[playerid][pHelper] >= 2)
  729. {
  730. new string[128], giveplayerid, reason[64];
  731. if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /rhmutereset [player] [reason]");
  732. if(IsPlayerConnected(giveplayerid))
  733. {
  734. if(PlayerInfo[giveplayerid][pRHMutes] >= 2)
  735. {
  736. PlayerInfo[giveplayerid][pRHMutes]--;
  737. PlayerInfo[giveplayerid][pRHMuteTime] = 0;
  738. format(string, sizeof(string), "*** %s has unblocked %s from requesting help, reason: %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), reason);
  739. SendAdvisorMessage(COLOR_COMBINEDCHAT, string);
  740. SendClientMessageEx(giveplayerid, COLOR_GRAD2, "You have been unblocked from requesting help. You may now use the help request system again.");
  741. SendClientMessageEx(giveplayerid, COLOR_GRAD2, "Please accept our apologies for any error and inconvenience this may have caused.");
  742. format(string, sizeof(string), "AdmCmd: %s(%d) was unblocked from /requesthelp by %s(%d), reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerSQLId(giveplayerid), GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), reason);
  743. Log("logs/mute.log", string);
  744. }
  745. else
  746. {
  747. SendClientMessageEx(playerid, COLOR_GRAD1, "That person is not blocked from requesting help!");
  748. }
  749. }
  750. }
  751. else
  752. {
  753. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  754. }
  755. return 1;
  756. }
  757. CMD:findnewb(playerid, params[]) {
  758. if(PlayerInfo[playerid][pHelper] < 2) {
  759. SendClientMessageEx(playerid, COLOR_GREY, "You are not a Advisor.");
  760. }
  761. else if(GetPVarInt(playerid, "AdvisorDuty") == 0) {
  762. SendClientMessageEx(playerid, COLOR_GREY, "You are not on duty as a Advisor.");
  763. }
  764. else {
  765. new Float: Pos[3][2], i[2], vw[2];
  766. if(!GetPVarType(playerid, "HelpingSomeone")) {
  767. foreach(new x: Player) {
  768. if(PlayerInfo[x][pLevel] == 1 && PlayerInfo[x][pHelpedBefore] == 0 && PlayerInfo[x][pAdmin] == 0 && PlayerInfo[x][pId] != PlayerInfo[playerid][pId]) {
  769. GetPlayerPos(x, Pos[0][0], Pos[1][0], Pos[2][0]);
  770. GetPlayerPos(playerid, Pos[0][1], Pos[1][1], Pos[2][1]);
  771. vw[0] = GetPlayerVirtualWorld(x);
  772. i[0] = GetPlayerInterior(x);
  773. vw[1] = GetPlayerVirtualWorld(playerid);
  774. i[1] = GetPlayerInterior(playerid);
  775. SetPVarFloat(playerid, "AdvisorLastx", Pos[0][1]);
  776. SetPVarFloat(playerid, "AdvisorLasty", Pos[1][1]);
  777. SetPVarFloat(playerid, "AdvisorLastz", Pos[2][1]);
  778. SetPVarInt(playerid, "AdvisorLastInt", i[1]);
  779. SetPVarInt(playerid, "AdvisorLastVW", vw[1]);
  780. SetPlayerVirtualWorld(playerid, vw[0]);
  781. SetPlayerInterior(playerid, i[0]);
  782. SetPlayerPos(playerid, Pos[0][0], Pos[1][0]+2, Pos[2][0]);
  783. PlayerInfo[x][pHelpedBefore] = 1;
  784. SetPVarInt(playerid, "HelpingSomeone", 1);
  785. SetPlayerHealth(playerid, 999999);
  786. ShowPlayerDialogEx(x, 0, DIALOG_STYLE_MSGBOX, "Advisor Alert", "A Advisor has just teleported to you. Feel free to ask him anything related to Next Generation Gaming that you may have issues/concerns with.", "Close", "");
  787. if(i[0] > 0 || vw[0] > 0) Player_StreamPrep(playerid, Pos[0][0], Pos[1][0], Pos[2][0], FREEZE_TIME);
  788. format(szMiscArray, sizeof(szMiscArray), "You have been teleported to newbie %s, retype the command to be teleported back.", GetPlayerNameEx(x));
  789. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  790. break;
  791. }
  792. }
  793. }
  794. else
  795. {
  796. DeletePVar(playerid, "HelpingSomeone");
  797. SetHealth(playerid, 100);
  798. SetPlayerPos(playerid, GetPVarFloat(playerid, "AdvisorLastx"), GetPVarFloat(playerid, "AdvisorLasty"), GetPVarFloat(playerid, "AdvisorLastz"));
  799. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "AdvisorLastVW"));
  800. SetPlayerInterior(playerid, GetPVarInt(playerid, "AdvisorLastInt"));
  801. if(GetPVarInt(playerid, "AdvisorLastInt") > 0 || GetPVarInt(playerid, "AdvisorLastVW") > 0) Player_StreamPrep(playerid, GetPVarFloat(playerid, "AdvisorLastx"), GetPVarFloat(playerid, "AdvisorLasty"), GetPVarFloat(playerid, "AdvisorLastz"), FREEZE_TIME);
  802. SendClientMessageEx(playerid, COLOR_WHITE, "You have been teleported back to your previous location.");
  803. }
  804. }
  805. return 1;
  806. }
  807. CMD:accepthelp(playerid, params[])
  808. {
  809. if(PlayerInfo[playerid][pHelper] < 2) {
  810. SendClientMessageEx(playerid, COLOR_GREY, "You are not a Advisor.");
  811. }
  812. else if(HelpingNewbie[playerid] != INVALID_PLAYER_ID) {
  813. SendClientMessageEx(playerid, COLOR_GREY, "You are already helping someone.");
  814. }
  815. else if(GetPVarInt(playerid, "AdvisorDuty") == 0) {
  816. SendClientMessageEx(playerid, COLOR_GREY, "You are not on duty as a Advisor.");
  817. }
  818. else {
  819. new Player, string[128], Float:health, Float:armor;
  820. if(sscanf(params, "u", Player)) {
  821. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /accepthelp [PlayerID]");
  822. }
  823. else if(Player == playerid) {
  824. SendClientMessageEx(playerid, COLOR_GREY, "You can't accept a help request from yourself.");
  825. }
  826. else if(!IsPlayerConnected(Player)) {
  827. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  828. }
  829. else if(GetPVarInt(Player, "COMMUNITY_ADVISOR_REQUEST") == 0) {
  830. SendClientMessageEx(playerid, COLOR_GREY, "That person doesn't need help.");
  831. }
  832. else {
  833. format(string, sizeof(string), "* %s has accepted the help request from %s.",GetPlayerNameEx(playerid), GetPlayerNameEx(Player));
  834. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  835. format(string, sizeof(string), "* You have accepted %s's help request, once you are done type /finishhelp to get back to your position.",GetPlayerNameEx(Player));
  836. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  837. format(string, sizeof(string), "* Advisor %s has accepted your help request.",GetPlayerNameEx(playerid));
  838. SendClientMessageEx(Player, COLOR_LIGHTBLUE, string);
  839. PlayerInfo[playerid][pAcceptedHelp]++;
  840. ReportCount[playerid]++;
  841. ReportHourCount[playerid]++;
  842. new Float: x, Float: y, Float: z, Float: r, i, vw;
  843. vw = GetPlayerVirtualWorld(playerid);
  844. i = GetPlayerInterior(playerid);
  845. GetPlayerPos(playerid, x, y, z);
  846. GetPlayerFacingAngle(playerid, r);
  847. SetPVarFloat(playerid, "AdvisorLastx", x);
  848. SetPVarFloat(playerid, "AdvisorLasty", y);
  849. SetPVarFloat(playerid, "AdvisorLastz", z);
  850. SetPVarFloat(playerid, "AdvisorLastr", r);
  851. SetPVarInt(playerid, "AdvisorLastInt", i);
  852. SetPVarInt(playerid, "AdvisorLastVW", vw);
  853. GetPlayerPos(Player, x, y, z);
  854. vw = GetPlayerVirtualWorld(Player);
  855. i = GetPlayerInterior(Player);
  856. SetPlayerPos(playerid, x, y+2, z+0.75);
  857. SetPlayerVirtualWorld(playerid, vw);
  858. SetPlayerInterior(playerid, i);
  859. GetHealth(playerid,health);
  860. SetPVarFloat(playerid, "pPreGodHealth", health);
  861. GetArmour(playerid,armor);
  862. SetPVarFloat(playerid, "pPreGodArmor", armor);
  863. SetHealth(playerid, 0x7FB00000);
  864. SetArmour(playerid, 0x7FB00000);
  865. SetPVarInt(playerid, "pGodMode", 1);
  866. if(i > 0 || vw > 0) Player_StreamPrep(playerid, x, y, z, 6000);
  867. HelpingNewbie[playerid] = Player;
  868. AddCAReportToken(playerid); // Advisor Tokens
  869. DeletePVar(Player, "COMMUNITY_ADVISOR_REQUEST");
  870. DeletePVar(Player, "HelpTime");
  871. return 1;
  872. }
  873. }
  874. return 1;
  875. }
  876. CMD:finishhelp(playerid, params[])
  877. {
  878. if(HelpingNewbie[playerid] != INVALID_PLAYER_ID)
  879. {
  880. new string[128], Float:health, Float:armor;
  881. format(string, sizeof(string), "* %s has finished the help request from %s.",GetPlayerNameEx(playerid), GetPlayerNameEx(HelpingNewbie[playerid]));
  882. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  883. SetPlayerPos(playerid, GetPVarFloat(playerid, "AdvisorLastx"), GetPVarFloat(playerid, "AdvisorLasty"), GetPVarFloat(playerid, "AdvisorLastz"));
  884. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "AdvisorLastVW"));
  885. SetPlayerInterior(playerid, GetPVarInt(playerid, "AdvisorLastInt"));
  886. DeletePVar(playerid, "pGodMode");
  887. health = GetPVarFloat(playerid, "pPreGodHealth");
  888. SetHealth(playerid,health);
  889. armor = GetPVarFloat(playerid, "pPreGodArmor");
  890. if(armor > 0) {
  891. SetArmour(playerid,armor);
  892. }
  893. else
  894. {
  895. RemoveArmor(playerid);
  896. }
  897. DeletePVar(playerid, "pPreGodHealth");
  898. DeletePVar(playerid, "pPreGodArmor");
  899. if(GetPVarType(playerid, "BusinessesID")) DeletePVar(playerid, "BusinessesID");
  900. if(GetPVarInt(playerid, "AdvisorLastInt") > 0 || GetPVarInt(playerid, "AdvisorLastVW") > 0) Player_StreamPrep(playerid, GetPVarFloat(playerid, "AdvisorLastx"), GetPVarFloat(playerid, "AdvisorLasty"), GetPVarFloat(playerid, "AdvisorLastz"), FREEZE_TIME);
  901. HelpingNewbie[playerid] = INVALID_PLAYER_ID;
  902. return 1;
  903. }
  904. else
  905. {
  906. SendClientMessageEx(playerid, COLOR_GREY, " You're not helping anyone!");
  907. return 1;
  908. }
  909. }
  910. CMD:togca(playerid, params[])
  911. {
  912. if(PlayerInfo[playerid][pHelper] < 2 && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  913. if(GetPVarInt(playerid, "CAChat") == 1)
  914. {
  915. PlayerInfo[playerid][pToggledChats][16] = 1;
  916. SendClientMessageEx(playerid, COLOR_GRAD1, "** You have disabled Advisor chat.");
  917. return SetPVarInt(playerid, "CAChat", 0);
  918. }
  919. else
  920. {
  921. PlayerInfo[playerid][pToggledChats][16] = 0;
  922. SendClientMessageEx(playerid, COLOR_GRAD1, "** You have enabled Advisor chat.");
  923. return SetPVarInt(playerid, "CAChat", 1);
  924. }
  925. }
  926. CMD:ca(playerid, params[])
  927. {
  928. if(PlayerInfo[playerid][pJailTime] && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessageEx(playerid, COLOR_GREY, "OOC prisoners are restricted to only speak in /b");
  929. if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're not authorized to use this command!");
  930. if(PlayerInfo[playerid][pToggledChats][16] == 1) return SendClientMessageEx(playerid, COLOR_GREY, "You have Advisor chat disabled - /tog advisor or /settings to enable it.");
  931. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /ca [text]");
  932. if(strlen(params) >= 128) return SendClientMessageEx(playerid, COLOR_GREY, "Your input was too long. ");
  933. szMiscArray[0] = 0;
  934. format(szMiscArray, sizeof(szMiscArray), "- %s %s: %s", GetStaffRank(playerid), GetPlayerNameEx(playerid), params);
  935. foreach(new i : Player)
  936. {
  937. if((PlayerInfo[i][pHelper] >= 1 || PlayerInfo[i][pAdmin] >= 2) && !PlayerInfo[playerid][pToggledChats][16])
  938. {
  939. ChatTrafficProcess(i, 0x5288f3FF, szMiscArray, 16);
  940. }
  941. }
  942. return 1;
  943. }