Dialog responce help
#1

I made a dialog (msgbox type) and i made the responce but it's not working,
Код:
if(dialogid == DIALOG_JOB)
			   {
			        if(response)
			        {
			            SendClientMessage(playerid, COLOR_GREEN, "you accepted the job");
			            
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_RED, "you declined the job");
                    }
                    return 1;
               }
       }
       return 0;
The dialog is showing but the responce is not working. help me please
Reply
#2

You put an extra bracket, try this one


pawn Код:
if(dialogid == DIALOG_JOB)
{
if(response)
{
SendClientMessage(playerid, COLOR_GREEN, "you accepted the job");
}
else
{
SendClientMessage(playerid, COLOR_RED, "you declined the job");
}
}
return 0;
}
Reply
#3

Код:
if(dialogid == DIALOG_JOB)
{
 if(response)
{
SendClientMessage(playerid, COLOR_GREEN, "you accepted the job");
			            
}
else
{
 SendClientMessage(playerid, COLOR_RED, "you declined the job");
}

return 1;
}
return 0;
EDIT: Late
Reply
#4

Still not working, it's compiling but nothing happen when i execute the command
Reply
#5

Can we see your ShowDialog which provides the given response?
Reply
#6

Код:
howPlayerDialog(playerid, DIALOG_JOB, DIALOG_STYLE_MSGBOX, "Job", "do you want to join this job ?", "Continue", "Close");
Reply
#7

Firstly you should definitely indent your code properly, and also what ID have you defined DIALOG_JOB as?

pawn Код:
ShowPlayerDialog(playerid, DIALOG_JOB, DIALOG_STYLE_MSGBOX, "Job", "Do you want to join this job?", "Yes", "No");
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_JOB)
    {
        if(response)
        {
            SendClientMessage(playerid, COLOR_GREEN, "You accepted the job!");
        }
        else
        {
            KickWithMessage(playerid, COLOR_RED, "You declined the job.");
        }
        return 1;
    }
 
    return 0;
}
Reply
#8

Do think anything's wrong there, change DIALOG_JOB into a numeric value and try, if that works, not sure though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)