|
楼主 |
发表于 2009-9-6 10:46:17
|
显示全部楼层
来自 中国–湖北
源码如下 /*
* AMXMODX script.
* Weapon Money Reward v0.6
* by Similar
* This file is provided as is..
* (no warranties)
*
* Thanks to Kobri for the great idea ! :)
*
* *******************************************************************************
*
* Ported By KingPin( kingpin@onexfx.com ). I take no responsibility
* for this file in any way. Use at your own risk. No warranties of any kind.
*
* *******************************************************************************
*
* Version log
* .2 : Maintained by Similar
*
* .3 : Maintained by KingPin (for now)
* Ported to AMXX
*
* .4 : Added 1.6 weapons
*
* .5 : Made fully amxx compatible with get_basedir
*
* .6 : Made amxmodx .2 compatible with get_configsdir
* changed directory to /addons/amxmodx/configs/wp/
* made more room for longer directory names
*
*
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new hsBonus = 0
new rsBonus = 0
new vmBonus = 0
new pActive = 1
new wpnMoney[27]
new plrReward[33]
new wpnStr[27][10] = {
"",
"grenade","knife","glock18","deagle","usp",
"p228","fiveseven","m3","xm1014",
"mp5navy","tmp","p90","ump45",
"m4a1","aug","scout","awp","sg550",
"m249","elite","ak47","mac10",
"sg552","g3sg1","galil","famas"
}
public init(){
hsBonus = get_cvar_num("amx_headshot_bonus")
rsBonus = get_cvar_num("amx_respawn_money")
vmBonus = get_cvar_num("amx_victmoney_bonus")
pActive = get_cvar_num("amx_mreward_active")
new tmp[30]
for (new i = 0; i < 27; i++) {
tmp = "amx_"
add(tmp,30,wpnStr)
add(tmp,30,"_kill")
wpnMoney = get_cvar_num(tmp)
}
return PLUGIN_CONTINUE
}
public player_death() {
if (pActive == 0) return PLUGIN_CONTINUE
new kWeapon[10]
read_data(4,kWeapon,10)
new killer = read_data(1)
new victim = read_data(2)
new hShot = read_data(3)
if (killer != victim) {
new kMoney = cs_get_user_money(killer)
new vMoney = cs_get_user_money(victim)
kMoney -= 300
cs_set_user_money(killer,kMoney)
new vmLost = 0
if (vmBonus > 0) vmLost = (vMoney * vmBonus) / 100
vMoney += (rsBonus - vmLost)
cs_set_user_money(victim,vMoney)
kMoney = 0
new mReward = 0
for (new i = 1; i < 27; i++) {
if (equal(kWeapon,wpnStr)) {
mReward = wpnMoney
i = 26
}
}
new hsReward = 0
new mmsg[20]
if (hShot) {
if (hsBonus > 0) hsReward = (mReward * hsBonus) / 100
kMoney += hsReward
}
if (mReward > 0) kMoney += mReward
if (vmBonus > 0) kMoney += vmBonus
plrReward[killer] += kMoney
format(mmsg,30,"Kill: +$%i^nTotal: %i",kMoney,plrReward[killer])
set_hudmessage(100,230,0,0.80,0.65,2,0.02,4.0,0.01,3.0,2)
show_hudmessage(killer,mmsg)
}
return PLUGIN_CONTINUE
}
public give_money(id) {
if (plrReward[id] > 0) {
new vMoney = cs_get_user_money(id)
set_hudmessage(100,230,0,0.80,0.30,2,0.02,4.0,0.01,0.1,2)
show_hudmessage(id,"+$%i",plrReward[id])
vMoney += plrReward[id]
plrReward[id] = 0
if (vMoney > 16000) vMoney = 16000
cs_set_user_money(id,vMoney)
}
return PLUGIN_CONTINUE
}
public user_connect(id) {
plrReward[id] = 0
return PLUGIN_CONTINUE
}
public user_disconnect(id) {
plrReward[id] = 0
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("WeaponMoney","0.6","Similar")
register_event("StatusIcon","give_money","be","2=buyzone")
register_event("DeathMsg","player_death","a")
register_cvar("amx_mreward_active","1") // plugin is active
register_cvar("amx_knife_kill","2500") // Knife
register_cvar("amx_grenade_kill","1500") // HE Grenade
register_cvar("amx_glock18_kill","1250") // Glock 18
register_cvar("amx_deagle_kill","1000") // IMI Desert Eagle
register_cvar("amx_usp_kill","1000") // Hechkler & Koch USP45
register_cvar("amx_p228_kill","950") // Sig Sauer P-228
register_cvar("amx_fiveseven_kill","1200") // Fabrique Nationale Five-Seven
register_cvar("amx_m3_kill","750") // Benelli M3 Super 90
register_cvar("amx_xm1014_kill","750") // Benelli XM1014
register_cvar("amx_mp5navy_kill","750") // Heckler & Koch MP5/Navy
register_cvar("amx_tmp_kill","700") // Steyr Tactical Mashine Pistol
register_cvar("amx_p90_kill","680") // Fabrique Nationale P90
register_cvar("amx_ump45_kill","680") // Heckler & Koch UMP45
register_cvar("amx_m4a1_kill","550") // Colt M4A1
register_cvar("amx_aug_kill","500") // Steyr AUG
register_cvar("amx_scout_kill","320") // Steyr Scout
register_cvar("amx_awp_kill","150") // Accuracy Int. Arctic Warfare/Magnum(AWM)
register_cvar("amx_sg550_kill","450") // Sig SG550 Commando
register_cvar("amx_m249_kill","500") // FN M249 Para
register_cvar("amx_elite_kill","900") // Dual Beretta 96G Elites
register_cvar("amx_ak47_kill","500") // aAutomat Kalashnikov AK47
register_cvar("amx_galil_kill","700") // Galil
register_cvar("amx_famas_kill","800") // Famas
register_cvar("amx_mac10_kill","600") // Ingram MAC10
register_cvar("amx_sg552_kill","500") // Sig SG-552 Commando
register_cvar("amx_g3sg1_kill","400") // Heckler & Koch G3/SG-1
register_cvar("amx_headshot_bonus","50") // as percent of money reward
register_cvar("amx_victmoney_bonus","10") // as percent of victim money
register_cvar("amx_respawn_money","1000") // + money when player respawn
new configsDir[84]
get_configsdir(configsDir, 83)
server_cmd("exec %s/wp/weaponmoney.cfg", configsDir)
set_task(1.0,"init",7512,"",0,"a")
} |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|