搜索
查看: 1844|回复: 2

请金闪闪及各位大人帮助看一下这个AMX原码,问题出在那里,我为什么编译不上运行不了!

[复制链接]
发表于 2005-1-8 14:10:16 | 显示全部楼层 |阅读模式 来自 中国–黑龙江–齐齐哈尔
//   amx_girlthrow <authid, nick or #userid> [time]
//   amx_ungirlthrow <authid, nick or #userid>
// cvars:
//   amx_girlthrow 0 or 1 - makes all players throw like a girl

#include <amxmod>
#include <amxmisc>
#include <xtrafun>

new const HEGRENADE_MODEL[] = "models/w_hegrenade.mdl"
new girlthrow[33]

public grenid(parm[]){
        new id = parm[0]
        new string[32], grenadeid = 0
        do
        {
                grenadeid = get_grenade_id(id, string, 31, grenadeid)
        }
        while (grenadeid &&!equali(HEGRENADE_MODEL,string));

        if (grenadeid)
        {
                new grenage_vel[3]
                grenage_vel[0] = 0
                grenage_vel[1] = 0
                grenage_vel[2] = 0
                set_entity_velocity(grenadeid, grenage_vel)
        }

}

public TextMsg(id){
        new cvar = get_cvar_num("amx_girlthrow")
        if (!girlthrow[id] && !cvar) return PLUGIN_CONTINUE
       
        new name[32]
        read_data(3, name, 31)
        if (id==find_player("a",name))
        {
                new parm[1]
                parm[0] = id
                set_task(0.001,"grenid",50,parm,1)
        }
       
        return PLUGIN_CONTINUE
}

public amx_girlthrow(id,level,cid) {
    if (!cmd_access(id,level,cid,3))
        return PLUGIN_HANDLED

    new arg[32]
    read_argv(1,arg,31)
    new player = cmd_target(id,arg,1)
    if (!player) return PLUGIN_HANDLED
       
    girlthrow[player] = 1
       
    new sthrowtime[8]
    read_argv(2,sthrowtime,7)
    new Float:throwtime = floatstr(sthrowtime)
       
    new param[2]
    param[0] = player
    new name[32]
    get_user_name(player, name , 31)
    set_task( throwtime ? throwtime : 99999.0 ,"ungirlthrow",player,param,1)
    set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
    show_hudmessage(0,"%s throws like a girl!",name)
    return PLUGIN_HANDLED
}


public ungirlthrow(param[]) {
    new id = param[0]
    if (!girlthrow[id]) return PLUGIN_HANDLED
    girlthrow[id] = 0
        new name[32]
    get_user_name(id, name , 31)
    set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
    show_hudmessage(0,"%s no longer throws like a girl.",name)
    return PLUGIN_HANDLED
}

public amx_ungirlthrow(id,level,cid) {
    if (!cmd_access(id,level,cid,2))
        return PLUGIN_HANDLED
    new arg[32]
    read_argv(1,arg,31)
    new player = cmd_target(id,arg,1)
    if (!player) return PLUGIN_HANDLED
    new param[2]
    param[0] = player
    ungirlthrow(param)
    return PLUGIN_HANDLED
}

public client_disconnect(id) {
    new param[2]
    param[0] = id
    ungirlthrow(param)
    return PLUGIN_CONTINUE
}

public plugin_init()
{
        register_plugin("Throw Like a Girl","0.1","blah")
        register_cvar("amx_girlthrow","0")
        register_concmd("amx_girlthrow","amx_girlthrow",ADMIN_LEVEL_A,"<authid, nick or #userid> [time]")
    register_concmd("amx_ungirlthrow","amx_ungirlthrow",ADMIN_LEVEL_A,"<authid, nick or #userid>")
    register_event("TextMsg","TextMsg","b","2&#Game_radio", "4&#Fire_in_the_hole")
        return PLUGIN_CONTINUE
}

注:是AMX 插件,能在AMX 0.97上运行就可!
发表于 2005-1-8 19:06:03 | 显示全部楼层 来自 中国–陕西–西安
麻烦帖一下你编译时的提示
回复

使用道具 举报

发表于 2005-1-9 14:39:24 | 显示全部楼层 来自 中国–福建–龙岩
如果没猜错的话,是提示你少了xtrafun.h文件。 :43:
回复

使用道具 举报

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

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