Guest User

Untitled

a guest
Oct 11th, 2016
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. #include <a_samp>
  2. #include <mSelection>
  3. #include <zcmd>
  4. #define DIALOG_ITEMS_SHOP 1
  5. new
  6. skinlist = mS_INVALID_LISTID,
  7. Gogglelist = mS_INVALID_LISTID,
  8. Hatslist = mS_INVALID_LISTID;
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. skinlist = LoadModelSelectionMenu("skins.txt");
  13. Gogglelist = LoadModelSelectionMenu("goggles.txt");
  14. Hatslist = LoadModelSelectionMenu("Hats.txt");
  15. return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20. return 1;
  21. }
  22. CMD:shop(playerid,params[])
  23. {
  24. ShowPlayerDialog(playerid, DIALOG_ITEMS_SHOP, DIALOG_STYLE_LIST, "Items Shops", "Buy a skin\nBuy glasses\nBuy hats", "select","");
  25. return 1;
  26. }
  27. public OnPlayerModelSelection(playerid, response, listid, modelid)
  28. {
  29. if(listid == skinlist)
  30. {
  31. if(response)
  32. {
  33. SendClientMessage(playerid, -1, "You have selected your cloths!");
  34. SetPlayerSkin(playerid, modelid);
  35. PlayerPlaySound(playerid,5453,0.0,0.0,0.0);
  36. //GivePlayerMoney(playerid, amount) If you want charge player just uncomment this and put your value instead of "amount"
  37. }
  38. else SendClientMessage(playerid, -1, "You Canceled Skin Shop Menu");
  39. return 1;
  40. }
  41. if(listid == Gogglelist)
  42. {
  43. if(response)
  44. {
  45. SendClientMessage(playerid, -1, "You have selected your goggles!");
  46. SetPlayerAttachedObject(playerid, 2, modelid, 2,0.1,0.04,0.0,60.0,85.0,25.0,1.0,1.0,1.0);
  47. //GivePlayerMoney(playerid, amount) If you want charge player just uncomment this and put your value instead of "amount"
  48. }
  49. else SendClientMessage(playerid, -1, "You Canceled Skin Shop Menu");
  50. return 1;
  51.  
  52. }
  53. if(listid == Hatslist)
  54. {
  55. if(response)
  56. {
  57. SendClientMessage(playerid, -1, "You have selected your hat!");
  58. SetPlayerAttachedObject(playerid, 3, modelid, 2, 0.094485, 0.007215, 0.0, 0.000000, 0.000000, 0.000000, 1.200000, 1.200000, 1.200000);
  59. //GivePlayerMoney(playerid, amount) If you want charge player just uncomment this and put your value instead of "amount"oinsCounter(playerid);
  60.  
  61. }
  62. else SendClientMessage(playerid, -1, "You Canceled Skin Shop Menu");
  63. return 1;
  64. }
  65. return 1;
  66. }
  67.  
  68.  
  69.  
  70.  
  71. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  72. {
  73. switch(dialogid)
  74. {
  75.  
  76. case DIALOG_ITEMS_SHOP:
  77. {
  78. if(response)
  79. {
  80. switch(listitem)
  81. {
  82. case 0:
  83. {
  84. //if(GetPlayerMoney(playerid) < 1 ) return SendClientMessage(playerid, -2, "You do not have enough coins");
  85. //uncomment line above if you're charging player
  86. ShowModelSelectionMenu(playerid, skinlist, "Skins");
  87. }
  88. case 1:
  89. {
  90. //if(GetPlayerMoney(playerid) < 1 ) return SendClientMessage(playerid, -1, "You do not have enough coins");
  91. //uncomment line above if you're charging player
  92. ShowModelSelectionMenu(playerid, Gogglelist, "Goggles");
  93. }
  94. case 2:
  95. {
  96. //if(GetPlayerMoney(playerid) < 1 ) return SendClientMessage(playerid, -1, "You do not have enough coins");
  97. //uncomment line above if you're charging player
  98. ShowModelSelectionMenu(playerid, Hatslist, "Hats");
  99. }
  100.  
  101. }
  102.  
  103.  
  104. }
  105. } }
  106. return 1;
  107. }
Advertisement
Add Comment
Please, Sign In to add comment