[ANSWERED] Dialog doesn't response
#1

I've made a Dialog following this Tut: Click

This is my code (things deleted):
pawn Код:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Choose your thing", "1\n2, "Select", "Quit");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 0)
  {
   if(response == 0)
   {
     SendClientMessage(playerid, rood, "You quited the server");
     Kick(playerid);
   }
   else
   {
     SendClientMessage(playerid, groen, "Yes"); // I even don't get this message (?)
     switch(listitem)
     {
      case 0:
      {
        SetPlayerPos(playerid, 1, 1,1);
        SetPlayerFacingAngle(playerid, 1);
        SendClientMessage(playerid, groen, "Yes 1");
      }
      case 1:
      {
        SetPlayerPos(playerid, 1, 1,1);
        SetPlayerFacingAngle(playerid, 1);
        SendClientMessage(playerid, groen, "Yes 2");
      }
     }
   }
  }
  return 1;
}
Why doesn't it Response anything, also if I touch the second button.
Reply
#2

Use these:

pawn Код:
if(response) // If player responded // First button
if(!response) // If player quit the dialog // Second button
Reply
#3

I did use but it won't work... Thanx for help.
Does anybody else know it?
Reply
#4

do this

pawn Код:
if(dialogid == 0)
{
if(response)
{
//Code
}
if(!response)
{
//Code
Kick(playerid);
}
}
Reply
#5

Okay, I did...
This is now my script (somethings changed):
pawn Код:
#include <a_samp>
#include <dudb>

#pragma unused ret_memcpy

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
  return 1;
}

public OnFilterScriptExit()
{
  return 1;
}

#endif

public OnGameModeInit()
{
  return 1;
}

public OnGameModeExit()
{
  return 1;
}

public OnPlayerSpawn(playerid)
{
  ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Choose your thing!","First \t $1", "Select", "Quit");
  return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[256], idx;
  cmd = strtok(cmdtext, idx);
  if(strcmp("/thing", cmd, true) == 0)
  {
   ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Choose your thing!", "First \t $1", "Join", "Quit");
   return 1;
  }
  return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 0)
  {
   if(response)
   {
     SendClientMessage(playerid, groen, "Yes"); // I don't get this message.. :S
     switch(listitem)
     {
      case 0:
      {
        SendClientMessage(playerid, lichtgroen, "Now you made it! Congratulations!");
      }
      case 1:
      {
        SetPlayerPos(playerid, 12, 12, 12);
        SetPlayerFacingAngle(playerid, 12);
        SendClientMessage(playerid, groen, "Lol, where are you?");
      }
     }
   }
   else if(!response) /* also won't work without 'if(!response)' */
   {
     SendClientMessage(playerid, rood, "You quited the server");
     Kick(playerid);
   }
  }
  return 1;
}
It is not working, does anybody else know why?
Reply
#6

Try changing dialogid from 0 to 1
Reply
#7

Ok, I'm now going to test it if I done it I Edit this message.

EDIT: didn't work, but thanks for your help!
Reply
#8

Does _any_ response work?
Try this:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 0)
  {
     switch(listitem)
     {
      case 0:
      {
        SendClientMessage(playerid, lichtgroen, "Now you made it! Congratulations!");
      }
      case 1:
      {
        SetPlayerPos(playerid, 12, 12, 12);
        SetPlayerFacingAngle(playerid, 12);
        SendClientMessage(playerid, groen, "Lol, where are you?");
      }
     }
   }
   		else SendClientMessage(playerid, groen, "You quited the server"); Kick(playerid);
 		{
  }
  return 1;
}
Reply
#9

Assyria, it's also not working, I don't know what it is... I'm going to try only 1 filterscript and test it.
EDIT: And it works I've checked all my scripts, but in no-one was a Dialog so I'm going to try to load first my filterscript with the dialog
Reply
#10

This Problem is Answered Thank you all!

I've just putted the script with the dialog as first so it's the first one whose loaded!
And I changed (response == 0) to (!response) and (response == 1) to (response)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)