I need a little help with this one. -
sBlackWood - 20.10.2017
How can i create another dialog to OnDialogResponse, But i don't know how to add another one with out getting errros. Can you help me?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new Float:x,Float:y,Float:z;
if(dialogid==2 && response==1)
{
switch(listitem)
{
case 0:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x+3.0,y,z,0,0,0,0);
}
case 1:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x+3.0,y,z,0,0,0,0);
}
case 2:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x+3.0,y,z,0,0,0,0);
}
}
}return 1;
}
Please help
Re: I need a little help with this one. -
Zeth - 20.10.2017
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new Float:x,Float:y,Float:z;
if(dialogid==2 && response==1)
{
switch(listitem)
{
case 0:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x+3.0,y,z,0,0,0,0);
}
case 1:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x+3.0,y,z,0,0,0,0);
}
case 2:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x+3.0,y,z,0,0,0,0);
}
}
}
//add next one here
if(dialogid == put dialog id here)
{
//statements and functions here
}
return 1;
}
and for your convenience here are some tips:
*Use
easyDialogs for making dialogs as you are getting confused with OnDialogResponse
*Try to intend your codes, it will be easier for you to read them later.
Re: I need a little help with this one. -
sBlackWood - 20.10.2017
How can i script the usage of the buttons under the dialog? "Select", "Cancel"
Re: I need a little help with this one. -
Escobabe - 20.10.2017
PHP код:
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE, "Title", "Info", "Button 1", "Button 2");
Read more about it here:
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Re: I need a little help with this one. -
sBlackWood - 20.10.2017
It does not show how to script the usage of the buttons
Re: I need a little help with this one. -
Zeth - 20.10.2017
PHP код:
ShowPlayerDialog(playerid, dialogid, style, Caption[], info[], button1[], button2[])
here button1 will take the dialog forward which is we can say you are responding to the dialog and second one will be performing the action of not responding to the dialog.
PHP код:
under OnDialogResponse
if(dialogid == 1)
{
if(response)
{
SendClientMessage(playerid, -1, "You have pressed the first button");
return 1;
}
else
{
//now whatever you write below will be show on pression first button
SendClientMessage(playerid, -1, "You have pressed the second button");
}
}