Advertisement
Guest User

Seif

a guest
Mar 2nd, 2008
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.56 KB | None | 0 0
  1. /*x---------------------------------Important-------------------------------------x*/
  2. //**INCLUDES**//
  3. #include <a_samp>
  4. /*x---------------------------------Defining-------------------------------------x*/
  5. //**COLORS**//
  6. #define GREEN 0x21DD00FF
  7. #define RED 0xE60000FF
  8. #define ADMIN_RED 0xFB0000FF
  9. #define YELLOW 0xFFFF00FF
  10. #define ORANGE 0xF97804FF
  11. #define LIGHTRED 0xFF8080FF
  12. #define LIGHTBLUE 0x00C2ECFF
  13. #define PURPLE 0xB360FDFF
  14. #define PLAYER_COLOR 0xFFFFFFFF
  15. #define BLUE 0x1229FAFF
  16. #define LIGHTGREEN 0x38FF06FF
  17. #define DARKPINK 0xE100E1FF
  18. #define DARKGREEN 0x008040FF
  19. #define ANNOUNCEMENT 0x6AF7E1FF
  20. #define COLOR_SYSTEM 0xEFEFF7AA
  21. #define GRAY 0xCECECEFF
  22. //**MISC**//
  23. #define WEAPAMMO 500 // Weapon Ammo when the weapon is selected.
  24. #undef KEY_LEFT
  25. #define KEY_LEFT 65408
  26. //**VARIABLES**//
  27. new Weap;
  28. new Weapons[200];
  29. new WeaponSelecting[45][0] = {
  30. {321},
  31. {322},
  32. {323},
  33. {324},
  34. {325},
  35. {326},
  36. {330},
  37. {331},
  38. {333},
  39. {334},
  40. {335},
  41. {336},
  42. {337},
  43. {338},
  44. {339},
  45. {341},
  46. {342},
  47. {343},
  48. {344},
  49. {346},
  50. {347},
  51. {348},
  52. {349},
  53. {350},
  54. {351},
  55. {352},
  56. {353},
  57. {354},
  58. {355},
  59. {356},
  60. {357},
  61. {358},
  62. {359},
  63. {360},
  64. {361},
  65. {362},
  66. {363},
  67. {364},
  68. {365},
  69. {366},
  70. {367},
  71. {368},
  72. {369},
  73. {371},
  74. {372}
  75. };
  76. new AllWeapons[45][0] = {
  77. {10},
  78. {11},
  79. {12},
  80. {13},
  81. {14},
  82. {15},
  83. {0},
  84. {1},
  85. {2},
  86. {3},
  87. {4},
  88. {5},
  89. {6},
  90. {7},
  91. {8},
  92. {9},
  93. {16},
  94. {17},
  95. {18},
  96. {22},
  97. {23},
  98. {24},
  99. {25},
  100. {26},
  101. {27},
  102. {28},
  103. {29},
  104. {0},
  105. {30},
  106. {31},
  107. {33},
  108. {34},
  109. {35},
  110. {36},
  111. {37},
  112. {38},
  113. {39},
  114. {40},
  115. {41},
  116. {42},
  117. {43},
  118. {44},
  119. {45},
  120. {46},
  121. {32}
  122. };
  123. //**FORWARDS**//
  124. forward WeaponSelection(playerid);
  125. /*x---------------------------------CallBacks-------------------------------------x*/
  126. public OnFilterScriptInit()
  127. {
  128.     print("[FS]|-----------------------------------------|[FS]");
  129.     print("[FS]|  .:[ - Weapon Menu Script by Seif - ]:. |[FS]");
  130.     print("[FS]|-----------------------------------------|[FS]");
  131.     return 1;
  132. }
  133.  
  134. public OnFilterScriptExit()
  135. {
  136.     print("[FS]|---------------[UNLOADED]----------------|[FS]");
  137.     print("[FS]|  .:[ - Weapon Menu Script by Seif - ]:. |[FS]");
  138.     print("[FS]|---------------[UNLOADED]----------------|[FS]");
  139.     DestroyPickup(Weap);
  140.     return 1;
  141. }
  142.  
  143. public OnPlayerCommandText(playerid, cmdtext[])
  144. {
  145.     if (strcmp("/weapons", cmdtext, true, 10) == 0)
  146.     {
  147.         new string[256],weapname[50];
  148.         SetPlayerCameraPos(playerid,2238,1090,40);
  149.         SetPlayerCameraLookAt(playerid,2233,1090,40);
  150.         TogglePlayerControllable(playerid,0);
  151.         Weapons[playerid] = 1;
  152.         Weap = CreatePickup(WeaponSelecting[0][0],23,2233,1090,40);
  153.         GetWeaponName(AllWeapons[Weapons[playerid]][0],weapname,50);
  154.         format(string,128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~%s",weapname);
  155.         GameTextForPlayer(playerid,string,3000,3);
  156.         SetTimerEx("WeaponSelection",100,1,"i",playerid);
  157.         return 1;
  158.     }
  159.     return 0;
  160. }
  161.  
  162. public WeaponSelection()
  163. {
  164.     for (new playerid=0;playerid<200;playerid++)
  165.     {
  166.     new keys, updown, leftright,weapname[50],string[128];
  167.     GetPlayerKeys(playerid,keys,updown,leftright);
  168.     switch (Weapons[playerid])
  169.     {
  170.         case 1:
  171.         {
  172.             if (leftright & 128)
  173.             {
  174.                 DestroyPickup(Weap);
  175.                 Weap = CreatePickup(WeaponSelecting[1][0],23,2233,1090,40);
  176.                 Weapons[playerid] = 2;
  177.                 GetWeaponName(AllWeapons[Weapons[playerid]][0],weapname,50);
  178.                 format(string,128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~%s",weapname);
  179.                 GameTextForPlayer(playerid,string,3000,3);
  180.             }
  181.             else if(leftright & 65408)
  182.             {
  183.                 DestroyPickup(Weap);
  184.                 Weap = CreatePickup(WeaponSelecting[44][0],23,2233,1090,40);
  185.                 Weapons[playerid] = 44;
  186.                 GetWeaponName(AllWeapons[Weapons[playerid]][0],weapname,50);
  187.                 format(string,128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~%s",weapname);
  188.                 GameTextForPlayer(playerid,string,3000,3);
  189.             }
  190.             else if(keys & 16)
  191.             {
  192.                 Weapons[playerid] = 0;
  193.                 DestroyPickup(Weap);
  194.                 SetCameraBehindPlayer(playerid);
  195.                 TogglePlayerControllable(playerid,1);
  196.             }
  197.             else if(keys & 32)
  198.             {
  199.                 GivePlayerWeapon(playerid,AllWeapons[Weapons[playerid]][0],WEAPAMMO);
  200.                 Weapons[playerid] = 0;
  201.                 DestroyPickup(Weap);
  202.                 SetCameraBehindPlayer(playerid);
  203.                 TogglePlayerControllable(playerid,1);
  204.             }
  205.         }
  206.         case 2..43:
  207.         {
  208.             if (leftright & 128)
  209.             {
  210.                 DestroyPickup(Weap);
  211.                 Weap = CreatePickup(WeaponSelecting[Weapons[playerid]+1][0],23,2233,1090,40);
  212.                 Weapons[playerid]++;
  213.                 GetWeaponName(AllWeapons[Weapons[playerid]][0],weapname,50);
  214.                 format(string,128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~%s",weapname);
  215.                 GameTextForPlayer(playerid,string,3000,3);
  216.             }
  217.             else if(leftright & 65408)
  218.             {
  219.                 DestroyPickup(Weap);
  220.                 Weap = CreatePickup(WeaponSelecting[Weapons[playerid]-1][0],23,2233,1090,40);
  221.                 Weapons[playerid]--;
  222.                 GetWeaponName(AllWeapons[Weapons[playerid]][0],weapname,50);
  223.                 format(string,128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~%s",weapname);
  224.                 GameTextForPlayer(playerid,string,3000,3);
  225.             }
  226.             else if(keys & 16)
  227.             {
  228.                 Weapons[playerid] = 0;
  229.                 DestroyPickup(Weap);
  230.                 SetCameraBehindPlayer(playerid);
  231.                 TogglePlayerControllable(playerid,1);
  232.             }
  233.             else if(keys & 32)
  234.             {
  235.                 GivePlayerWeapon(playerid,AllWeapons[Weapons[playerid]][0],WEAPAMMO);
  236.                 Weapons[playerid] = 0;
  237.                 DestroyPickup(Weap);
  238.                 SetCameraBehindPlayer(playerid);
  239.                 TogglePlayerControllable(playerid,1);
  240.             }
  241.         }
  242.         case 44:
  243.         {
  244.             if (leftright & 128)
  245.             {
  246.                 DestroyPickup(Weap);
  247.                 Weap = CreatePickup(WeaponSelecting[0][0],23,2233,1090,40);
  248.                 Weapons[playerid] = 1;
  249.                 GetWeaponName(AllWeapons[Weapons[playerid]][0],weapname,50);
  250.                 format(string,128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~%s",weapname);
  251.                 GameTextForPlayer(playerid,string,3000,3);
  252.             }
  253.             else if(leftright & 65408)
  254.             {
  255.                 DestroyPickup(0);
  256.                 Weap = CreatePickup(WeaponSelecting[43][0],23,2233,1090,40);
  257.                 Weapons[playerid] = 43;
  258.                 GetWeaponName(AllWeapons[Weapons[playerid]][0],weapname,50);
  259.                 format(string,128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~%s",weapname);
  260.                 GameTextForPlayer(playerid,string,3000,3);
  261.             }
  262.             else if(keys & 16)
  263.             {
  264.                 Weapons[playerid] = 0;
  265.                 DestroyPickup(Weap);
  266.                 SetCameraBehindPlayer(playerid);
  267.                 TogglePlayerControllable(playerid,1);
  268.             }
  269.             else if(keys & 32)
  270.             {
  271.                 GivePlayerWeapon(playerid,AllWeapons[Weapons[playerid]][0],WEAPAMMO);
  272.                 Weapons[playerid] = 0;
  273.                 DestroyPickup(Weap);
  274.                 SetCameraBehindPlayer(playerid);
  275.                 TogglePlayerControllable(playerid,1);
  276.             }
  277.         }
  278.     }
  279.     }
  280.     return 1;
  281. }
  282.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement