CMD:requesthelp(playerid, params[]) { new hr[168], str[168]; if(sscanf(params, "s[168]", hr)) return SendClientMessage(playerid, -1, "USAGE: /requesthelp [text]"); if(helprequested[playerid] == 1) return SendClientMessage(playerid, -1, "You already have an active request."); // if(helprequests > 999) hr = 0; helprequests++; helprequested[playerid] = 1; helprequestid[playerid] = helprequests; format(str, sizeof(str), "
from %s [RID: %i]: %s", GetName(playerid), helprequests, hr); format(helprequesttext[playerid], sizeof(helprequesttext), "%s [ID: %i] [RID: %i]: %s", GetName(playerid), playerid, helprequests, hr); SendClientMessageToModsDuty(COLOR_CYAN, str, 1); return 1; }
CMD:accepthr(playerid, params[]) { new rid; new Float:x, Float:y, Float:z; if(PlayerInfo[playerid][pModerator] <= 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command yet!"); if(CDuty[playerid] != 1) return SendClientMessage(playerid,COLOR_WHITE, "You are not on duty!"); if(sscanf(params, "i", rid)) return SendClientMessage(playerid, -1, "USAGE: /accepthr [RID]"); if(rid == 0) return SendClientMessage(playerid, -1, "Invalid Report ID. Use the report ID - Not the playerid / name."); new success = 0; for(new p;p<MAX_PLAYERS;p++) { if(helprequestid[p] == rid) { new str2[126]; format(str2, sizeof(str2), "%s has accepted the help request [RID: %d]", GetName(playerid), rid); SendClientMessageToModeratorsEx(COLOR_CYAN, str2, 1); helprequested[p] = 0; helprequestid[p] = 0; GetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]); GetPlayerPos(p, x, y, z); SetPlayerPos(playerid, x+1, y+1, z); SetTimerEx("HelpRequest", 1000, false, "d", playerid); return 1; } else { if(success == 0) SendClientMessage(playerid, -1, "That is not a valid report!"); return 1; } } return 1; }
CMD:finishhr(playerid, params[]) { new rid, str[126]; if(PlayerInfo[playerid][pModerator] <= 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command yet!"); for(new p;p<MAX_PLAYERS;p++) if(helprequestid[p]) { format(str, sizeof(str), "%s has finished a help request", GetName(playerid), rid); SendClientMessageToModeratorsEx(COLOR_CYAN, str, 1); SetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]); helprequested[p] = 0; helprequestid[p] = 0; return 1; } return 1; } CMD:hrs(playerid, params[]) { if(PlayerInfo[playerid][pModerator] <= 1 && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command yet!"); // if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command yet!"); SendClientMessage(playerid, COLOR_GREEN, "|____________________Help Request________________________|"); for(new x; x<MAX_PLAYERS; x++) { if(helprequested[x] == 1) { SendClientMessage(playerid, COLOR_LIGHTRED, helprequesttext[x]); } } SendClientMessage(playerid, COLOR_GREEN, "|___________________________________________________|"); // ShowPlayerDialog(playerid, DIALOG_HELPREQUESTS, DIALOG_STYLE_MSGBOX, "Help Requests", HRInfo, "Close", ""); return 1; }
CMD:accepthr(playerid, params[])
{
new rid;
new Float:x, Float:y, Float:z;
if(PlayerInfo[playerid][pModerator] <= 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command yet!");
if(CDuty[playerid] != 1) return SendClientMessage(playerid,COLOR_WHITE, "You are not on duty!");
if(sscanf(params, "i", rid)) return SendClientMessage(playerid, -1, "USAGE: /accepthr [RID]");
if(rid == 0) return SendClientMessage(playerid, -1, "Invalid Report ID. Use the report ID - Not the playerid / name.");
new success = 0;
for(new p;p<MAX_PLAYERS;p++)
{
if(helprequestid[p] == rid)
{
new str2[126];
format(str2, sizeof(str2), "%s has accepted the help request [RID: %d]", GetName(playerid), rid);
SendClientMessageToModeratorsEx(COLOR_CYAN, str2, 1);
helprequested[p] = 0;
helprequestid[p] = 0;
GetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]);
GetPlayerPos(p, x, y, z);
SetPlayerPos(playerid, x+1, y+1, z);
SetTimerEx("HelpRequest", 1000, false, "d", playerid);
return 1;
}
else
{
if(success == 0) SendClientMessage(playerid, -1, "That is not a valid report!");
return 1;
}
}
return 1;
}
I dont really understand what you mean... The one time he logged in and his ID was 0 and mine was 1 and I /requesthelp which made the "RID 1" so he type /accepthr 1 but it still said "invalid report ID"
|
//global var
new Float:hrP[MAX_PLAYERS][3];
//in your accepthhr: (before you teleport the player)
GetPlayerPos(playerid,hrP[playerid][0], hrP[playerid][1], hrP[playerid][2]);
//in finishr:
SetPlayerPos(playerid,hrP[playerid][0], hrP[playerid][1], hrP[playerid][2]);