I need a little help with this one.
#1

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
Reply
#2

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
Float:x,Float:y,Float:z;
    if(
dialogid==&& 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.
Reply
#3

How can i script the usage of the buttons under the dialog? "Select", "Cancel"
Reply
#4

PHP код:
ShowPlayerDialog(playeridDIALOGIDDIALOG_STYLE"Title""Info""Button 1""Button 2"); 
Read more about it here: https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Reply
#5

It does not show how to script the usage of the buttons
Reply
#6

PHP код:
ShowPlayerDialog(playeriddialogidstyleCaption[], 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");
     }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)