Advertisement
Guest User

Untitled

a guest
Nov 11th, 2012
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.81 KB | None | 0 0
  1. /* Weapon menu with dialogs,made by Plovix(Dino Hodzic),Year: 2012.
  2. You're not allowed to re-release this or claim as yours and edit or remove credits!
  3. My forum profile: http://forum.sa-mp.com/member.php?u=147604
  4. If you find any bug/s,post it on my forum profile or on a topic */
  5.  
  6. #include <a_samp>
  7. #define DIALOG_WEAPONS_ALL 0
  8. #define DIALOG_WEAPONS_MELEE 1
  9. #define DIALOG_WEAPONS_PISTOLS 2
  10. #define DIALOG_WEAPONS_AUTOMATIC 3
  11. #define DIALOG_WEAPONS_SHOTGUNS 4
  12. #define DIALOG_WEAPONS_RIFLES 5
  13. #define DIALOG_WEAPONS_THROW 6
  14. #define DIALOG_WEAPONS_OTHERS 7
  15.  
  16. #if defined FILTERSCRIPT
  17.  
  18. public OnFilterScriptInit()
  19. {
  20.     print("\n--------------------------------------");
  21.     print(" _______Plovix weapon menu loaded_______");
  22.     print("--------------------------------------\n");
  23.     return 1;
  24. }
  25.  
  26. public OnFilterScriptExit()
  27. {
  28.     print("\n--------------------------------------");
  29.     print(" _____Plovix weapon menu unloaded_______");
  30.     print("--------------------------------------\n");
  31.     return 1;
  32. }
  33.  
  34. #else
  35.  
  36. main()
  37. {
  38.     print("\n--------------------------------------");
  39.     print(" _______Plovix weapon menu loaded_______");
  40.     print("--------------------------------------\n");
  41. }
  42.  
  43. #endif
  44.  
  45. public OnPlayerCommandText(playerid, cmdtext[])
  46. {
  47.     if(strcmp("/weapons", cmdtext, true) == 0 || strcmp("/w", cmdtext, true) == 0)
  48.     {
  49.         ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
  50.         return 1;
  51.     }
  52.     return 0;
  53. }
  54.  
  55. public OnPlayerConnect(playerid)
  56. {
  57.    SendClientMessage(playerid, -1, "This server is using Plovix weapon menu!"); //Please don't remove this :)
  58.    return 1;
  59. }
  60.  
  61. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  62. {
  63.     if(dialogid == DIALOG_WEAPONS_ALL)
  64.     {
  65.     if(response)
  66.     {
  67.     if(listitem == 0)
  68.     ShowPlayerDialog(playerid, DIALOG_WEAPONS_MELEE,2,"Melee weapons","Knife\nNightstick\nBrass Knuckles\nBaseball Bat\nGolf Club\nKatana\nFlowers\nCane\nShovel\nPool cue","Take","Back");
  69.     if(listitem == 1)
  70.     ShowPlayerDialog(playerid, DIALOG_WEAPONS_PISTOLS,2,"Pistols","9mm\nSilenced 9mmm\nDesert Eagle","Take","Back");
  71.     if(listitem == 2)
  72.     ShowPlayerDialog(playerid, DIALOG_WEAPONS_AUTOMATIC,2,"Automatic weapons","AK-47\nM4\nMP5\nUzi\nTec-9","Take","Back");
  73.     if(listitem == 3)
  74.     ShowPlayerDialog(playerid, DIALOG_WEAPONS_SHOTGUNS,2,"Shotguns","Shotgun\nSawnoff shotgun\nCombat shotgun","Take","Back");
  75.     if(listitem == 4)
  76.     ShowPlayerDialog(playerid, DIALOG_WEAPONS_RIFLES,2,"Rifles","Country Rifle\nSniper Rifle","Take","Back");
  77.     if(listitem == 5)
  78.     ShowPlayerDialog(playerid, DIALOG_WEAPONS_THROW,2,"Throw weapons","Grenade\nTear gas\nMolotov cocktail\nSatchel charge\nDetonator","Take","Back");
  79.     if(listitem == 6)
  80.     ShowPlayerDialog(playerid, DIALOG_WEAPONS_OTHERS,2,"Others","Minigun\nSpraycan\nCamera\nNight vis goggles\nThermal goggles\nFire extinguisher\nRPG\nHS RPG\nFlamethrowern\nParachute","Take","Back");
  81.     if(listitem == 7) ResetPlayerWeapons(playerid);
  82.     }
  83.     }
  84.     if(dialogid == DIALOG_WEAPONS_MELEE)
  85.     {
  86.     if(!response) return ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
  87.     if(listitem == 0) GivePlayerWeapon(playerid,4,1);
  88.     if(listitem == 1) GivePlayerWeapon(playerid,3,1);
  89.     if(listitem == 2) GivePlayerWeapon(playerid,1,1);
  90.     if(listitem == 3) GivePlayerWeapon(playerid,5,1);
  91.     if(listitem == 4) GivePlayerWeapon(playerid,2,1);
  92.     if(listitem == 5) GivePlayerWeapon(playerid,8,1);
  93.     if(listitem == 6) GivePlayerWeapon(playerid,14,1);
  94.     if(listitem == 7) GivePlayerWeapon(playerid,15,1);
  95.     if(listitem == 8) GivePlayerWeapon(playerid,6,1);
  96.     if(listitem == 9) GivePlayerWeapon(playerid,7,1);
  97.     }
  98.     if(dialogid == DIALOG_WEAPONS_PISTOLS)
  99.     {
  100.     if(!response) return ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
  101.     if(listitem == 0) GivePlayerWeapon(playerid,22,99999);
  102.     if(listitem == 1) GivePlayerWeapon(playerid,23,99999);
  103.     if(listitem == 2) GivePlayerWeapon(playerid,24,99999);
  104.     }
  105.     if(dialogid == DIALOG_WEAPONS_AUTOMATIC)
  106.     {
  107.     if(!response) return ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
  108.     if(listitem == 0) GivePlayerWeapon(playerid,30,99999);
  109.     if(listitem == 1) GivePlayerWeapon(playerid,31,99999);
  110.     if(listitem == 2) GivePlayerWeapon(playerid,29,99999);
  111.     if(listitem == 3) GivePlayerWeapon(playerid,28,99999);
  112.     if(listitem == 4) GivePlayerWeapon(playerid,32,99999);
  113.     }
  114.     if(dialogid == DIALOG_WEAPONS_SHOTGUNS)
  115.     {
  116.     if(!response) return ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
  117.     if(listitem == 0) GivePlayerWeapon(playerid,25,99999);
  118.     if(listitem == 1) GivePlayerWeapon(playerid,26,99999);
  119.     if(listitem == 2) GivePlayerWeapon(playerid,27,99999);
  120.     }
  121.     if(dialogid == DIALOG_WEAPONS_RIFLES)
  122.     {
  123.     if(!response) return ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
  124.     if(listitem == 0) GivePlayerWeapon(playerid,33,99999);
  125.     if(listitem == 1) GivePlayerWeapon(playerid,34,99999);
  126.     }
  127.     if(dialogid == DIALOG_WEAPONS_THROW)
  128.     {
  129.     if(!response) return ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
  130.     if(listitem == 0) GivePlayerWeapon(playerid,16,99999);
  131.     if(listitem == 1) GivePlayerWeapon(playerid,17,99999);
  132.     if(listitem == 2) GivePlayerWeapon(playerid,18,99999);
  133.     if(listitem == 3) GivePlayerWeapon(playerid,39,99999);
  134.     if(listitem == 4) GivePlayerWeapon(playerid,40,1);
  135.     }
  136.     if(dialogid == DIALOG_WEAPONS_OTHERS)
  137.     {
  138.     if(!response) return ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
  139.     if(listitem == 0) GivePlayerWeapon(playerid,38,99999);
  140.     if(listitem == 1) GivePlayerWeapon(playerid,41,99999);
  141.     if(listitem == 2) GivePlayerWeapon(playerid,43,99999);
  142.     if(listitem == 3) GivePlayerWeapon(playerid,44,1);
  143.     if(listitem == 4) GivePlayerWeapon(playerid,45,1);
  144.     if(listitem == 5) GivePlayerWeapon(playerid,42,99999);
  145.     if(listitem == 6) GivePlayerWeapon(playerid,35,99999);
  146.     if(listitem == 7) GivePlayerWeapon(playerid,36,99999);
  147.     if(listitem == 8) GivePlayerWeapon(playerid,37,99999);
  148.     if(listitem == 9) GivePlayerWeapon(playerid,46,1);
  149.     }
  150.     return 1;
  151. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement