3252533 发表于 2010-9-30 18:35:08

我这里有被手雷炸到会弹

我想加入VIP权限 B不知道能不能 ···求各位大大了!!

3252533 发表于 2010-9-30 20:57:47

源码:/* AMX Mod script.
*
* HE-CONC 1.0
*by ThantiK
*
*
* Description:
*Remember CONC jumping in TFC? -- This adds the knockback to the HE 'nades
*its great to set higher or lower depending on your wants.But definately
*adds some spunk to the game.
*
* Commands:
*CVAR - he_push, set higher or lower depending on the effect you want.
*
* Special Thanks:
*JGHG for the help with setting velocity, and for the code on getting HE coords.
*Ryan (War3 Expansion guy) for the mathematics and velocity stocks.
*/

#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, Float:fSpeed, Float:fVelocity )
{
    new Float:fEntOrigin;
    entity_get_vector( ent, EV_VEC_origin, fEntOrigin );

    // Velocity = Distance / Time

    new Float:fDistance;
    fDistance = fEntOrigin - fOrigin;
    fDistance = fEntOrigin - fOrigin;
    fDistance = fEntOrigin - fOrigin;

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

    fVelocity = fDistance / fTime;
    fVelocity = fDistance / fTime;
    fVelocity = fDistance / fTime;

    return ( fVelocity && fVelocity && fVelocity );
}


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

stock set_velocity_from_origin( ent, Float:fOrigin, Float:fSpeed )
{
    new Float:fVelocity;
    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
    entity_get_string(inflictor, EV_SZ_classname, classname2, 7)
    if (!equal(classname2, "grenade"))
      return PLUGIN_CONTINUE

    new Float:upVector
    upVector = float(read_data(4))
    upVector = float(read_data(5))
    upVector = float(read_data(6))

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

    return PLUGIN_CONTINUE
}

3252533 发表于 2010-9-30 20:58:40

请帮忙加速个权限谢谢了!!!!!!!!!

wk703 发表于 2011-4-2 17:55:01

收藏了 3q
页: [1]
查看完整版本: 我这里有被手雷炸到会弹