Dialog problem
#1

I am making a dialog /toys.

If you pick the first option: Parrot it should Attach a parrot to the player.

But it won't Attach...

My codes:

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if (
response == DIALOG_TOYS)
    {
        switch(
listitem)
        {
            case 
0SetPlayerAttachedObject(playerid01907816);
        }
    }
    return 
1;
}
CMD:toys(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOG_TOYSDIALOG_STYLE_LIST"Buy a Toy""Parrot\n""Choose""Cancel");
    return 
1;

What's wrong?

I made a cmd: /parrot:

PHP код:
CMD:parrot(playeridparams[])
{
    
SetPlayerAttachedObject(playerid01907816);
    return 
1;

But that does work.

What's the problem
Reply
#2

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if (
dialogid == DIALOG_TOYS)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0SetPlayerAttachedObject(playerid01907816);
            }
        }
    }
    return 
1;

You were supposed to check the dialogid but instead you used response
Reply
#3

Ok that was problem 1.

Still doesn't work.
Reply
#4

Anyone?
Reply
#5

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) 
{ 
    if(dialogid == DIALOG_TOYS) 
    { 
		if(response)
		{
			switch(listitem) 
			{ 
				case 0: SetPlayerAttachedObject(playerid, 0, 19078, 16); 
			} 
		}	
    } 
    return 1; 
} 

CMD:toys(playerid, params[]) 
{ 
    ShowPlayerDialog(playerid, DIALOG_TOYS, DIALOG_STYLE_LIST, "Buy a Toy", "Parrot\n", "Choose", "Cancel"); 
    return 1; 
}
try this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)