20061234 发表于 2011-3-13 17:02:20

如何如何设没攻击力 但有效果

//#define USE_AMX

#if defined USE_AMX
#include <amxmod>
#include <VexdUM>
#else
#include <amxmodx>
#include <engine>
#endif

new gMsgScreenShake , gMsgScreenFade;

#define CVAR_STATUS "he_damage_effect"

public plugin_init() {
register_plugin("HE damage effect" , "0.2" , "v3x");
register_event("Damage" , "event_Damage" , "b" , "2>0");
register_cvar(CVAR_STATUS , "1");
gMsgScreenShake = get_user_msgid("ScreenShake");
gMsgScreenFade = get_user_msgid("ScreenFade");
}

#if defined USE_AMX
#define DEFAULT_VOLUME 0.8
#endif

#define PA_LOW25.0
#define PA_HIGH 50.0

#if !defined USE_AMX
new Float:gVolume;

public client_connect(id) {
if(!is_user_bot(id)) {
    query_client_cvar(id , "volume" , "cvar_result");
}
}

public cvar_result(id, const cvar[] , const value[]) {
gVolume = str_to_float(value);
}
#endif

public event_Damage(id) {
if(get_cvar_num(CVAR_STATUS) <= 0
|| !is_user_connected(id)
|| !is_user_alive(id)
|| is_user_bot(id)) return;
new iWeapID, attacker = get_user_attacker(id , iWeapID);
if(!is_user_connected(attacker)) return;
if(iWeapID == 4) {
    client_cmd(id , "volume 0");
    set_task(0.5 , "volume_up_1" , id);
    new Float:fVec;
    fVec = random_float(PA_LOW , PA_HIGH);
    fVec = random_float(PA_LOW , PA_HIGH);
    fVec = random_float(PA_LOW , PA_HIGH);
    entity_set_vector(id , EV_VEC_punchangle , fVec);
    message_begin(MSG_ONE , gMsgScreenShake , {0,0,0} ,id)
    write_short( 1<<14 );
    write_short( 1<<14 );
    write_short( 1<<14 );
    message_end();

    message_begin(MSG_ONE_UNRELIABLE , gMsgScreenFade , {0,0,0} , id);
    write_short( 1<<10 );
    write_short( 1<<10 );
    write_short( 1<<12 );
    write_byte( 225 );
    write_byte( 0 );
    write_byte( 0 );
    write_byte( 125 );
    message_end();
}
}

public volume_up_1(id) {
client_cmd(id , "volume 0.1");
set_task(0.2 , "volume_up_2" , id);
}

public volume_up_2(id) {
client_cmd(id , "volume 0.2");
set_task(0.2 , "volume_up_3" , id);
}

public volume_up_3(id) {
client_cmd(id , "volume 0.3");
set_task(0.2 , "volume_up_4" , id);
}

public volume_up_4(id) {
client_cmd(id , "volume 0.4");
set_task(0.2 , "volume_up_5" , id);
}

public volume_up_5(id) {
client_cmd(id , "volume 0.5");
set_task(0.2 , "volume_up_6" , id);
}

public volume_up_6(id) {
client_cmd(id , "volume 0.6");
set_task(0.2 , "volume_up_7" , id);
}

public volume_up_7(id) {
client_cmd(id , "volume 0.7");
set_task(0.2 , "volume_up_8" , id);
}

public volume_up_8(id) {
#if !defined USE_AMX
   client_cmd(id , "volume %f" , gVolume);
#else
   client_cmd(id , "volume %f" , float(DEFAULT_VOLUME));
#endif
}

rsdtt 发表于 2011-3-13 23:52:38

没攻击力 但有效果?不理解

rsdtt 发表于 2011-3-13 23:56:37

一般控制伤害都使用这段函数

20061234 发表于 2011-3-14 14:55:52

是这样
不会扣别人血 但会有眩晕效果

rsdtt 发表于 2011-3-14 18:51:57

4# 20061234


那插件正是

20061234 发表于 2011-3-14 21:18:53

5# rsdtt



怎么用的阿

rsdtt 发表于 2011-3-14 21:31:05

那里不是有说明了吗

20061234 发表于 2011-3-14 23:46:39

7# rsdtt



看不懂内容晕 不知怎加

20061234 发表于 2011-3-15 00:23:13

#include <amxmodx>

#include <amxmisc>

#include <hamsandwich>



#define PLUGIN_NAME      "New Plug-In"

#define PLUGIN_VERSION      "0.1"

#define PLUGIN_AUTHOR      "zwfgdlc"



#define DAMAGEBIT_HEGRENADE                1<<24



public plugin_init()

{

      register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

      RegisterHam(Ham_TakeDamage,"player","fwd_TakeDamage_pre")



}



public fwd_TakeDamage_pre(id, idinflictor, idattacker, Float:damage, damagebits)

{

      if(damagebits == DAMAGEBIT_HEGRENADE)

      {

                SetHamParamFloat(4, 0.0);

      }

      

      return HAM_IGNORED;

}


这代码会使眩晕效果也除去
只有自己不会扣血,没什么伤害
怎么改

20061234 发表于 2011-3-15 00:26:05

#include <amxmodx>

#include <amxmisc>

#include <hamsandwich>



#define PLUGIN_NAME      "New Plug-In"

#define PLUGIN_VERSION      "0.1"

#define PLUGIN_AUTHOR      "zwfgdlc"



#define DAMAGEBIT_HEGRENADE                1<<24



public plugin_init()

{

      register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

      RegisterHam(Ham_TakeDamage,"player","fwd_TakeDamage_pre")



}



public fwd_TakeDamage_pre(id, idinflictor, idattacker, Float:damage, damagebits)

{

      if(damagebits == DAMAGEBIT_HEGRENADE)

      {

                SetHamParamFloat(4, 0.0);

      }

      

      return HAM_IGNORED;

}


这代码会使眩晕效果也除去
只有自己不会扣血,没什么伤害
怎么改
页: [1] 2
查看完整版本: 如何如何设没攻击力 但有效果