SA-MP Forums Archive
Dialog Teleport help please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog Teleport help please (/showthread.php?tid=249071)



Dialog Teleport help please - Cenation - 17.04.2011

Код:
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.).
}
i have created dialog now in Hideouts Teleport how can i do Player teleport on hideout 1 on click on hideout 1
like menu appeared Player Choose hideouts then Hideout 1 how can i do there SetPlayerPos?

Sorry for bad english
please help me...


Respuesta: Dialog Teleport help please - Daniel-92 - 17.04.2011


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.).
}



Re: Respuesta: Dialog Teleport help please - Cenation - 17.04.2011

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