|
發表於 12-4-2008 17:28:39
|
顯示全部樓層
/* AMX MOD X script.
*
* Weapon Storage version 1.1, by KinSprite
*
* [Description]:
*
* With this plugin, you can drop a weapon model that can provide a number of weapons each round.
*
* When a player touch this entity, he may get a weapon/item on condition that such as touch
* a weapon in fy_iceworld. Also, you can set the cvar to allow multi weapons .
*
* A storage has two parameters . 1, belong to which team (Terrorist, CT or All teams); 2, provide
* how many weapons in this model.
*
* You can save these options in map config file loaded when change map.
*
* The menu command "ws_menu" is powerful. You can drop a storage in front of you ; remove a storage
* aimed at; remove all storages in the map; clear storage options saved in the map config file.
*
*
* [Required Modules]:
*
* 1. Engine
* 2. Fun
* 3. Cstrike
*
* [Installation]:
*
* 1. copy weaponstorage.sam to "addons/amxmodx/amxmodx/scripting"; "weaponstorage.txt" to "<amxx_datadir> (default is "addons/amxmodx/data")/lang"
* 2. compile weaponstorage.sam
* 3. copy "addons/amxmodx/scripting/compiled/weaponstorage.amxx" to <amxx_pluginsdir> (default is "addons/amxmodx/plugins")
* 4. in <amxx_plugins> (default is "addons/amxmodx/configs/plugins.ini") add a line "weaponstorage.amxx"
* 5. in "<amxx_configsdir>(default is "addons/amxmodx/configs")/amxx.cfg" config the Cvars.
*
* [Commands]:
*
* [Admin CMD]
*
* ws_menu
* // - Show Weapon Storage Menu
*
* amx_weaponstorage_menu
* // - Show Weapon Storage Menu, the same as "ws_menu"
*
* amx_weaponstorage_drop
* // - Drop weapons in world and Save for the map?
* // [USAGE]: amx_weaponstorage_drop <wpnID> <team> <amount> [SAVE]
*
* amx_weaponstorage_clear
* // - Clear weapon storages in the map
*
* amx_weaponstorage_clmapcfg
* // - Clear weapon storages' option in the map config file
*
*
* [Server CMD]
*
* amx_createweaponstorage
* // - Drop weapons in world
* // amx_createweaponstorage <wpnID> <team> <amount> <Float:Origin[3]> <Float:Angles[3]>
*
* [Cvars]:
*
* amx_weaponstorage "1"
* // Use this plugin's effect. To disable, set to 0
* amx_weaponstorage_allowmulti "0"
* // allow muti weapons, set to 1
* amx_weaponstorage_c4ct "0"
* // allow CT pick up C4 in C4 storage, set to 1
* amx_weaponstorage_ctplant "0"
* // allow CT plant C4 when pick up C4 in C4 storage, set 1
* amx_weaponstorage_kitt "0"
* // allow Terrorist pick up defuse kit in kit storage, set 1
*
* [Log]:
*
* v1.1, add item Nightvision Goggles
* use cs_get_user_shield() instead of custom stock function.
* use register_touch() instead of pfn_touch(), and optimize this function.
* use static flag ADMIN_IMMUNITY instead.
*
* v1.0, finished on 9/18, 2006
*
*
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <cstrike>
new const PLUGIN_NAME[] = "Weapon Storage"
new const PLUGIN_VERSION[] = "1.1"
new const PLUGIN_AUTHOR[] = "KinSprite"
#define CSW_SHIELD 2
#define ITEM_NVG 33
#define ITEM_DEFUSEKIT 34
#define ITEM_LONGJUMP 35
#define ITEM_MEDICALKIT 36
#define ITEM_BATTERY 37
#define NROFITEMS 38
// Globals
new const WEAPONNAME[NROFITEMS][] = {
"", // 0 First should be empty
"SIG P228", // 1 CSW_P228
"Tactical Shield", // 2 shield
"Steyr Scout", // 3 CSW_SCOUT
"HE Grenade", // 4 CSW_HEGRENADE
"Benelli XM1014", // 5 CSW_XM1014
"C4 Time Bomb", // 6 CSW_C4
"Ingram MAC-10", // 7 CSW_MAC10
"Steyr Aug", // 8 CSW_AUG
"Smoke Grenade", // 9 CSW_SMOKEGRENADE
"Dual Beretta 96G Elite", // 10 CSW_ELITE
"FN Five-Seven", // 11 CSW_FIVESEVEN
"H&K UMP45", // 12 CSW_UMP45
"Sig SG-550 Sniper", // 13 CSW_SG550
"Galil", // 14 CSW_GALIL
"Famas", // 15 CSW_FAMAS
"H&K USP .45 Tactical", // 16 CSW_USP
"Glock18 Select Fire", // 17 CSW_GLOCK18
"AI Arctic Warfare/Magnum", // 18 CSW_AWP
"H&K MP5-Navy", // 19 CSW_MP5NAVY
"FN M249 Para", // 20 CSW_M249
"Benelli M3 Super90", // 21 CSW_M3
"Colt M4A1 Carbine", // 22 CSW_M4A1
"Steyr Tactical Machine Pistol",// 23 CSW_TMP
"H&K G3/SG-1 Sniper Rifle", // 24 CSW_G3SG1
"Flashbang", // 25 CSW_FLASHBANG
"Desert Eagle .50AE", // 26 CSW_DEAGLE
"Sig SG-552 Commando", // 27 CSW_SG552
"AK-47", // 28 CSW_AK47
"Knife", // 29 CSW_KNIFE
"FN P90", // 30 CSW_P90
"Kevlar Vest", // 31 CSW_VEST
"Kevlar Vest & Helmet", // 32 CSW_VESTHELM
"Nightvision Goggles", // 33 item Nightvision Goggles
"Defuse Kit", // 34 defuser
"Long Jump", // 35 item Long Jump
"Medical Kit", // 36 item Medical Kit
"Battery" // 37 item battery
};
new const WEAPONSTRINGS[NROFITEMS][] = {
"", // 0 First should be empty
"weapon_p228",
"weapon_shield", // 2 shield
"weapon_scout",
"weapon_hegrenade", // 4 CSW_HEGRENADE
"weapon_xm1014",
"weapon_c4", // 6 CSW_C4
"weapon_mac10",
"weapon_aug",
"weapon_smokegrenade", // 9 CSW_SMOKEGRENADE
"weapon_elite",
"weapon_fiveseven",
"weapon_ump45",
"weapon_sg550",
"weapon_galil",
"weapon_famas",
"weapon_usp",
"weapon_glock18",
"weapon_awp",
"weapon_mp5navy",
"weapon_m249",
"weapon_m3",
"weapon_m4a1",
"weapon_tmp",
"weapon_g3sg1",
"weapon_flashbang", // 25 CSW_FLASHBANG
"weapon_deagle",
"weapon_sg552",
"weapon_ak47",
"weapon_knife", // 29 CSW_KNIFE
"weapon_p90",
"item_kevlar", // 31 CSW_VEST
"item_assaultsuit", // 32 CSW_VESTHELM
"", // 33 item Nightvision Goggles
"item_thighpack", // 34 defuser
"item_longjump", // 35 item Long Jump
"item_healthkit", // 36 item Medical Kit
"item_battery" // 37 item battery
};
new const WEAPONMODEL[NROFITEMS][] = {
"", // 0 First should be empty
"w_p228",
"w_shield", // 2 shield
"w_scout",
"w_hegrenade", // 4 CSW_HEGRENADE
"w_xm1014",
"w_backpack", // 6 CSW_C4
"w_mac10",
"w_aug",
"w_smokegrenade", // 9 CSW_SMOKEGRENADE
"w_elite",
"w_fiveseven",
"w_ump45",
"w_sg550",
"w_galil",
"w_famas",
"w_usp",
"w_glock18",
"w_awp",
"w_mp5",
"w_m249",
"w_m3",
"w_m4a1",
"w_tmp",
"w_g3sg1",
"w_flashbang", // 25 CSW_FLASHBANG
"w_deagle",
"w_sg552",
"w_ak47",
"w_knife", // 29 CSW_KNIFE
"w_p90",
"w_kevlar", // 31 CSW_VEST
"w_assault", // 32 CSW_VESTHELM
"p_tripmine", // 33 item Nightvision Goggles
"w_thighpack", // 34 defuser
"w_longjump", // 35 item Long Jump
"w_medkit", // 36 item Medical Kit
"w_battery" // 37 item battery
};
new const AMMO_IN_BACKPACK[NROFITEMS] = {
0, // 0 First should be empty
52, // 1 CSW_P228
0, // 2 shield
90, // 3 CSW_SCOUT
0, // 4 CSW_HEGRENADE
32, // 5 CSW_XM1014
0, // 6 CSW_C4
100, // 7 CSW_MAC10
90, // 8 CSW_AUG
0, // 9 CSW_SMOKEGRENADE |
|