SA-MP Forums Archive
teleports - 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)
+--- Thread: teleports (/showthread.php?tid=299099)



teleports - viosteaua98 - 24.11.2011

i want when someone type /teleports to show all teleports like
/teleports:
bayside,dilimore.....


Re: teleports - |_ⒾⓇⓄN_ⒹⓄG_| - 24.11.2011

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Tel eports","Bayside\nDilimore\n...","Teleport","Close ");

and then

https://sampwiki.blast.hk/wiki/OnDialogResponse

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid) // 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
                {
                    // TELEPORT TO BAYSIDE
                }
                case 1:
                {
                    // TELEPORT TO DILIMORE
                }
                case 2:
                {
                    //TELEPORT TO OTHER ...
                }
                // Add the rest of your listitems for dialog 1 here
 
            }
 
        }
        // 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.).
}