18.12.2013, 08:57
I am making a request help for my server for players that need their car parked or something and when I request help and a helper accepts they get teleported to me. But when he says /finishhr it doesnt do anything. It is suppose to send them back to were they were but it doesnt and it doesnt evan do
Everything works except this command
Код:
format(str, sizeof(str), "%s has finished a help request", GetName(playerid), rid); SendClientMessageToHelpersEx(COLOR_CYAN, str, 1);
Код:
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); SendClientMessageToHelpersDuty(COLOR_CYAN, str, 1); return 1; } CMD:accepthr(playerid, params[]) { new rid; new Float:x, Float:y, Float:z; if(PlayerInfo[playerid][pHelper] <= 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); SendClientMessageToHelpersEx(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][pHelper] <= 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); SendClientMessageToHelpersEx(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:finishhr(playerid, params[]) { new rid, str[126]; if(PlayerInfo[playerid][pHelper] <= 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); SendClientMessageToHelpersEx(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;