29.12.2010, 21:08
That code is completely wrong, You should read some documentation about OnDialogResponse
Try this
Try this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1337)
{
if(!response)
{
SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
return 1; // We processed it
}
if(response)
{
switch(listitem) // This is far more efficient than using an if-elseif-else structure
{
case 0: // Listitems start with 0, not 1
{
GetPlayerPos(playerid, x, y, z);
CreateVehicle(603, x, y, z, 0, -1, -1, 60);
SendClientMessage(playerid, red, "You have spawned a Phoenix ID: 603");
}
case 1:
{
GetPlayerPos(playerid, x, y, z);
CreateVehicle(506, x, y, z, 0, -1, -1, 60);
}
case 2:
{
GetPlayerPos(playerid, x, y, z);
CreateVehicle(532, x, y, z, 0, -1, -1, 60);
}
}
}
}
return 1; // If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.).
}