Dialog Teleport help please
#3

Quote:
Originally Posted by Daniel-92
Посмотреть сообщение

pawn Код:
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.).
}
thankz a lot, ton very much etc
Reply


Messages In This Thread
Dialog Teleport help please - by Cenation - 17.04.2011, 02:38
Respuesta: Dialog Teleport help please - by Daniel-92 - 17.04.2011, 03:01
Re: Respuesta: Dialog Teleport help please - by Cenation - 17.04.2011, 05:21

Forum Jump:


Users browsing this thread: 1 Guest(s)