if (dialogid == 4) { if (response == 1) { switch (listitem) { case 0:SetPlayerPos(playerid,1322.3201,332.0854,19.4082); // Town 1 case 1:SetPlayerPos(playerid,223.3384,-143.9687,1.5781); // Town 2 case 2:SetPlayerPos(playerid,717.1638,-551.5009,16.1875); // Town 3 case 3:SetPlayerPos(playerid,2268.7009,-22.5023,26.4844); // Town 4 } SendClientMessage(playerid, 0xFFFFFFFF, "Teleported."); if(!response) SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!"); } }
Originally Posted by MenaceX^
Because this: if(!response) SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
is if response is positive. |
if(dialogid == 4)
{
if (response == 1)
{
switch (listitem)
{
case 0:SetPlayerPos(playerid,1322.3201,332.0854,19.4082); // Town 1
case 1:SetPlayerPos(playerid,223.3384,-143.9687,1.5781); // Town 2
case 2:SetPlayerPos(playerid,717.1638,-551.5009,16.1875); // Town 3
case 3:SetPlayerPos(playerid,2268.7009,-22.5023,26.4844); // Town 4
}
SendClientMessage(playerid, 0xFFFFFFFF, "Teleported.");
}
if(!response) SendClientMessage(playerid, 0xFFFFFFFF, "You canceled!");
}
if (dialogid == 4) { if (response) { if(listitem == 0) { SetPlayerPos(playerid,1322.3201,332.0854,19.4082); // Town 1 SendClientMessage(playerid, COLOR, "You've been warped to town 1"); } if(listitem == 1) { SetPlayerPos(playerid,223.3384,-143.9687,1.5781); // Town 2 SendClientMessage(playerid, COLOR, "You've been warped to town 2"); } if(listitem == 2) { SetPlayerPos(playerid,717.1638,-551.5009,16.1875); // Town 3 SendClientMessage(playerid, COLOR, "You've been warped to town 3"); } if(listitem == 3) { SetPlayerPos(playerid,2268.7009,-22.5023,26.4844); // Town 4 SendClientMessage(playerid, COLOR, "You've been warped to town 4"); } } }
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Town warper", "Town 1\nTown 2\nTown 3\nTown 4", "Warp", "Cancel");