Guest User

Weapons

a guest
Jan 10th, 2013
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.44 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #if defined FILTERSCRIPT
  8.  
  9. #define DIALOG_WEAPONS 1
  10. #define DIALOG_ADMINWEAPONS 2
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.     print("\n--------------------------------------");
  15.     print(" Nor15 Weapon system");
  16.     print("--------------------------------------\n");
  17.     return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22.     return 1;
  23. }
  24.  
  25. #else
  26.  
  27. main()
  28. {
  29.     print("\n----------------------------------");
  30.     print(" Nor15 Weapon system");
  31.     print("----------------------------------\n");
  32. }
  33.  
  34. #endif
  35.  
  36. public OnGameModeInit()
  37. {
  38.     // Don't use these lines if it's a filterscript
  39.     SetGameModeText("Blank Script");
  40.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  41.     return 1;
  42. }
  43.  
  44. public OnGameModeExit()
  45. {
  46.     return 1;
  47. }
  48.  
  49. public OnPlayerRequestClass(playerid, classid)
  50. {
  51.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  52.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  53.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  54.     return 1;
  55. }
  56.  
  57. public OnPlayerConnect(playerid)
  58. {
  59.     return 1;
  60. }
  61.  
  62. public OnPlayerDisconnect(playerid, reason)
  63. {
  64.     return 1;
  65. }
  66.  
  67. public OnPlayerSpawn(playerid)
  68. {
  69.     return 1;
  70. }
  71.  
  72. public OnPlayerDeath(playerid, killerid, reason)
  73. {
  74.     return 1;
  75. }
  76.  
  77. public OnVehicleSpawn(vehicleid)
  78. {
  79.     return 1;
  80. }
  81.  
  82. public OnVehicleDeath(vehicleid, killerid)
  83. {
  84.     return 1;
  85. }
  86.  
  87. public OnPlayerText(playerid, text[])
  88. {
  89.     return 1;
  90. }
  91.  
  92. public OnPlayerCommandText(playerid, cmdtext[])
  93. {
  94.     if (strcmp("/weapons", cmdtext, true, 10) == 0)
  95.     {
  96.      ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "brass Knuckles\nBaseBall Bat\nNight Stick\nPool Cue\nGolf Club\nKnife\n9mmPistol\nDesert Eagle\nTec-9\nSawn-off\nGrenade\nM4\nSniper", "Select", "Close");
  97.         return 1;
  98.     }
  99.     if (strcmp("/aweapons", cmdtext, true, 10) == 0)
  100.     {
  101.     if(!IsPlayerAdmin(playerid)) return 0;
  102.      ShowPlayerDialog(playerid, DIALOG_ADMINWEAPONS, DIALOG_STYLE_LIST, "Admin Weapons", "Minigun\nHS Rocket\nRPG\nSatchel Charge\nFlamethrower", "Select", "Close");
  103.         return 1;
  104.     }
  105.     return 0;
  106. }
  107.  
  108. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  109. {
  110.     return 1;
  111. }
  112.  
  113. public OnPlayerExitVehicle(playerid, vehicleid)
  114. {
  115.     return 1;
  116. }
  117.  
  118. public OnPlayerStateChange(playerid, newstate, oldstate)
  119. {
  120.     return 1;
  121. }
  122.  
  123. public OnPlayerEnterCheckpoint(playerid)
  124. {
  125.     return 1;
  126. }
  127.  
  128. public OnPlayerLeaveCheckpoint(playerid)
  129. {
  130.     return 1;
  131. }
  132.  
  133. public OnPlayerEnterRaceCheckpoint(playerid)
  134. {
  135.     return 1;
  136. }
  137.  
  138. public OnPlayerLeaveRaceCheckpoint(playerid)
  139. {
  140.     return 1;
  141. }
  142.  
  143. public OnRconCommand(cmd[])
  144. {
  145.     return 1;
  146. }
  147.  
  148. public OnPlayerRequestSpawn(playerid)
  149. {
  150.     return 1;
  151. }
  152.  
  153. public OnObjectMoved(objectid)
  154. {
  155.     return 1;
  156. }
  157.  
  158. public OnPlayerObjectMoved(playerid, objectid)
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerPickUpPickup(playerid, pickupid)
  164. {
  165.     return 1;
  166. }
  167.  
  168. public OnVehicleMod(playerid, vehicleid, componentid)
  169. {
  170.     return 1;
  171. }
  172.  
  173. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  174. {
  175.     return 1;
  176. }
  177.  
  178. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  179. {
  180.     return 1;
  181. }
  182.  
  183. public OnPlayerSelectedMenuRow(playerid, row)
  184. {
  185.     return 1;
  186. }
  187.  
  188. public OnPlayerExitedMenu(playerid)
  189. {
  190.     return 1;
  191. }
  192.  
  193. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  194. {
  195.     return 1;
  196. }
  197.  
  198. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  199. {
  200.     return 1;
  201. }
  202.  
  203. public OnRconLoginAttempt(ip[], password[], success)
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerUpdate(playerid)
  209. {
  210.     return 1;
  211. }
  212.  
  213. public OnPlayerStreamIn(playerid, forplayerid)
  214. {
  215.     return 1;
  216. }
  217.  
  218. public OnPlayerStreamOut(playerid, forplayerid)
  219. {
  220.     return 1;
  221. }
  222.  
  223. public OnVehicleStreamIn(vehicleid, forplayerid)
  224. {
  225.     return 1;
  226. }
  227.  
  228. public OnVehicleStreamOut(vehicleid, forplayerid)
  229. {
  230.     return 1;
  231. }
  232.  
  233. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  234. {
  235.     if(dialogid == DIALOG_WEAPONS)
  236.     {
  237.         if(response) // If they clicked 'Select' or double-clicked a weapon
  238.         {
  239.             // Give them the weapon
  240.             if(listitem == 0)
  241.             {
  242.                 GivePlayerWeapon(playerid, 1, 1);
  243.             }
  244.             if(listitem == 1)
  245.             {
  246.                 GivePlayerWeapon(playerid, 5, 1);
  247.             }
  248.             if(listitem == 2)
  249.             {
  250.                 GivePlayerWeapon(playerid, 3, 1);
  251.             }
  252.              if(listitem == 3)
  253.             {
  254.                 GivePlayerWeapon(playerid, 7, 1);
  255.             }
  256.              if(listitem == 4)
  257.             {
  258.                 GivePlayerWeapon(playerid, 2, 1);
  259.             }
  260.              if(listitem == 5)
  261.             {
  262.                 GivePlayerWeapon(playerid, 4, 1);
  263.             }
  264.              if(listitem == 6)
  265.             {
  266.                 GivePlayerWeapon(playerid, 23, 100);
  267.             }
  268.              if(listitem == 7)
  269.             {
  270.                 GivePlayerWeapon(playerid, 24, 100);
  271.             }
  272.              if(listitem == 8)
  273.             {
  274.                 GivePlayerWeapon(playerid, 32, 100);
  275.             }
  276.              if(listitem == 9)
  277.             {
  278.                 GivePlayerWeapon(playerid, 26, 100);
  279.             }
  280.              if(listitem == 10)
  281.             {
  282.                 GivePlayerWeapon(playerid, 16, 50);
  283.             }
  284.              if(listitem == 11)
  285.             {
  286.                 GivePlayerWeapon(playerid, 31, 100);
  287.             }
  288.              if(listitem == 12)
  289.             {
  290.                 GivePlayerWeapon(playerid, 34, 100);
  291.             }
  292.         }
  293.         return 1;
  294.         }
  295.          if(dialogid == DIALOG_ADMINWEAPONS)
  296.    {
  297.         if(response) // If they clicked 'Select' or double-clicked a weapon
  298.         {
  299.             // Give them the weapon
  300.             if(listitem == 0)
  301.             {
  302.                 GivePlayerWeapon(playerid, 38, 1000);
  303.             }
  304.             if(listitem == 1)
  305.             {
  306.                 GivePlayerWeapon(playerid, 36, 60);
  307.             }
  308.             if(listitem == 2)
  309.             {
  310.                 GivePlayerWeapon(playerid, 35, 60);
  311.             }
  312.              if(listitem == 3)
  313.             {
  314.                 GivePlayerWeapon(playerid, 39, 50);
  315.             }
  316.              if(listitem == 4)
  317.             {
  318.                 GivePlayerWeapon(playerid, 37, 500);
  319.             }
  320.         }
  321.         return 1;
  322.  }
  323.     return 0;
  324. }
  325. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  326. {
  327.     return 1;
  328. }
Advertisement
Add Comment
Please, Sign In to add comment