搜索
查看: 2014|回复: 9

麻烦帮我改个插件!

[复制链接]
发表于 2005-12-19 18:25:52 | 显示全部楼层 |阅读模式 来自 中国–广东–潮州
麻烦帮我修改这个插件一下,修改成暴头奖励1500$,其他奖励都不要!for amx的.
/*
*                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")
}
发表于 2005-12-19 18:39:54 | 显示全部楼层 来自 中国–广东–佛山–顺德区

回复: 麻烦帮我改个插件!

我也是一个菜鸟 :cold: ,不知道这样改可不可以
下面那段除了红色部分之外全部去掉,或者在前面加上//
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","1500") // 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

还有这一段枪支的不知道可不可以去掉
"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"
回复

使用道具 举报

 楼主| 发表于 2005-12-20 00:37:07 | 显示全部楼层 来自 中国–广东–潮州

回复: 麻烦帮我改个插件!

呵呵 ,你的想法跟我一样,我就是不知道这样一来改行不行,所以才到论坛来问问...
回复

使用道具 举报

 楼主| 发表于 2005-12-20 18:57:47 | 显示全部楼层 来自 中国–广东–潮州

回复: 麻烦帮我改个插件!

没人帮我,自己再顶一下.
回复

使用道具 举报

发表于 2005-12-20 20:21:16 | 显示全部楼层 来自 中国–河北–石家庄

回复: 麻烦帮我改个插件!

。。。 应该自己多做测试,不过我也不会改,进来学习一下,关注中~~~:burn:
回复

使用道具 举报

 楼主| 发表于 2005-12-20 21:32:02 | 显示全部楼层 来自 中国–广东–潮州

回复: 麻烦帮我改个插件!

呵呵,,如果会我就不用在这论坛求助了,怪自己当时编程不学好!! :brick:
回复

使用道具 举报

 楼主| 发表于 2005-12-22 17:38:07 | 显示全部楼层 来自 中国–广东–潮州

回复: 麻烦帮我改个插件!

试试这个  


重复的发贴没有任何意义

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2005-12-23 13:55:04 | 显示全部楼层 来自 中国–广东–潮州

回复: 麻烦帮我改个插件!

其实我也不想重复发贴,但就是真的喜欢这个插件...828..谢谢 你!!!!
不过我的是amx,有没源码或你编译好的amx!! :cry:
回复

使用道具 举报

发表于 2005-12-24 00:38:57 | 显示全部楼层 来自 中国–广西–贵港

回复: 麻烦帮我改个插件!

我看不懂~可是我会支持~
回复

使用道具 举报

 楼主| 发表于 2005-12-26 17:18:08 | 显示全部楼层 来自 中国–广东–潮州

回复: 麻烦帮我改个插件!

wzf828,我需要AMX的,,麻烦麻烦了。。等你啊。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表