16.11.2013, 21:42
Hey, I can't get find out how to do it myself.. When someone does /helpme *question*, all staff gets a message *helpme from *id* *question*. Now I want staff to be able to do /helpreply *id* *answer*, how can I do that? Hopefully anyone can help me with this!
Currently I got this..
Код:
if(strcmp(cmd, "/helpme", true) == 0) { if(IsPlayerConnected(playerid)) { if(JustReported[playerid] == 1) { SendClientMessage(playerid, COLOR_GREY, "Wait 10 seconds after sending a next /helpme ! "); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /helpme [Question]"); return 1; } if(PlayerInfo[playerid][pReportMuted] == 1) { return SendClientMessage(playerid, COLOR_RED, " You're muted from sending any /helpme's!"); } JustReported[playerid] = 1; SetTimerEx("ReportReset", 10000, false, "i", playerid); format(string, sizeof(string), "Helpme from %s(%d): %s", RemoveUnderScore(playerid), playerid, (result)); ReportBroadCast(COLOR_YELLOW2, string, 1); ReportBroadCast(COLOR_GREEN,"Type: /ahm [PlayerID/PartOfName] to accept or /dhm [PlayerID/PartOfName] to deny.", 1); SendClientMessage(playerid, COLOR_YELLOW, "Your Helpme message was sent to all the Online Staff - It will be reviewed in a few seconds."); Reported[playerid] = 1; } return 1; }
Код:
if(strcmp(cmd, "/accepthelpme", true) == 0 || strcmp(cmd, "/ahm", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /(a)(h)elp(m)e [PlayerID/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(Reported[giveplayerid] == 0) { return SendClientMessage(playerid, -1," This player has not sent a /helpme!"); } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); AcceptedReport[playerid] = giveplayerid; Talkingto[giveplayerid] = playerid; format(string, sizeof(string), "%s Has accepted your /helpme, he will be with you shortly", RemoveUnderScore(playerid)); SendClientMessage(giveplayerid, COLOR_YELLOW, string); format(string, sizeof(string), "%s has accepted %s's helpme.", RemoveUnderScore(playerid), RPN(giveplayerid)); ReportBroadCast(COLOR_YELLOW, string); Reported[giveplayerid] = 0; } } } else { SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use that command !"); return 1; } } return 1; }