Guest User

Untitled

a guest
Dec 4th, 2010
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. #include <a_samp>
  2. #define FILTERSCRIPT
  3. #define GREY 0x99999999
  4. #define ORANGE 0xFF6600FF
  5. #define RED 0xFF0000FF
  6. #define GREEN 0x00FF00FF
  7. #define BLUE 0x0000FFFF
  8. #define WHITE 0xFFFFFFFF
  9. #define BLACK 0x000000AA
  10. #define BLUE1 0x1229FAFF
  11. #if defined FILTERSCRIPT
  12.  
  13. new Menu: HIMenu;
  14. new shop[MAX_PLAYERS] = 0;
  15.  
  16. public OnFilterScriptInit()
  17. {
  18. return 1;
  19. }
  20.  
  21. public OnPlayerSpawn(playerid)
  22. {
  23. if(shop[playerid] == 1)
  24. {
  25. HIMenu = CreateMenu("The Shop",1,40,150,230,0);
  26. AddMenuItem(HIMenu,0,"$ 15.000 - ~g~M4");
  27. AddMenuItem(HIMenu,0,"$ 10.000 - ~g~MP5");
  28. AddMenuItem(HIMenu,0,"$ 8.000 - ~g~Country Rifle");
  29. AddMenuItem(HIMenu,0,"$ 9.000 - ~g~Sniper Rifle");
  30. AddMenuItem(HIMenu,0,"$ 12.000 - ~g~Desert Eagle");
  31. AddMenuItem(HIMenu,0,"$ 20.000 - ~g~Shotgun");
  32. AddMenuItem(HIMenu,0,"$ 6.000 - ~g~9mm");
  33. AddMenuItem(HIMenu,0,"Done");
  34. TogglePlayerControllable(playerid,0);
  35. ShowMenuForPlayer(HIMenu,playerid);
  36. SetPlayerInterior(playerid,6);
  37. SetPlayerPos(playerid,310.7842,-165.3932,999.6010);
  38. }
  39. return 1;
  40. }
  41.  
  42. public OnPlayerCommandText(playerid, cmdtext[])
  43. {
  44. if (strcmp("/shop",cmdtext,true,10) == 0)
  45. {
  46. SendClientMessage(playerid,WHITE,"You'll go to the shop when you respawn");
  47. shop[playerid] = 1;
  48. return 1;
  49. }
  50. return 0;
  51. }
  52.  
  53. public OnPlayerSelectedMenuRow(playerid, row)
  54. {
  55. TogglePlayerControllable(playerid, 1);
  56. new Menu: Current = GetPlayerMenu(playerid);
  57. SetPlayerCameraPos(playerid,311.7842,-165.3932,999.6010);
  58. SetPlayerCameraLookAt(playerid,311.5911,-166.1371,999.6010);
  59. if (Current == HIMenu)
  60. {
  61. switch(row)
  62. {
  63. case 0:
  64. {
  65. GivePlayerWeapon(playerid, 31, 500);
  66. GivePlayerMoney(playerid, -15000);
  67. ShowMenuForPlayer(HIMenu,playerid);
  68. TogglePlayerControllable(playerid,0);
  69. }
  70. case 1:
  71. {
  72. GivePlayerWeapon(playerid, 29, 500);
  73. GivePlayerMoney(playerid, -15000);
  74. ShowMenuForPlayer(HIMenu,playerid);
  75. TogglePlayerControllable(playerid,0);
  76. }
  77. case 2:
  78. {
  79. GivePlayerWeapon(playerid, 33, 500);
  80. GivePlayerMoney(playerid, -15000);
  81. ShowMenuForPlayer(HIMenu,playerid);
  82. TogglePlayerControllable(playerid,0);
  83. }
  84. case 3:
  85. {
  86. GivePlayerWeapon(playerid, 34, 500);
  87. GivePlayerMoney(playerid, -15000);
  88. ShowMenuForPlayer(HIMenu,playerid);
  89. TogglePlayerControllable(playerid,0);
  90. }
  91. case 4:
  92. {
  93. GivePlayerWeapon(playerid, 24, 500);
  94. GivePlayerMoney(playerid, -15000);
  95. ShowMenuForPlayer(HIMenu,playerid);
  96. TogglePlayerControllable(playerid,0);
  97. }
  98. case 5:
  99. {
  100. GivePlayerWeapon(playerid, 25, 500);
  101. GivePlayerMoney(playerid, -15000);
  102. ShowMenuForPlayer(HIMenu,playerid);
  103. TogglePlayerControllable(playerid,0);
  104. }
  105. case 6:
  106. {
  107. GivePlayerWeapon(playerid, 22, 500);
  108. GivePlayerMoney(playerid, -15000);
  109. ShowMenuForPlayer(HIMenu,playerid);
  110. TogglePlayerControllable(playerid,0);
  111. }
  112. case 7:
  113. {
  114. shop[playerid] = 0;
  115. }
  116. }
  117. }
  118. return 1;
  119. }
  120.  
  121. public OnPlayerExitedMenu(playerid)
  122. {
  123. new Menu:Current = GetPlayerMenu(playerid);
  124. if (Current == HIMenu)
  125. {
  126. HideMenuForPlayer(HIMenu,playerid);
  127. TogglePlayerControllable(playerid,1);
  128. }
  129. else
  130. {
  131. ShowMenuForPlayer(HIMenu,playerid);
  132. TogglePlayerControllable(playerid,0);
  133. }
  134. return 1;
  135. }
  136. #endif
Advertisement
Add Comment
Please, Sign In to add comment