Teleport Dialog
#1

How i can make a teleport dialog with categories so when a player types /tele.A dialog appears with listing of the
spawns locations so when player click on the listing another dialog appears of teleports like if there is "City Areas" in first dialog when he clicks on it another dialog shows up with all City Locations/Areas?
Reply
#2

www.wiki.sa-mp.com/wiki/ShowPlayerDialog - Show dialogs.
www.wiki.sa-mp.com/wiki/CallRemoteFunction - To call what teleport do you want.
Reply
#3

Can you plz script one example i really cant understand it.
Reply
#4

Quote:
Originally Posted by Xicor
Посмотреть сообщение
Can you plz script one example i really cant understand it.
Download a script a basic gamemode on the gamemode sections etc a stunt server and check the teleports they might be dialog then you can see....
Reply
#5

pawn Код:
#DEFINE DIALOG_TELEPORT 865 // SOME RANDOM NUMBER TO BE DEFINED!


CMD:tele(playerid,params[]) // ZCMD,download if you don't have it
{
ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"SANFIERRO\nLAS VENTURAS\n OTHER CITY","TELEPORT!","CANCEL"); // the \n Indicates the next city so if you want to add a new city you must do \n
}

public OnDialogResponse(playerid,dialogid,response,listitem, inputtext[])

{

   switch(dialogid) // Lookup the dialogid
    {
        case DIALOG_TELEPORT
        {
            if(!response) // if they press "CANCEL!"
            {
                SendClientMessage(playerid,-1, "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
                {
                //SAN FIERRO TELEPORT STUFF HERE!
               
                }
                case 1:
                {
                //LAS VENTURAS TELEPORT STUFF HERE!
               
                }
                case 2:
                {
                //OTHER CITY TELEPORT STUFF HERE!
               
                }
                // Add the rest of your listitems for dialog 1 here so if you want to add more cities,write case 3: etc.

            }

        }
}
Reply
#6

http://codegenerators.pl/teleport
Reply
#7

Quote:
Originally Posted by Tamer T
Посмотреть сообщение
pawn Код:
#DEFINE DIALOG_TELEPORT 865 // SOME RANDOM NUMBER TO BE DEFINED!


CMD:tele(playerid,params[]) // ZCMD,download if you don't have it
{
ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"SANFIERRO\nLAS VENTURAS\n OTHER CITY","TELEPORT!","CANCEL"); // the \n Indicates the next city so if you want to add a new city you must do \n
}

public OnDialogResponse(playerid,dialogid,response,listitem, inputtext[])

{

   switch(dialogid) // Lookup the dialogid
    {
        case DIALOG_TELEPORT
        {
            if(!response) // if they press "CANCEL!"
            {
                SendClientMessage(playerid,-1, "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
                {
                //SAN FIERRO TELEPORT STUFF HERE!
               
                }
                case 1:
                {
                //LAS VENTURAS TELEPORT STUFF HERE!
               
                }
                case 2:
                {
                //OTHER CITY TELEPORT STUFF HERE!
               
                }
                // Add the rest of your listitems for dialog 1 here so if you want to add more cities,write case 3: etc.

            }

        }
}
Thanks Tamer T, Just what i wanted
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)