if(strcmp(cmd, "/helpme", true) == 0) { if(IsPlayerConnected(playerid)) { if(Mute[playerid] == 1) { SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't speak, you have been silenced !"); return 1; } else { if (Requesting_Help[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "Warning: You already have one helpme request waiting for response!"); if (HelperTimer[playerid] > 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Warning: You have to wait before submitting another Help Request!"); new helpmediatext[500]; format(helpmediatext, sizeof(helpmediatext), "You are requesting help, please do the following:\n -Write down your problem/question; \n -Your question must be clear; \n -Your question must be easy to read."); ShowPlayerDialog(playerid, DIALOG_HELPME, DIALOG_STYLE_INPUT, "Help Request", helpmediatext, "Send", "Cancel"); return 1; } } return 1; }
if(dialogid == DIALOG_HELPME) { if(response == 1) { if(strlen(inputtext) > 8) { new helpmetext[128]; Requesting_Help[playerid] = 1; format(helpmetext, sizeof(helpmetext),"%s(ID:%i) is requesting help:%s",PlayerName(playerid),playerid,inputtext); SendHelperMessage(COLOR_RED, helpmetext); SendHelperMessage(COLOR_RED, "Type /ahm to accept his help request."); HelperTimer[playerid] = 60; } else { SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: Your message is too short, it must contain at least 8 characters"); } } if(response == 0) { SendClientMessage(playerid, COLOR_RED, "Action Canceled"); return 1; }
SendHelperMessage(Color, Text[])
{
foreach(Player, i)
{
if( IsPlayerHelper( i ) )
{
SendClientMessage( i, Color, Text );
}
}
return 0;
}
if(dialogid == DIALOG_HELPME)
{
if(!response) return 0;
if(strlen(inputtext) < 8) return SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: Your message is too short, it must contain at least 8 characters");
new helpmetext[128];
Requesting_Help[playerid] = 1;
format(helpmetext, sizeof(helpmetext),"%s(ID:%i) is requesting help:%s",PlayerName(playerid),playerid,inputtext);
SendHelperMessage(COLOR_RED, helpmetext);
SendHelperMessage(COLOR_RED, "Type /ahm to accept his help request.");
HelperTimer[playerid] = 60;
}
Why don't you just have them do /helpme text and pull the text out and
send/admin broadcast it, then you dont need to worry about showing and interpreting dialog. |