public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/teles", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Commands List","1. Hideouts\r\n2. Airports\r\n3. Casinos\r\n4. Tallest Buildings\r\n5. Ammunation\r\n6. Motors\r\n7. Else More","", "Ok"); return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid==4) // Lookup the dialogid { case 1: { if(!response) { SendClientMessage(playerid, 0xFF0000FF, "You cancelled."); return 1; // We processed it } switch(listitem) // This is far more efficient than using an if-elseif-else structure { case 0: // Listitems start with 0, not 1 { ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Hideouts","Hideout 1\r\n2.Hideout 2\r\n3. Hideout 3\r\n4. Hideout 4\r\n5. Hideout 5\r\n6. Hideout 6","", "Back"); } } } // Add the rest of your dialogs here } return 0; // If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.). }
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teles3", cmdtext, true, 10) == 0)
{
//dialogid = 4
ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Commands List","1. Hideouts\r\n2. Airports\r\n3. Casinos\r\n4. Tallest Buildings\r\n5. Ammunation\r\n6. Motors\r\n7. Else More","", "Ok");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid) // Lookup the dialogid
{
case 4:
{
if(!response)
{
SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
return 1;
}
switch(listitem) // This is far more efficient than using an if-elseif-else structure
{
case 0: // Listitems start with 0, not 1
{
ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Hideouts","Hideout 1\r\n2.Hideout 2\r\n3. Hideout 3\r\n4. Hideout 4\r\n5. Hideout 5\r\n6. Hideout 6","", "Back");
}
}
}
case 5:
{
if(!response)
{
SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
return 1;
}
switch(listitem) // This is far more efficient than using an if-elseif-else structure
{
case 0:
{
SetPlayerPos(playerid,0.0,0.0,5.0);
//SetPlayerInterior(playerid,interiorid)
//SetPlayerFacingAngle(playerid,angle);
//SetCameraBehindPlayer(playerid);
}
case 1:
{
SetPlayerPos(playerid,0.0,0.0,5.0);
}
case 2:
{
SetPlayerPos(playerid,0.0,0.0,5.0);
}
//case 3..
}
}
}
return 0; // If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.).
}
![]() pawn Код:
|