24.07.2016, 13:20
Hey Guys.
I want to make a dialog that you can pick an object that will be attached to your body.
code:
The problem is:
The dialog opens but it will not respond. Even /edit will not work.
What's the problem?
I want to make a dialog that you can pick an object that will be attached to your body.
code:
PHP код:
CMD:toys(playerid, params[])
{
ShowPlayerDialog(playerid, 988, DIALOG_STYLE_LIST, "Weapons", "Parrot\nBlack Hat\nBaseball Bat", "Option 1", "Option 2");
return 1;
}
CMD:edit(playerid, params[])
{
EditAttachedObject(playerid, 0);
return 1;
}
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; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
The dialog opens but it will not respond. Even /edit will not work.
What's the problem?