#1

Hey Guys.

I want to make a dialog that you can pick an object that will be attached to your body.

code:

PHP код:
CMD:toys(playeridparams[])
{
    
ShowPlayerDialog(playerid988DIALOG_STYLE_LIST"Weapons""Parrot\nBlack Hat\nBaseball Bat""Option 1""Option 2");
    return 
1;
}
CMD:edit(playeridparams[])
{
    
EditAttachedObject(playerid0);
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 988)
    {
        if(
response// If they clicked 'Select' or double-clicked a weapon
        
{
            
// Give them the toy
            
switch(listitem)
            {
                case 
0:
                {
                    
SetPlayerAttachedObject(playerid013372); //Blackhat
                
}
                case 
1:
                {
                    
SetPlayerAttachedObject(playerid013372); //Blackhat
                
}
                case 
2:
                {
                    
SetPlayerAttachedObject(playerid013372); //Blackhat
                
}
            }
        }
        return 
1// We handled a dialog, so return 1. Just like OnPlayerCommandText.
    
}
    return 
0// You MUST return 0 here! Just like OnPlayerCommandText.

The problem is:

The dialog opens but it will not respond. Even /edit will not work.

What's the problem?
Reply
#2

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 988)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the toy
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerAttachedObject(playerid, 0, 1337, 2); //Blackhat
                }
                case 1:
                {
                    SetPlayerAttachedObject(playerid, 0, 1337, 2); //Blackhat
                }
                case 2:
                {
                    SetPlayerAttachedObject(playerid, 0, 1337, 2); //Blackhat
                }
            }
        }
    }

    return 1;
}
Try now i edited it.
Reply
#3

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 988)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the toy
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerAttachedObject(playerid, 0, 1337, 2); //Blackhat
                }
                case 1:
                {
                    SetPlayerAttachedObject(playerid, 0, 1337, 2); //Blackhat
                }
                case 2:
                {
                    SetPlayerAttachedObject(playerid, 0, 1337, 2); //Blackhat
                }
            }
        }
    }

    return 1;
doesnt work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)