Guest User

Untitled

a guest
Dec 4th, 2010
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 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. SetPlayerCameraPos(playerid,311.7842,-165.3932,999.6010);
  48. SetPlayerCameraLookAt(playerid,311.5911,-166.1371,999.6010);
  49. shop[playerid] = 1;
  50. return 1;
  51. }
  52. return 0;
  53. }
  54.  
  55. public OnPlayerSelectedMenuRow(playerid, row)
  56. {
  57. new Menu: Current = GetPlayerMenu(playerid);
  58. if (Current == HIMenu)
  59. {
  60. switch(row)
  61. {
  62. case 0:
  63. {
  64. GivePlayerWeapon(playerid, 31, 500);
  65. GivePlayerMoney(playerid, -15000);
  66. ShowMenuForPlayer(HIMenu,playerid);
  67. TogglePlayerControllable(playerid,0);
  68. }
  69. case 1:
  70. {
  71. GivePlayerWeapon(playerid, 29, 500);
  72. GivePlayerMoney(playerid, -15000);
  73. ShowMenuForPlayer(HIMenu,playerid);
  74. TogglePlayerControllable(playerid,0);
  75. }
  76. case 2:
  77. {
  78. GivePlayerWeapon(playerid, 33, 500);
  79. GivePlayerMoney(playerid, -15000);
  80. ShowMenuForPlayer(HIMenu,playerid);
  81. TogglePlayerControllable(playerid,0);
  82. }
  83. case 3:
  84. {
  85. GivePlayerWeapon(playerid, 34, 500);
  86. GivePlayerMoney(playerid, -15000);
  87. ShowMenuForPlayer(HIMenu,playerid);
  88. TogglePlayerControllable(playerid,0);
  89. }
  90. case 4:
  91. {
  92. GivePlayerWeapon(playerid, 24, 500);
  93. GivePlayerMoney(playerid, -15000);
  94. ShowMenuForPlayer(HIMenu,playerid);
  95. TogglePlayerControllable(playerid,0);
  96. }
  97. case 5:
  98. {
  99. GivePlayerWeapon(playerid, 25, 500);
  100. GivePlayerMoney(playerid, -15000);
  101. ShowMenuForPlayer(HIMenu,playerid);
  102. TogglePlayerControllable(playerid,0);
  103. }
  104. case 6:
  105. {
  106. GivePlayerWeapon(playerid, 22, 500);
  107. GivePlayerMoney(playerid, -15000);
  108. ShowMenuForPlayer(HIMenu,playerid);
  109. TogglePlayerControllable(playerid,0);
  110. }
  111. case 7:
  112. {
  113. shop[playerid] = 0;
  114. }
  115. }
  116. }
  117. return 1;
  118. }
  119.  
  120. public OnPlayerExitedMenu(playerid)
  121. {
  122. new Menu:Current = GetPlayerMenu(playerid);
  123. if (Current == HIMenu)
  124. {
  125. HideMenuForPlayer(HIMenu,playerid);
  126. TogglePlayerControllable(playerid,1);
  127. }
  128. else
  129. {
  130. ShowMenuForPlayer(HIMenu,playerid);
  131. TogglePlayerControllable(playerid,0);
  132. }
  133. return 1;
  134. }
  135. #endif
Advertisement
Add Comment
Please, Sign In to add comment