搜索
查看: 3139|回复: 7

[AMXX 带源码] 有没有限制买几把awp的??

[复制链接]
发表于 2009-3-12 14:31:43 | 显示全部楼层 |阅读模式 来自 中国–河南–郑州
就是  ct   t   每局只能买几把awp的
找了好半天。。。
发表于 2009-3-12 19:25:09 | 显示全部楼层 来自 中国–辽宁–沈阳
搜索awplimit.amxx就是
回复

使用道具 举报

发表于 2009-3-12 19:26:46 | 显示全部楼层 来自 中国–辽宁–沈阳
才看着这个帖子里就有
超级AMXX1.8.1版的编译器[带:1000个SMA原文件]
回复

使用道具 举报

 楼主| 发表于 2009-3-12 22:56:42 | 显示全部楼层 来自 中国–河南–信阳
/* AMX Mod script.
*
* AWP Limit 0.21
*  by JustinHoMi
*
* Allows no more than 2 awps per team
*
*/

#include <amxmod>

#define MAXAWPS 2

new plist[32] = { 0, ... }        // 0 = no awp; 1 = carrying awp
new awp_count[3]                        // 1 = T; 2 = CT

/* handles restricting the menu */
public menu_awp(id,key) {
        new team = get_user_team(id)
        if(awp_count[team] >= MAXAWPS)
        {
                engclient_cmd(id,"menuselect","10")
                client_print(id,print_center,"Too many people on your team have awp")
                return PLUGIN_HANDLED
        }
        return PLUGIN_CONTINUE
}

/* handles when a player drops their weapon */
public handle_drop(id) {
        if (plist[id] == 1)
        {
                new tmp1,tmp2
                new curweapon = get_user_weapon(id,tmp1,tmp2)

                if (curweapon == 18)
                {
                        plist[id] = 0
                        new team = get_user_team(id)
                        awp_count[team]--
                }
        }
        return PLUGIN_CONTINUE
}

/* handles when a player picks up an awp */
public handle_pickup(id) {

        new team = get_user_team(id)
        if (awp_count[team] >= MAXAWPS)
        {
                new id_s[3]
                numtostr(id,id_s,3)
                set_task(0.1,"delayed_drop",0,id_s,3)
        }
        else
        {
                plist[id] = 1
                awp_count[team]++
        }
}

/* delays the drop slightly to give the server time to register that they picked up an awp */
public delayed_drop(id_s[])
{
        new idx = strtonum(id_s)
        client_print(idx,print_center,"Too many people on your team have awp")
        engclient_cmd(idx,"drop")
}

/* removes awp when player dies */
public handle_death() {
        new idx = read_data(2)

        if(plist[idx] == 1)
        {
                new team = get_user_team(idx)
                awp_count[team]--

                plist[idx] = 0
        }
}

/* clear vars when player connects */
public client_connect(id) {
        plist[id] = 0 // just to make sure
}

/* clear vars when player disconnects */
public client_disconnect(id) {
        if (plist[id] == 1)
        {
                new team = get_user_team(id)
                awp_count[team]--
        }
        plist[id] = 0
}

public plugin_init(){
    register_plugin("AWP Limit","0.21","JustinHoMi")
    register_menucmd(-31,1<<5,"menu_awp")
    register_clcmd("drop","handle_drop")
    register_event("WeapPickup","handle_pickup","b","1=18")
    register_event("DeathMsg","handle_death","a")
    return PLUGIN_CONTINUE
}
这是那个源码 找了半天 在哪修改数量。。。
回复

使用道具 举报

 楼主| 发表于 2009-3-13 11:48:58 | 显示全部楼层 来自 中国–河南–郑州
这个 不需要在 amxx。cfg  在设置什么了吗???
回复

使用道具 举报

 楼主| 发表于 2009-3-13 14:13:49 | 显示全部楼层 来自 中国–河南–郑州
awplimit.amxx  这个插件是怎么计算的???

ct t 各2把吗??
加载了不能用。。。
回复

使用道具 举报

发表于 2009-3-13 19:22:17 | 显示全部楼层 来自 中国–广东–中山
回复

使用道具 举报

发表于 2010-2-14 20:28:18 | 显示全部楼层 来自 中国–北京–北京
顶    这么好i
回复

使用道具 举报

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

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