dialog question
#1

lets say :
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Welcome To Shop", "anything", "Buy", "Cancel");

how to control the buttons like if the player pressed cancel it says : you canceled shop
________
Lost forums
Reply
#2

OnplayerDialog responce.



Code:
  public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])// Begining rules
{
	if(dialogid == 1)
	{
		if(response)
		{
		  SendClientMessage(playerid,COLOR_YELLOW, "accepted button 1.");
		}
		else
		{
		  SendClientMessage(playerid, 0xFF0000FF, "denied");
		}
    return 1;
	}
	if(dialogid == 2)
	{
	if(response)
	{
  SendClientMessage(playerid,COLOR_YELLOW, "thanks for accepting the rules!");
	}
  return 1;
  }
  return 0;
  }
Reply
#3

i use case :
if(dialogid == 1 && response)
{
switch(listitem)
{
case 0://hydra
{
}
}
}
________
MEDICAL CANNABIS
Reply
#4

anyone?!?
________
Vaporite 6Th Element Review
Reply
#5

Use Dakota's way.
Reply
#6

Quote:
Originally Posted by [AC
Etch ]
i use case :
if(dialogid == 1 && response)
{
switch(listitem)
{
case 0://hydra
{
}
}
}
I also use that

https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
Reply
#7

Quote:
Originally Posted by Ironboy500
Use Dakota's way.
i can't dude i dont use that way and i am not gonna rescript my whole script and torran i know how to create a dialog but i want how to edit buttons
________
M117 engine
Reply
#8

They've shown you,

if response = 1 then the person pressed the left button, if response = 0 then they pressed the right button.
Reply
#9

Quote:
Originally Posted by Joe Staff
They've shown you,

if response = 1 then the person pressed the left button, if response = 0 then they pressed the right button.
but you dont need to type if response = 0 if is first if response = 1 just use >ELSE<
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)