Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | None | 0 0
  1. CMD:requesthelp(playerid, params[])
  2. {
  3. if(Advisors < 1)
  4. {
  5. SendClientMessageEx(playerid, COLOR_GREY, " There are no Community Advisors On Duty at the moment, try again later!");
  6. return 1;
  7. }
  8. if(isnull(params))
  9. {
  10. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /requesthelp [reason]");
  11. return 1;
  12. }
  13.  
  14. new string[128];
  15. if(PlayerInfo[playerid][pLevel] < 4)
  16. {
  17. if(JustReported[playerid] > 0)
  18. {
  19. SendClientMessageEx(playerid, COLOR_GREY, "Wait 10 seconds after sending a next request!");
  20. return 1;
  21. }
  22. JustReported[playerid]=10;
  23. format(string, sizeof(string), "** %s is requesting help, reason: %s. (type /accepthelp)", GetPlayerNameEx(playerid), params);
  24. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  25. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have requested help from a Community Advisor, wait for a reply.");
  26. SetPVarInt(playerid, "COMMUNITY_ADVISOR_REQUEST", 1);
  27. }
  28. else
  29. {
  30. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a newbie!");
  31. }
  32. return 1;
  33. }
  34.  
  35. CMD:accepthelp(playerid, params[])
  36. {
  37. foreach(Player, i)
  38. {
  39. if(GetPVarInt(i, "COMMUNITY_ADVISOR_REQUEST") >= 1)
  40. {
  41. AdvisorCall = i;
  42. }
  43. }
  44. if(AdvisorCall < 999)
  45. {
  46. if(IsPlayerConnected(AdvisorCall))
  47. {
  48. new string[128];
  49. if(HelpingNewbie[playerid] != 999)
  50. {
  51. SendClientMessageEx(playerid, COLOR_GRAD2, " You are already helping someone.");
  52. return 1;
  53. }
  54. if(GetPVarInt(playerid, "AdvisorDuty") == 0)
  55. {
  56. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not on duty as a community advisor.");
  57. return 1;
  58. }
  59. format(string, sizeof(string), "* %s has accepted the help request from %s.",GetPlayerNameEx(playerid), GetPlayerNameEx(AdvisorCall));
  60. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  61. format(string, sizeof(string), "* You have accepted %s's help request, once you are done type /finishhelp to get back to your position.",GetPlayerNameEx(AdvisorCall));
  62. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  63. format(string, sizeof(string), "* Advisor %s has accepted your help request.",GetPlayerNameEx(playerid));
  64. SendClientMessageEx(AdvisorCall, COLOR_LIGHTBLUE, string);
  65. PlayerInfo[playerid][pAcceptedHelp]++;
  66. new Float: x, Float: y, Float: z, Float: r, i, vw;
  67. vw = GetPlayerVirtualWorld(playerid);
  68. i = GetPlayerInterior(playerid);
  69. GetPlayerPos(playerid, x, y, z);
  70. GetPlayerFacingAngle(playerid, r);
  71. SetPVarFloat(playerid, "AdvisorLastx", x);
  72. SetPVarFloat(playerid, "AdvisorLasty", y);
  73. SetPVarFloat(playerid, "AdvisorLastz", z);
  74. SetPVarFloat(playerid, "AdvisorLastr", r);
  75. SetPVarInt(playerid, "AdvisorLastInt", i);
  76. SetPVarInt(playerid, "AdvisorLastVW", vw);
  77. GetPlayerPos(AdvisorCall, x, y, z);
  78. vw = GetPlayerVirtualWorld(AdvisorCall);
  79. i = GetPlayerInterior(AdvisorCall);
  80. SetPlayerPos(playerid, x, y+2, z);
  81. SetPlayerVirtualWorld(playerid, vw);
  82. SetPlayerInterior(playerid, i);
  83. HelpingNewbie[playerid] = AdvisorCall;
  84. AdvisorCall = 999;
  85. AddCAReportToken(playerid); // Advisor Tokens
  86. return 1;
  87. }
  88. }
  89. else
  90. {
  91. SendClientMessageEx(playerid, COLOR_GREY, " No-one has requested any help yet!");
  92. return 1;
  93. }
  94. return 1;
  95. }
  96.  
  97. CMD:finishhelp(playerid, params[])
  98. {
  99. if(HelpingNewbie[playerid] < 999)
  100. {
  101. new string[128];
  102. format(string, sizeof(string), "* %s has finished the help request from %s.",GetPlayerNameEx(playerid), GetPlayerNameEx(HelpingNewbie[playerid]));
  103. SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
  104. SetPlayerPos(playerid, GetPVarFloat(playerid, "AdvisorLastx"), GetPVarFloat(playerid, "AdvisorLasty"), GetPVarFloat(playerid, "AdvisorLastz"));
  105. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "AdvisorLastVW"));
  106. SetPlayerInterior(playerid, GetPVarInt(playerid, "AdvisorLastInt"));
  107. SetPVarInt(HelpingNewbie[playerid], "COMMUNITY_ADVISOR_REQUEST", 0);
  108. HelpingNewbie[playerid] = 999;
  109. return 1;
  110. }
  111. else
  112. {
  113. SendClientMessageEx(playerid, COLOR_GREY, " You're not helping anyone!");
  114. return 1;
  115. }
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement