SA-MP Forums Archive
About Dialog [HELP!] - 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: About Dialog [HELP!] (/showthread.php?tid=277278)



About Dialog [HELP!] - lyrics - 17.08.2011

Hey i want to add my buy score menu to the /shop list

Heres The Code For Shop

pawn Код:
if(strcmp("/shop", cmdtext, true, 10) == 0)
    {
      if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
      if(GetPVarInt(playerid, "InDm") == 1) return SendClientMessage(playerid,COLOR_RED, "You cant use any command While Your in DM");
      else
      {
      if(!IsPlayerInRangeOfPoint(playerid,4.0,-28.0168,-89.9490,1003.5469)) return SendClientMessage(playerid,COLOR_RED,"You Have To Be In Market 24/7");
      else
      {
      SendClientMessage(playerid, COLOR_RED, "Welcome To Market 24/7");
      ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Market 24/7 Menu","Sprunk (Coast $50)\nBeer (Coast $100)\nWine (Coast $100)\nCigarette (Coast $50)","Buy","Cancel");
      }
      }
      return 1;
    }
But i want to add my buy score menu

example

Код:
Blahblah blah
Blahblah blah
Blahblah blah
Blahblah blah
Score Menu
And i also want when i click score menu it must pop this out!:

pawn Код:
if(!strcmp(cmdtext, "/buyscore", true))
    {
       if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
       if(GetPVarInt(playerid, "InDm") == 1) return SendClientMessage(playerid,COLOR_RED, "You cant use any command While Your in DM");
       else
       {
       ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Buy Score Menu","10 Score (Coast $1000)\n50 Score (Coast $10000)\n100 Score (Coast $50000)\n500 Score (Coast $1000000)","Buy","Cancel");
       }
       return 1;
    }
Please Help !


Re: About Dialog [HELP!] - Norck - 17.08.2011

Command:
pawn Код:
if(strcmp("/shop", cmdtext, true, 10) == 0)
    {
      if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
      if(GetPVarInt(playerid, "InDm") == 1) return SendClientMessage(playerid,COLOR_RED, "You cant use any command While Your in DM");
      else
      {
      if(!IsPlayerInRangeOfPoint(playerid,4.0,-28.0168,-89.9490,1003.5469)) return SendClientMessage(playerid,COLOR_RED,"You Have To Be In Market 24/7");
      else
      {
      SendClientMessage(playerid, COLOR_RED, "Welcome To Market 24/7");
      ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Market 24/7 Menu","Sprunk (Coast $50)\nBeer (Coast $100)\nWine (Coast $100)\nCigarette (Coast $50)\nScore Menu","Buy","Cancel");
      }
      }
      return 1;
    }
And you need to modify code of the dialogid 7 in your OnDialogResponse callback. Like:
pawn Код:
// OnDialogResponse, dialogid=7
if(listitem == 4)
{
    ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Buy Score Menu","10 Score (Coast $1000)\n50 Score (Coast $10000)\n100 Score (Coast $50000)\n500 Score (Coast $1000000)","Buy","Cancel");
}
Anyway, show that piece of OnDialogResponse callback if you want me to make a complete code.


Re: About Dialog [HELP!] - lyrics - 17.08.2011

Quote:
Originally Posted by Norck
Посмотреть сообщение
Command:
pawn Код:
if(strcmp("/shop", cmdtext, true, 10) == 0)
    {
      if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
      if(GetPVarInt(playerid, "InDm") == 1) return SendClientMessage(playerid,COLOR_RED, "You cant use any command While Your in DM");
      else
      {
      if(!IsPlayerInRangeOfPoint(playerid,4.0,-28.0168,-89.9490,1003.5469)) return SendClientMessage(playerid,COLOR_RED,"You Have To Be In Market 24/7");
      else
      {
      SendClientMessage(playerid, COLOR_RED, "Welcome To Market 24/7");
      ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Market 24/7 Menu","Sprunk (Coast $50)\nBeer (Coast $100)\nWine (Coast $100)\nCigarette (Coast $50)\nScore Menu","Buy","Cancel");
      }
      }
      return 1;
    }
And you need to modify code of the dialogid 7 in your OnDialogResponse callback. Like:
pawn Код:
// OnDialogResponse, dialogid=7
if(listitem == 4)
{
    ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"Buy Score Menu","10 Score (Coast $1000)\n50 Score (Coast $10000)\n100 Score (Coast $50000)\n500 Score (Coast $1000000)","Buy","Cancel");
}
Anyway, show that piece of OnDialogResponse callback if you want me to make a complete code.
Thanks dude


Re: About Dialog [HELP!] - lyrics - 17.08.2011

Last more question how can i make my buy score menu

example its

Код:
Cancel
how can i make to

Код:
Back
?


Re: About Dialog [HELP!] - Norck - 17.08.2011

pawn Код:
// OnDialogResponse, dialogid=8
if(!response)
{
    ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Market 24/7 Menu","Sprunk (Coast $50)\nBeer (Coast $100)\nWine (Coast $100)\nCigarette (Coast $50)\nScore Menu","Buy","Cancel");
    return 1;
}
And (obviously) change "Cancel" to "Back" .


Re: About Dialog [HELP!] - lyrics - 17.08.2011

Thanks dude