NTNGuyenthanh

System Newbie Rgame

Aug 22nd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.94 KB | None | 0 0
  1. new Helpers = 0;
  2.  
  3.  
  4. CMD:xemtatcacauhoi(playerid, params[])
  5. {
  6. if(GetPVarInt(playerid, "HelperDuty") == 0)
  7. {
  8. SendClientMessageEx(playerid, COLOR_GREY, "Ban dang offduty Helpers, khong the lam viec nay!");
  9. }
  10. else if(PlayerInfo[playerid][pHelper] >= 1)
  11. {
  12. new string[128], reason[64];
  13. SendClientMessageEx(playerid, COLOR_GREEN, "____________CAU HOI____________");
  14. foreach(new i: Player)
  15. {
  16. if(GetPVarInt(i, "HELPERS_REQUEST"))
  17. {
  18. GetPVarString(i, "CauHoi", reason, 64);
  19. format(string, sizeof(string), "%s(%i) | Thoi gian cau hoi: %i Phut(/xemcauhoi %i).", GetPlayerNameEx(i), i, GetPVarInt(i, "ThoiGian"), i);
  20. SendClientMessageEx(playerid, COLOR_REPORT, string);
  21. }
  22. else
  23. {
  24. SendClientMessageEx(playerid, COLOR_REPORT, "Hien tai chua co cau hoi nao dua ra.");
  25. }
  26. }
  27. }
  28. return 1;
  29. }
  30. CMD:xemcauhoi(playerid, params[])
  31. {
  32. if(GetPVarInt(playerid, "HelperDuty") == 0)
  33. {
  34. SendClientMessageEx(playerid, COLOR_GREY, "Ban dang offduty Helpers, khong the lam viec nay!");
  35. }
  36. else if(PlayerInfo[playerid][pHelper] >= 1)
  37. {
  38. if(sscanf(params, "u", params[0])) return SendClientMessageEx(playerid, COLOR_GREY, "Su dung: /xemcauhoi [playerid]");
  39. {
  40. if(GetPVarInt(params[0], "YeuCau") == 0)
  41. {
  42. SendClientMessageEx(playerid, COLOR_GREY, "Nguoi do chua dua ra cau hoi.");
  43. }
  44. else
  45. {
  46. foreach(new i: Player)
  47. {
  48. new reason[128];
  49. if(GetPVarInt(i, "HELPERS_REQUEST"))
  50. {
  51. GetPVarString(i, "CauHoi", reason, 128);
  52. new str[2460], str1[1280], str2[1280], str3[1280], str4[1280], name[1280];
  53. format(str1, sizeof(str), "{FFFFFF}ID: %s", GetPlayerNameEx(params[0]));
  54. format(str2, sizeof(str), "Cau hoi: \n%s",reason);
  55. format(str3, sizeof(str), "Thoi gian cau hoi: %i phut", GetPVarInt(i, "ThoiGian"));
  56. format(str4, sizeof(str), "{FFFF00}Su dung lenh /dap [playerid][noi dung]");
  57. format(str, sizeof(str), "%s\n\n%s\n\n%s\n%s\n", str1,str2,str3,str4);
  58. format(name, sizeof(name), "Xem cau hoi - %s", GetPlayerNameEx(params[0]));
  59. ShowPlayerDialog(playerid, DIALOG_NOTHING, DIALOG_STYLE_MSGBOX, name, str, "Ok", "");
  60. }
  61. }
  62. }
  63. }
  64. }
  65. return 1;
  66. }
  67. CMD:huybocauhoi(playerid, params[])
  68. {
  69. new stringcac[128];
  70. if(!gPlayerLogged{playerid})
  71. {
  72. SendClientMessageEx(playerid, COLOR_GREY, "Ban chua dang nhap.");
  73. }
  74. else if(GetPVarInt(playerid, "YeuCau") == 0)
  75. {
  76. SendClientMessageEx(playerid, COLOR_GREY, "Ban khong co cau hoi nao de huy bo.");
  77. }
  78. else
  79. {
  80. DeletePVar(playerid,"CauHoi");
  81. DeletePVar(playerid,"YeuCau");
  82. SendClientMessageEx(playerid, COLOR_WHITE,"Ban da huy bo cau hoi cua ban.");
  83. format(stringcac, sizeof(stringcac), "%s da huy bo cau hoi cua chinh minh.",GetPlayerNameEx(playerid));
  84. //SendDutyHelperMessage(TEAM_AZTECAS_COLOR, string);
  85. foreach(new i: Player)
  86. {
  87. if(PlayerInfo[i][pHelper] >=1)
  88. {
  89. SendClientMessage(i, COLOR_YELLOW, stringcac);
  90. }
  91. }
  92. }
  93. return 1;
  94. }
  95. CMD:dap(playerid, params[])
  96. {
  97. if(PlayerInfo[playerid][pHelper] < 1)
  98. {
  99. SendClientMessageEx(playerid, COLOR_GREY, "Ban khong phai la Helpers.");
  100. }
  101. else if(GetPVarInt(playerid, "HelperDuty") == 0) {
  102. SendClientMessageEx(playerid, COLOR_GREY, "Ban dang offduty Helpers, khong the lam viec nay!");
  103. }
  104. else
  105. {
  106.  
  107. new Player,
  108. reason[64],
  109. stringg[128];
  110.  
  111. if(sscanf(params, "us[64]", Player, reason))
  112. {
  113. SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /dap [playerid] [text]");
  114. }
  115. else if(Player == playerid)
  116. {
  117. SendClientMessageEx(playerid, COLOR_GREY, "Ban khong the chap nhan cau hoi tu chinh minh.");
  118. }
  119. else if(GetPVarInt(Player, "YeuCau") == 0)
  120. {
  121. SendClientMessageEx(playerid, COLOR_GREY, "Nguoi do chua dua ra cau hoi.");
  122. }
  123. else
  124. {
  125. format(stringg, sizeof(stringg), "%s da tra loi cau hoi cua %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(Player));
  126. //SendDutyHelperMessage(TEAM_AZTECAS_COLOR, string);
  127. foreach(new i: Player)
  128. {
  129. if(PlayerInfo[i][pHelper] >=1)
  130. {
  131. SendClientMessage(i, COLOR_NEWBIE, stringg);
  132. }
  133. }
  134.  
  135. format(stringg, sizeof(stringg), "[%s] da chap nhan cau hoi cua ban.",GetPlayerNameEx(playerid));
  136. SendClientMessageEx(Player, COLOR_GREEN, stringg);
  137. new stringdi[128];
  138. new stringme[128];
  139. GetPVarString(Player, "CauHoi", stringdi, 128);
  140. if (gNewbie[playerid]==0)
  141. {
  142. format(stringdi, sizeof(stringdi),"%s hoi: %s",GetPlayerNameEx(Player), stringdi);
  143. SendClientMessageToAll(COLOR_NEWBIE, stringdi);
  144. format(stringme, sizeof(stringme),"[%s] tra loi: %s",GetPlayerNameEx(playerid), reason);
  145. SendClientMessageToAll(COLOR_NEWBIE, stringme);
  146. ReportCount[playerid]++;
  147. ReportHourCount[playerid]++;
  148. AddCAReportToken(playerid);
  149. DeletePVar(Player,"CauHoi");
  150. DeletePVar(Player,"YeuCau");
  151. }
  152. return 1;
  153. }
  154. }
  155. return 1;
  156. }
  157. new LastMessage[MAX_PLAYERS];
  158. CMD:newb(playerid, params[])
  159. {
  160. if((GetTickCount() - LastMessage[playerid]) < 60000)
  161. return SendClientMessage(playerid, COLOR_GREY, "Phai Doi 60 Giay Sau Moi Hoi Tiep.");
  162. new stringloz[128];
  163. if(isnull(params))
  164. {
  165. SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /newb [noi dung]");
  166. return 1;
  167. }
  168. if(Helpers < 1)
  169. {
  170. SendClientMessageEx(playerid, COLOR_GREY, "Hien tai chua co Helpers nao Onduty, vui long cho!");
  171. return 1;
  172. }
  173. if(PlayerInfo[playerid][pHelper] == 1)
  174. {
  175. SendClientMessageEx(playerid, COLOR_RED, "Ban la Helper khong the su dung lenh nay de tranh spam!");
  176. return 1;
  177. }
  178. if(PlayerInfo[playerid][pHelper] >= 2)
  179. {
  180. SendClientMessageEx(playerid, COLOR_RED, "Ban la Advisors khong the su dung lenh nay de tranh spam!");
  181. return 1;
  182. }
  183. if(PlayerInfo[playerid][pAdmin] >= 1)
  184. {
  185. SendClientMessageEx(playerid, COLOR_RED, "Ban la Admin khong the su dung lenh nay de tranh spam!");
  186. return 1;
  187. }
  188. if(GetPVarInt(playerid, "YeuCau") == 1)
  189. {
  190. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban da gui cau hoi cua ban len kenh newb, vui long doi ho tra loi.");
  191. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Neu ban doi qua lau hay su dung lenh(/huybocauhoi).");
  192. }
  193. if(gNewbie[playerid]==1)
  194. {
  195. SendClientMessageEx(playerid, COLOR_GREY, "Ban da bi vo hieu hoa kenh chat Newbie, /tognewbie de hoat dong tro lai!");
  196. return 1;
  197. }
  198. if ((nonewbie))
  199. {
  200. SendClientMessageEx(playerid, COLOR_GRAD2, "Kenh newbie da bi vo hieu hoa boi {FF0000}Admin{BFC0C2}");
  201. return 1;
  202. }
  203. format(stringloz, sizeof(stringloz),"%s da dat ra mot cau hoi, su dung (/xemcauhoi %i).", GetPlayerNameEx(playerid), playerid);
  204. // SendDutyHelperMessage(TEAM_AZTECAS_COLOR, string);
  205. foreach(new i: Player)
  206. {
  207. if(PlayerInfo[i][pHelper] >=1)
  208. {
  209. SendClientMessage(i, COLOR_NEWBIE, stringloz);
  210. }
  211. }
  212. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban da gui cau hoi cua ban len kenh newb, vui long doi ho tra loi.");
  213. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Neu ban doi qua lau hay su dung lenh(/huybocauhoi).");
  214. SetPVarInt(playerid, "HELPERS_REQUEST", 1);
  215. SetPVarInt(playerid, "ThoiGian", 3);
  216. SetTimerEx("ThoiGianNgung", 30000, 0, "d", playerid);
  217. SetPVarInt(playerid, "YeuCau", 1);
  218. SetPVarString(playerid, "CauHoi", params);
  219. return 1;
  220. }
  221. CMD:hduty(playerid, params[])
  222. {
  223. if(PlayerInfo[playerid][pHelper] >= 1)
  224. {
  225. if(GetPVarInt(playerid, "HelperDuty") == 1)
  226. {
  227. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban da Offduty Helpers, ban khong nhan duoc mot cau hoi nao nua.");
  228. DeletePVar(playerid, "HelperDuty");
  229. Helpers -= 1;
  230. }
  231. else
  232. {
  233. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban da Onduty Helpers, bay gio ban co the nhan cau hoi tu members.");
  234. SetPVarInt(playerid, "HelperDuty", 1);
  235. Helpers += 1;
  236. }
  237. }
  238. else
  239. {
  240. SendClientMessageEx(playerid, COLOR_GRAD1, "Ban khong phai la Helpers");
  241. }
  242. return 1;
  243. }
Advertisement
Add Comment
Please, Sign In to add comment