Teleport Dialog - 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: Teleport Dialog (
/showthread.php?tid=428826)
Teleport Dialog -
Xicor - 07.04.2013
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?
Re: Teleport Dialog -
Edvin - 07.04.2013
www.wiki.sa-mp.com/wiki/ShowPlayerDialog - Show dialogs.
www.wiki.sa-mp.com/wiki/CallRemoteFunction - To call what teleport do you want.
Re: Teleport Dialog -
Xicor - 07.04.2013
Can you plz script one example i really cant understand it.
Re: Teleport Dialog -
RandomDude - 07.04.2013
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....
Re: Teleport Dialog -
Tamer - 07.04.2013
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.
}
}
}
Re: Teleport Dialog -
DobbysGamertag - 07.04.2013
http://codegenerators.pl/teleport
Re: Teleport Dialog -
Xicor - 07.04.2013
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