Small Problem
#1

Hello, need little help here. I have a /helpme command which shows the dialog, player can type problem and send it to admin. But for some reason when player types i am not receiving the text. Any can tell what maybe the problem?


Dialog
Code:
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;
	}

Dialog Response

Code:
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;
       	 }
Reply
#2

pawn Code:
SendHelperMessage(Color, Text[])
{
    foreach(Player, i)
    {
        if( IsPlayerHelper( i ) )
        {
            SendClientMessage( i, Color, Text );
        }
    }
    return 0;
}
Does your helper function looks like this?
Reply
#3

are you logged in as admin or what ever?show SendHelperMessage function
and little cleaner code:
pawn Code:
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;
}
Reply
#4

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.
Reply
#5

Quote:
Originally Posted by GrimR
View Post
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.
Maybe because thye can't spam with /helpme, than they must type it in dialog again and again (if they want spam)
also give /ahm command here
Reply
#6

They should have spam prevention in place anyway lol
Reply
#7

Oh my... -__- I am so stupid, i forgot its a SendHelperMessage function.. it sends it to available Helpers and not admin...

I am logged in as Admin. Thanks anyways guys :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)