Need help with a 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: Need help with a Dialog. (
/showthread.php?tid=330326)
Need help with a Dialog. -
rangerxxll - 01.04.2012
Hello, I have a quick question.
I currently have a Dialog with a teleport in it, but what I want is a Dialog (List Style) that has "Stunts" "Parkours" "Derby", etc. And when a player clicks one, it will bring up another list for specific teleports to that kind of location.
Get what I mean? Here's my current code.
pawn Код:
if (dialogid == 100 && response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid,COLOR_GREEN, "You have teleported to: SuperJump 2000. Difficulty: 6/10");
SetPlayerPos(playerid, 904.9202,2517.1836,260.6575);
SetPlayerFacingAngle(playerid, 90);
}
}
}
return 1;
}
If you need more, let me know. Oh, and here's this.
pawn Код:
CMD:teles(playerid,params[])
{
ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Teleports","1.SuperJump 2000. (Difficulty: 6/10)","Teleport", "Cancel");
return 1;
}
Thanks for any assistance, appreciated.
Re: Need help with a Dialog. -
Reklez - 01.04.2012
here is the example. EXAMPLE ONLY
pawn Код:
ShowPlayerDialog(playerid, 3021, DIALOG_STYLE_LIST, "Choose your Donuts", "Happy Meal\nSimple Meal", "Choose", "Back");
pawn Код:
//OnDialogResponse
if(dialogid == 3021)
{
if(!response) return 0; //if player press back it will do nothing
if(response)
{
switch(listitem)
{
case 0: //if player selects Happy Meal
{
ShowPlayerDialog(playerid, 3022, DIALOG_STYLE_MSGBOX, "OWNED!", "You got owned!", "OK", ""); //another dialog will pop up with dialogstyle msgbox
}
case 1: SendClientMessage(playerid, -1, "Nice you didn't get owned!"); //a message will pop up after select Simple Meal
}
}
}