搜索
查看: 2195|回复: 2

[AMXX 带源码] 手雷跳插件

[复制链接]
发表于 2010-8-24 15:07:39 | 显示全部楼层 |阅读模式 来自 中国–湖北–宜昌
就是手雷可以将人炸飞,可以调整插件的威力,可以让人飞得更高,小心摔死哦!
附件:

本帖子中包含更多资源

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

×
发表于 2010-8-25 22:37:09 | 显示全部楼层 来自 中国–浙江–嘉兴–海宁市
还原创! 晕! 这个是你写的啊!上个东西别人下还要扣钱。 你不会直接发原码啊!
我上个原码吧!
amx_heconc.sma
---------------------------------------------


#include <amxmodx>
#include <amxmisc>
#include <engine>

#define SPEED 800.0

public plugin_init() {
    register_plugin("HE Knockback", "1.0", "ThantiK")
    register_event("Damage", "hedamage_event", "b", "2!0", "4!0", "5!0", "6!0")
    register_cvar("he_push","20.0")
}

stock get_velocity_from_origin( ent, Float:fOrigin[3], Float:fSpeed, Float:fVelocity[3] )
{
    new Float:fEntOrigin[3];
    entity_get_vector( ent, EV_VEC_origin, fEntOrigin );

    // Velocity = Distance / Time

    new Float:fDistance[3];
    fDistance[0] = fEntOrigin[0] - fOrigin[0];
    fDistance[1] = fEntOrigin[1] - fOrigin[1];
    fDistance[2] = fEntOrigin[2] - fOrigin[2];

    new Float:fTime = ( vector_distance( fEntOrigin,fOrigin ) / fSpeed );

    fVelocity[0] = fDistance[0] / fTime;
    fVelocity[1] = fDistance[1] / fTime;
    fVelocity[2] = fDistance[2] / fTime;

    return ( fVelocity[0] && fVelocity[1] && fVelocity[2] );
}


// Sets velocity of an entity (ent) away from origin with speed (speed)

stock set_velocity_from_origin( ent, Float:fOrigin[3], Float:fSpeed )
{
    new Float:fVelocity[3];
    get_velocity_from_origin( ent, fOrigin, fSpeed, fVelocity )

    entity_set_vector( ent, EV_VEC_velocity, fVelocity );

    return ( 1 );
}

public hedamage_event(id) {
    if(!is_user_connected(id))
       return PLUGIN_CONTINUE
    new MAXPLAYERS
    MAXPLAYERS = get_maxplayers()

    new inflictor = entity_get_edict(id, EV_ENT_dmg_inflictor)
    if (inflictor <= MAXPLAYERS)
        return PLUGIN_CONTINUE
    if(!is_valid_ent(inflictor))
       return PLUGIN_CONTINUE
    new classname2[8]
    entity_get_string(inflictor, EV_SZ_classname, classname2, 7)
    if (!equal(classname2, "grenade"))
        return PLUGIN_CONTINUE

    new Float:upVector[3]
    upVector[0] = float(read_data(4))
    upVector[1] = float(read_data(5))
    upVector[2] = float(read_data(6))

    new damagerept = read_data(2)
    set_velocity_from_origin(id, upVector, get_cvar_float("he_push")*damagerept)

    return PLUGIN_CONTINUE
}
回复

使用道具 举报

发表于 2010-8-25 23:52:49 | 显示全部楼层 来自 中国–香港
謝謝發源!{:2_45:}
回复

使用道具 举报

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

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