27.06.2012, 03:55
pawn Код:
command(attach, playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_TOYS, DIALOG_STYLE_LIST, "Attach toys", "Briefcase\nFire Hydrant\nGas Pump\nWooden Crate\nSmall Buolder\nBBQ Grill\nBeer\nTelevision", "Select", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1:
{
if(!response)
{
SendClientMessage(playerid, WHITE, "You cancelled.");
return 1;
}
switch(listitem)
{
case 0:
{
AttachObjectToPlayer(1210, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
}
case 1:
{
AttachObjectToPlayer(1211, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
}
case 2:
{
AttachObjectToPlayer(1244, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
}
case 3:
{
AttachObjectToPlayer(1271, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
}
case 4:
{
AttachObjectToPlayer(1304, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
}
case 5:
{
AttachObjectToPlayer(1481, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
}
case 6:
{
AttachObjectToPlayer(1484, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
}
case 7:
{
AttachObjectToPlayer(1518, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
}
}
}
}
return 0;
}
And the return 1; error makes no sense, is there a random other end bracket that would prevent the thing from continuing, or something?
EDIT: If the DIALOG_TOYS define thing doesn't work, are you sure that there is no other dialog id with the id of 1?