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.
}
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; }
Код:
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; |