//============================================================================== // Guns Selection Menu //============================================================================== // - Credits to Garsino for the vehicle selection menu, this script is awesome, you should check it! // - Credits to DracoBlue for dcmd. // - Credits to Zeex for ZCMD. //============================================================================== #define FILTERSCRIPT #define VERSION 1.0 //------------------------------------------------------------------------------ #include #define ZCMD 0 // command type: ZCMD (by Zeex - fastest command processor of these three). #define DCMD 1 // command type: DCMD (by DracoBlue). #define STRCMP 2 // command type: STRCMP (string comperisation) #define COMMAND_TYPE DCMD // What command processor should the script use? Available modes: ZCMD, DCMD and STRCMP (WARNING: case sensetive!) #define DIALOGID 2000 // The dialog ID the script uses. Change if you encounter any conflicts. #define ADMIN_ONLY false // true = only RCON admins will be able to use the /carmenu command | false = everyone will be able to use the /gun command //------------------------------------------------------------------------------ // EDIT BELOW AT OWN RISK! //------------------------------------------------------------------------------ #define _ShowDialog(%0) ShowPlayerDialog(%0, DIALOGID, DIALOG_STYLE_LIST, "Guns Selection Menu v"#VERSION"", "Melee\nHandguns\nShotguns\nMachine pistols\nAssault rifles\nRifles\nHeavy artillery\nThrown\nHandheld\nGifts\nApparel Items (+ Life/Armour)", "Select", "Cancel") #if COMMAND_TYPE == ZCMD // Credits to Zeex for zcmd. #include #endif #if COMMAND_TYPE == DCMD // Credits to DracoBlue for dcmd. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 #endif //============================================================================== //============================================================================== public OnFilterScriptInit() { print("Guns Selection Menu v"#VERSION" has been loaded."); return 1; } public OnFilterScriptExit() { print("Guns Selection Menu v"#VERSION" has been unloaded."); return 1; } //============================================================================== #if COMMAND_TYPE == ZCMD CMD:gun(playerid, params[]) { #if ADMIN_ONLY == true if(!IsPlayerAdmin(playerid)) return 0; #endif _ShowDialog(playerid); return 1; } #endif #if COMMAND_TYPE == DCMD dcmd_gun(playerid, params[]) { #pragma unused params #if ADMIN_ONLY == true if(!IsPlayerAdmin(playerid)) return 0; #endif _ShowDialog(playerid); return 1; } #endif #if COMMAND_TYPE != ZCMD public OnPlayerCommandText(playerid, cmdtext[]) { #if COMMAND_TYPE == DCMD dcmd(gun, 3, cmdtext); #else if(!strcmp(cmdtext, "/gun")) { #if ADMIN_ONLY == true if(!IsPlayerAdmin(playerid)) return 0; #endif _ShowDialog(playerid); } #endif return 0; } #endif public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new cMenuString[408]; cMenuString = ""; //============================================================================== // Gun Menu //============================================================================== if(dialogid == DIALOGID && response) { switch(listitem) { case 0: ShowPlayerDialog(playerid, (DIALOGID + 1), DIALOG_STYLE_LIST, "Melee", "Brass Knuckles\nGolf club\nNitestick\nKnife\nBaseball bat\nShovel\nPool que\nKatana\nChainsaw\nCane\nBack", "Select", "Cancel"); case 1: ShowPlayerDialog(playerid, (DIALOGID + 2), DIALOG_STYLE_LIST, "Handguns", "Pistol\nSilenced 9mm\nDesert eagle\nBack", "Select", "Cancel"); case 2: ShowPlayerDialog(playerid, (DIALOGID + 3), DIALOG_STYLE_LIST, "Shotguns", "Shotgun\nSawn-off shotgun\nCombat shotgun\nBack", "Select", "Cancel"); case 3: ShowPlayerDialog(playerid, (DIALOGID + 4), DIALOG_STYLE_LIST, "Machine Pistols", "Mac-10\nMP5\nTec-9\nBack", "Select", "Cancel"); case 4: ShowPlayerDialog(playerid, (DIALOGID + 5), DIALOG_STYLE_LIST, "Assault Rifles", "AK-47\nM4\nBack", "Select", "Cancel"); case 5: ShowPlayerDialog(playerid, (DIALOGID + 6), DIALOG_STYLE_LIST, "Rifles", "Country rifle\nSniper rifle\nBack", "Select", "Cancel"); case 6: ShowPlayerDialog(playerid, (DIALOGID + 7), DIALOG_STYLE_LIST, "Heavy Artillery", "RPG\nHeat seeker\nFlamethrower\nBack", "Select", "Cancel"); case 7: ShowPlayerDialog(playerid, (DIALOGID + 8), DIALOG_STYLE_LIST, "Thrown", "Grenade\nTear gas\nMolotov cocktail\nRemote satchel\nDetonator\nBack", "Select", "Cancel"); case 8: ShowPlayerDialog(playerid, (DIALOGID + 9), DIALOG_STYLE_LIST, "Handheld", "Spray can\nFire extinguisher\nCamera\nBack", "Select", "Cancel"); case 9: ShowPlayerDialog(playerid, (DIALOGID + 10), DIALOG_STYLE_LIST, "Gifts", "Dildo 1\nDildo 2\nDildo 3\nDildo 4\nFlowers\nBack", "Select", "Cancel"); case 10: ShowPlayerDialog(playerid, (DIALOGID + 11), DIALOG_STYLE_LIST, "Apparel Items (+ Life/Armour)", "Night vision goggles\nThermal goggles\nParachute\nLife\nArmour\nBack", "Select", "Cancel"); } return 1; } //============================================================================== // Melee //============================================================================== if(dialogid == (DIALOGID + 1) && response) // Melee { switch(listitem) { case 0: GivePlayerWeapon(playerid, 1, 1); // Brass Knuckles case 1: GivePlayerWeapon(playerid, 2, 1); // Golf club case 2: GivePlayerWeapon(playerid, 3, 1); // Nitestick case 3: GivePlayerWeapon(playerid, 4, 1); // Knife case 4: GivePlayerWeapon(playerid, 5, 1); // Baseball bat case 5: GivePlayerWeapon(playerid, 6, 1); // Shovel case 6: GivePlayerWeapon(playerid, 7, 1); // Pool que case 7: GivePlayerWeapon(playerid, 8, 1); // Katana case 8: GivePlayerWeapon(playerid, 9, 1); // Chainsaw case 9: GivePlayerWeapon(playerid, 15, 20); // Cane case 10: _ShowDialog(playerid); } return 1; } //============================================================================== // Hand Guns //============================================================================== if(dialogid == (DIALOGID + 2) && response) // Hand Guns { switch(listitem) { case 0: GivePlayerWeapon(playerid, 22, 500); // Pistol case 1: GivePlayerWeapon(playerid, 23, 500); // Silenced 9mm case 2: GivePlayerWeapon(playerid, 24, 500); // Desert eagle case 3: _ShowDialog(playerid); } return 1; } //============================================================================== // Shotgun //============================================================================== if(dialogid == (DIALOGID + 3) && response) // Shotgun { switch(listitem) { case 0: GivePlayerWeapon(playerid, 25, 500); // Shotgun case 1: GivePlayerWeapon(playerid, 26, 500); // Sawn-off shotgun case 2: GivePlayerWeapon(playerid, 27, 500); // Combat shotgun case 3: _ShowDialog(playerid); } return 1; } //============================================================================== // Machine Pistols //============================================================================== if(dialogid == (DIALOGID + 4) && response) // Machine Pistols { switch(listitem) { case 0: GivePlayerWeapon(playerid, 28, 500); // mac 10 case 1: GivePlayerWeapon(playerid, 32, 500); // MP5 case 2: GivePlayerWeapon(playerid, 29, 500); // Tec-9 case 3: _ShowDialog(playerid); } return 1; } //============================================================================== // Assault Rifles //============================================================================== if(dialogid == (DIALOGID + 5) && response) // Assault Rifles { switch(listitem) { case 0: GivePlayerWeapon(playerid, 30, 500); // AK-47 case 1: GivePlayerWeapon(playerid, 31, 500); // M4 case 2: _ShowDialog(playerid); } return 1; } //============================================================================== // Rifles //============================================================================== if(dialogid == (DIALOGID + 6) && response) // Rifles { switch(listitem) { case 0: GivePlayerWeapon(playerid, 33, 500); // Country rifle case 1: GivePlayerWeapon(playerid, 34, 500); // Sniper rifle case 2: _ShowDialog(playerid); } return 1; } //============================================================================== // Heavy Artillery //============================================================================== if(dialogid == (DIALOGID + 7) && response) // Heavy Artillery { switch(listitem) { case 0: GivePlayerWeapon(playerid, 35, 500); // RPG case 1: GivePlayerWeapon(playerid, 36, 500); // Heat seeker case 2: GivePlayerWeapon(playerid, 37, 500); // Flamethrower case 3: _ShowDialog(playerid); } return 1; } //============================================================================== // Thrown //============================================================================== if(dialogid == (DIALOGID + 8) && response) // Thrown { switch(listitem) { case 0: GivePlayerWeapon(playerid, 16, 500); // Grenade case 1: GivePlayerWeapon(playerid, 17, 500); // Tear gas case 2: GivePlayerWeapon(playerid, 18, 500); // Molotov cocktail case 3: GivePlayerWeapon(playerid, 39, 500); // Remote satchel case 4: GivePlayerWeapon(playerid, 40, 500); // Detonator case 5: _ShowDialog(playerid); } return 1; } //============================================================================== // Handheld //============================================================================== if(dialogid == (DIALOGID + 9) && response) // Handheld { switch(listitem) { case 0: GivePlayerWeapon(playerid, 41, 500); // Spray can case 1: GivePlayerWeapon(playerid, 42, 500); // Fire extinguisher case 2: GivePlayerWeapon(playerid, 43, 500); // Camera case 3: _ShowDialog(playerid); } return 1; } //============================================================================== // Gifts //============================================================================== if(dialogid == (DIALOGID + 10) && response) // Gifts { switch(listitem) { case 0: GivePlayerWeapon(playerid, 10, 500); // Dildo 1 case 1: GivePlayerWeapon(playerid, 11, 500); // Dildo 2 case 2: GivePlayerWeapon(playerid, 12, 500); // Dildo 3 case 3: GivePlayerWeapon(playerid, 13, 500); // Dildo 4 case 4: GivePlayerWeapon(playerid, 14, 500); // Flowers case 5: _ShowDialog(playerid); } return 1; } //============================================================================== // Apparel Items //============================================================================== if(dialogid == (DIALOGID + 11) && response) // Apparel Items { switch(listitem) { case 0: GivePlayerWeapon(playerid, 44, 500); // Night vision goggles case 1: GivePlayerWeapon(playerid, 45, 500); // Thermal goggles case 2: GivePlayerWeapon(playerid, 46, 500); // Parachute case 3: SetPlayerHealth(playerid, 100); // Life case 4: SetPlayerArmour(playerid, 100.0); // Armour case 5: _ShowDialog(playerid); } return 1; } return 0; } //==============================================================================