Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:requesthelp(playerid, params[])
- {
- if(Advisors < 1)
- {
- SendClientMessageEx(playerid, COLOR_GREY, " There are no Community Advisors On Duty at the moment, try again later!");
- return 1;
- }
- if(isnull(params))
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /requesthelp [reason]");
- return 1;
- }
- new string[128];
- if(PlayerInfo[playerid][pLevel] < 4)
- {
- if(JustReported[playerid] > 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "Wait 10 seconds after sending a next request!");
- return 1;
- }
- JustReported[playerid]=10;
- format(string, sizeof(string), "** %s is requesting help, reason: %s. (type /accepthelp)", GetPlayerNameEx(playerid), params);
- SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have requested help from a Community Advisor, wait for a reply.");
- SetPVarInt(playerid, "COMMUNITY_ADVISOR_REQUEST", 1);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a newbie!");
- }
- return 1;
- }
- CMD:accepthelp(playerid, params[])
- {
- foreach(Player, i)
- {
- if(GetPVarInt(i, "COMMUNITY_ADVISOR_REQUEST") >= 1)
- {
- AdvisorCall = i;
- }
- }
- if(AdvisorCall < 999)
- {
- if(IsPlayerConnected(AdvisorCall))
- {
- new string[128];
- if(HelpingNewbie[playerid] != 999)
- {
- SendClientMessageEx(playerid, COLOR_GRAD2, " You are already helping someone.");
- return 1;
- }
- if(GetPVarInt(playerid, "AdvisorDuty") == 0)
- {
- SendClientMessageEx(playerid, COLOR_GRAD2, " You are not on duty as a community advisor.");
- return 1;
- }
- format(string, sizeof(string), "* %s has accepted the help request from %s.",GetPlayerNameEx(playerid), GetPlayerNameEx(AdvisorCall));
- SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
- 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));
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Advisor %s has accepted your help request.",GetPlayerNameEx(playerid));
- SendClientMessageEx(AdvisorCall, COLOR_LIGHTBLUE, string);
- PlayerInfo[playerid][pAcceptedHelp]++;
- new Float: x, Float: y, Float: z, Float: r, i, vw;
- vw = GetPlayerVirtualWorld(playerid);
- i = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, r);
- SetPVarFloat(playerid, "AdvisorLastx", x);
- SetPVarFloat(playerid, "AdvisorLasty", y);
- SetPVarFloat(playerid, "AdvisorLastz", z);
- SetPVarFloat(playerid, "AdvisorLastr", r);
- SetPVarInt(playerid, "AdvisorLastInt", i);
- SetPVarInt(playerid, "AdvisorLastVW", vw);
- GetPlayerPos(AdvisorCall, x, y, z);
- vw = GetPlayerVirtualWorld(AdvisorCall);
- i = GetPlayerInterior(AdvisorCall);
- SetPlayerPos(playerid, x, y+2, z);
- SetPlayerVirtualWorld(playerid, vw);
- SetPlayerInterior(playerid, i);
- HelpingNewbie[playerid] = AdvisorCall;
- AdvisorCall = 999;
- AddCAReportToken(playerid); // Advisor Tokens
- return 1;
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, " No-one has requested any help yet!");
- return 1;
- }
- return 1;
- }
- CMD:finishhelp(playerid, params[])
- {
- if(HelpingNewbie[playerid] < 999)
- {
- new string[128];
- format(string, sizeof(string), "* %s has finished the help request from %s.",GetPlayerNameEx(playerid), GetPlayerNameEx(HelpingNewbie[playerid]));
- SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
- SetPlayerPos(playerid, GetPVarFloat(playerid, "AdvisorLastx"), GetPVarFloat(playerid, "AdvisorLasty"), GetPVarFloat(playerid, "AdvisorLastz"));
- SetPlayerVirtualWorld(playerid, GetPVarInt(playerid, "AdvisorLastVW"));
- SetPlayerInterior(playerid, GetPVarInt(playerid, "AdvisorLastInt"));
- SetPVarInt(HelpingNewbie[playerid], "COMMUNITY_ADVISOR_REQUEST", 0);
- HelpingNewbie[playerid] = 999;
- return 1;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, " You're not helping anyone!");
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement