- 听众
- 收听
- 积分
- 3894
- 主题
- 回帖
- 0
- 精华
注册时间2008-4-22
最后登录1970-1-1
该用户从未签到
|
发表于 2010-5-10 21:12:39
|
显示全部楼层
- #include <amxmodx>
- #include <fun>
- #include <cstrike>
- #define PLUGIN "weapons"
- #define VERSION "1.0"
- #define AUTHOR "SchlumPF"
- new g_WeaponUsed[33]
- new kz_maxspeedmsg
- new g_MaxBPAmmo[31] = {
- 0,
- 52, //CSW_P228
- 0,
- 90, //CSW_SCOUT
- 1, //CSW_HEGRENADE
- 32, //CSW_XM1014
- 1, //CSW_C4
- 100,//CSW_MAC10
- 90, //CSW_AUG
- 1, //CSW_SMOKEGRENADE
- 120,//CSW_ELITE
- 100,//CSW_FIVESEVEN
- 100,//CSW_UMP45
- 90, //CSW_SG550
- 90, //CSW_GALIL
- 90, //CSW_FAMAS
- 100,//CSW_USP
- 120,//CSW_GLOCK18
- 30, //CSW_AWP
- 120,//CSW_MP5NAVY
- 200,//CSW_M249
- 32, //CSW_M3
- 90, //CSW_M4A1
- 120,//CSW_TMP
- 90, //CSW_G3SG1
- 2, //CSW_FLASHBANG
- 35, //CSW_DEAGLE
- 90, //CSW_SG552
- 90, //CSW_AK47
- 0, //CSW_KNIFE
- 100//CSW_P90
- }
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- kz_maxspeedmsg = register_cvar("kz_maxspeedmsg","1")
- register_clcmd("say /weapons","weapons")
- register_event("CurWeapon","curweapon","be")
- }
- public curweapon(id) {
- new WeaponNum = read_data(2)
- new WeaponActive = read_data(1)
- if (WeaponNum && g_MaxBPAmmo[WeaponNum])
- {
- cs_set_user_bpammo(id, WeaponNum, g_MaxBPAmmo[WeaponNum])
- }
- // give_item(id,"ammo_45acp")
- if ((WeaponNum != g_WeaponUsed[id]) && WeaponActive) // if weapon has changed and its the active weapon continue
- {
- g_WeaponUsed[id] = WeaponNum
- if(get_pcvar_num(kz_maxspeedmsg) == 1) {
- new clip, ammo
- switch(get_user_weapon(id,clip,ammo))
- {
- case CSW_SCOUT: clmsg(id,"This weapons maxspeed is 260")
- case CSW_C4: clmsg(id,"This weapons maxspeed is 250")
- case CSW_P228: clmsg(id,"This weapons maxspeed is 250")
- case CSW_MAC10: clmsg(id,"This weapons maxspeed is 250")
- case CSW_MP5NAVY: clmsg(id,"This weapons maxspeed is 250")
- case CSW_USP: clmsg(id,"This weapons maxspeed is 250")
- case CSW_TMP: clmsg(id,"This weapons maxspeed is 250")
- case CSW_FLASHBANG: clmsg(id,"This weapons maxspeed is 250")
- case CSW_DEAGLE: clmsg(id,"This weapons maxspeed is 250")
- case CSW_GLOCK18: clmsg(id,"This weapons maxspeed is 250")
- case CSW_SMOKEGRENADE: clmsg(id,"This weapons maxspeed is 250")
- case CSW_ELITE: clmsg(id,"This weapons maxspeed is 250")
- case CSW_FIVESEVEN: clmsg(id,"This weapons maxspeed is 250")
- case CSW_UMP45: clmsg(id,"This weapons maxspeed is 250")
- case CSW_HEGRENADE: clmsg(id,"This weapons maxspeed is 250")
- case CSW_KNIFE: clmsg(id,"This weapons maxspeed is 250")
- case CSW_P90: clmsg(id,"This weapons maxspeed is 245")
- case CSW_XM1014: clmsg(id,"This weapons maxspeed is 240")
- case CSW_AUG: clmsg(id,"This weapons maxspeed is 240")
- case CSW_GALIL: clmsg(id,"This weapons maxspeed is 240")
- case CSW_FAMAS: clmsg(id,"This weapons maxspeed is 240")
- case CSW_SG552: clmsg(id,"This weapons maxspeed is 235")
- case CSW_M3: clmsg(id,"This weapons maxspeed is 230")
- case CSW_M4A1: clmsg(id,"This weapons maxspeed is 230")
- case CSW_AK47: clmsg(id,"This weapons maxspeed is 221")
- case CSW_M249: clmsg(id,"This weapons maxspeed is 220")
- case CSW_G3SG1: clmsg(id,"This weapons maxspeed is 210")
- case CSW_SG550: clmsg(id,"This weapons maxspeed is 210")
- case CSW_AWP: clmsg(id,"This weapons maxspeed is 210")
- }
- }
- }
- return PLUGIN_HANDLED
- }
- public weapons(id) {
- if(is_user_alive(id)) {
- new bool:weaponsgiven
- if(!user_has_weapon(id,CSW_KNIFE))
- give_item(id,"weapon_knife")
- if(!user_has_weapon(id,CSW_USP)) {
- give_item(id,"weapon_usp")
- }
- if(!user_has_weapon(id,CSW_SCOUT)) {
- give_item(id, "weapon_scout")
- weaponsgiven = true
- }
- if(!user_has_weapon(id,CSW_P90)) {
- give_item(id, "weapon_p90")
- weaponsgiven = true
- }
- if(!user_has_weapon(id,CSW_FAMAS)) {
- give_item(id, "weapon_famas")
- weaponsgiven = true
- }
- if(!user_has_weapon(id,CSW_SG552)) {
- give_item(id, "weapon_sg552")
- weaponsgiven = true
- }
- if(!user_has_weapon(id,CSW_M4A1)) {
- give_item(id, "weapon_m4a1")
- weaponsgiven = true
- }
- if(!user_has_weapon(id,CSW_M249)) {
- give_item(id, "weapon_m249")
- weaponsgiven = true
- }
- if(!user_has_weapon(id,CSW_AK47)) {
- give_item(id, "weapon_ak47")
- weaponsgiven = true
- }
- if(!user_has_weapon(id,CSW_AWP)) {
- give_item(id, "weapon_awp")
- weaponsgiven = true
- }
- if(weaponsgiven) {
- clmsg(id, "You were given some weapons with different speed")
- }
- }
- else {
- clmsg(id, "You have to be alive to use this function")
- }
- return PLUGIN_HANDLED
- }
- public clmsg(index,const message[]) {
- set_hudmessage(255,255,255, -1.0, 0.85,0,6.0, 1.5,0.0,0.0,1)
- show_hudmessage(index,message)
- return PLUGIN_HANDLED
- }
复制代码 |
|