Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Weapon menu with dialogs,made by Plovix(Dino Hodzic),Year: 2012.
- You're not allowed to re-release this or claim as yours and edit or remove credits!
- My forum profile: http://forum.sa-mp.com/member.php?u=147604
- If you find any bug/s,post it on my forum profile or on a topic */
- #include <a_samp>
- #define DIALOG_WEAPONS_ALL 0
- #define DIALOG_WEAPONS_MELEE 1
- #define DIALOG_WEAPONS_PISTOLS 2
- #define DIALOG_WEAPONS_AUTOMATIC 3
- #define DIALOG_WEAPONS_SHOTGUNS 4
- #define DIALOG_WEAPONS_RIFLES 5
- #define DIALOG_WEAPONS_THROW 6
- #define DIALOG_WEAPONS_OTHERS 7
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" _______Plovix weapon menu loaded_______");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" _____Plovix weapon menu unloaded_______");
- print("--------------------------------------\n");
- return 1;
- }
- #else
- main()
- {
- print("\n--------------------------------------");
- print(" _______Plovix weapon menu loaded_______");
- print("--------------------------------------\n");
- }
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/weapons", cmdtext, true) == 0 || strcmp("/w", cmdtext, true) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_WEAPONS_ALL, 2, "All weapons", "Melee weapons\nPistols\nAutomatic weapons\nShotguns\nRifles\nThrow weapons\nOthers\nReset Weapons","Next","Cancel");
- return 1;
- }
- return 0;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, -1, "This server is using Plovix weapon menu!"); //Please don't remove this :)
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_WEAPONS_ALL)
- {
- if(response)
- {
- if(listitem == 0)
- ShowPlayerDialog(playerid, DIALOG_WEAPONS_MELEE,2,"Melee weapons","Knife\nNightstick\nBrass Knuckles\nBaseball Bat\nGolf Club\nKatana\nFlowers\nCane\nShovel\nPool cue","Take","Back");
- if(listitem == 1)
- ShowPlayerDialog(playerid, DIALOG_WEAPONS_PISTOLS,2,"Pistols","9mm\nSilenced 9mmm\nDesert Eagle","Take","Back");
- if(listitem == 2)
- ShowPlayerDialog(playerid, DIALOG_WEAPONS_AUTOMATIC,2,"Automatic weapons","AK-47\nM4\nMP5\nUzi\nTec-9","Take","Back");
- if(listitem == 3)
- ShowPlayerDialog(playerid, DIALOG_WEAPONS_SHOTGUNS,2,"Shotguns","Shotgun\nSawnoff shotgun\nCombat shotgun","Take","Back");
- if(listitem == 4)
- ShowPlayerDialog(playerid, DIALOG_WEAPONS_RIFLES,2,"Rifles","Country Rifle\nSniper Rifle","Take","Back");
- if(listitem == 5)
- ShowPlayerDialog(playerid, DIALOG_WEAPONS_THROW,2,"Throw weapons","Grenade\nTear gas\nMolotov cocktail\nSatchel charge\nDetonator","Take","Back");
- if(listitem == 6)
- ShowPlayerDialog(playerid, DIALOG_WEAPONS_OTHERS,2,"Others","Minigun\nSpraycan\nCamera\nNight vis goggles\nThermal goggles\nFire extinguisher\nRPG\nHS RPG\nFlamethrowern\nParachute","Take","Back");
- if(listitem == 7) ResetPlayerWeapons(playerid);
- }
- }
- if(dialogid == DIALOG_WEAPONS_MELEE)
- {
- 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");
- if(listitem == 0) GivePlayerWeapon(playerid,4,1);
- if(listitem == 1) GivePlayerWeapon(playerid,3,1);
- if(listitem == 2) GivePlayerWeapon(playerid,1,1);
- if(listitem == 3) GivePlayerWeapon(playerid,5,1);
- if(listitem == 4) GivePlayerWeapon(playerid,2,1);
- if(listitem == 5) GivePlayerWeapon(playerid,8,1);
- if(listitem == 6) GivePlayerWeapon(playerid,14,1);
- if(listitem == 7) GivePlayerWeapon(playerid,15,1);
- if(listitem == 8) GivePlayerWeapon(playerid,6,1);
- if(listitem == 9) GivePlayerWeapon(playerid,7,1);
- }
- if(dialogid == DIALOG_WEAPONS_PISTOLS)
- {
- 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");
- if(listitem == 0) GivePlayerWeapon(playerid,22,99999);
- if(listitem == 1) GivePlayerWeapon(playerid,23,99999);
- if(listitem == 2) GivePlayerWeapon(playerid,24,99999);
- }
- if(dialogid == DIALOG_WEAPONS_AUTOMATIC)
- {
- 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");
- if(listitem == 0) GivePlayerWeapon(playerid,30,99999);
- if(listitem == 1) GivePlayerWeapon(playerid,31,99999);
- if(listitem == 2) GivePlayerWeapon(playerid,29,99999);
- if(listitem == 3) GivePlayerWeapon(playerid,28,99999);
- if(listitem == 4) GivePlayerWeapon(playerid,32,99999);
- }
- if(dialogid == DIALOG_WEAPONS_SHOTGUNS)
- {
- 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");
- if(listitem == 0) GivePlayerWeapon(playerid,25,99999);
- if(listitem == 1) GivePlayerWeapon(playerid,26,99999);
- if(listitem == 2) GivePlayerWeapon(playerid,27,99999);
- }
- if(dialogid == DIALOG_WEAPONS_RIFLES)
- {
- 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");
- if(listitem == 0) GivePlayerWeapon(playerid,33,99999);
- if(listitem == 1) GivePlayerWeapon(playerid,34,99999);
- }
- if(dialogid == DIALOG_WEAPONS_THROW)
- {
- 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");
- if(listitem == 0) GivePlayerWeapon(playerid,16,99999);
- if(listitem == 1) GivePlayerWeapon(playerid,17,99999);
- if(listitem == 2) GivePlayerWeapon(playerid,18,99999);
- if(listitem == 3) GivePlayerWeapon(playerid,39,99999);
- if(listitem == 4) GivePlayerWeapon(playerid,40,1);
- }
- if(dialogid == DIALOG_WEAPONS_OTHERS)
- {
- 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");
- if(listitem == 0) GivePlayerWeapon(playerid,38,99999);
- if(listitem == 1) GivePlayerWeapon(playerid,41,99999);
- if(listitem == 2) GivePlayerWeapon(playerid,43,99999);
- if(listitem == 3) GivePlayerWeapon(playerid,44,1);
- if(listitem == 4) GivePlayerWeapon(playerid,45,1);
- if(listitem == 5) GivePlayerWeapon(playerid,42,99999);
- if(listitem == 6) GivePlayerWeapon(playerid,35,99999);
- if(listitem == 7) GivePlayerWeapon(playerid,36,99999);
- if(listitem == 8) GivePlayerWeapon(playerid,37,99999);
- if(listitem == 9) GivePlayerWeapon(playerid,46,1);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement