下面是引用 husano896 于 2011-08-19 14:00 发表的 :
(吃掉)
先在士气插件的任意地方加入
new const weapon_name[CSW_P90+1][] = { "skull", "p228", "", "scout", "hegrenade", "xm1014", "c4", "mac10",
"aug", "smokegrenade", "elite", "fiveseven", "ump45", "sg550", "galil", "famas",
"usp", "glock18", "awp", "mp5navy", "m249", "m3", "m4a1",
"tmp", "g3sg1", "flashbang", "deagle", "sg552", "ak47", "knife", "p90" }
接着 原本
复制程式
if (hitzone != 1)
{
if (!has_item2[victim])
{
g_time[victim] = 5
show_respawn_msg(victim)
}
else
{
set_task(1.0, "respawn_user", victim)
}
}
的地方 改成
复制程式
if (hitzone != 1)
{
//修正动作用 不加会有问题噢~
set_pev(victim,pev_frame,0.0)
set_pev(victim,pev_sequence,101)
set_pev(victim,pev_animtime, get_gametime());
set_pev(victim,pev_solid,SOLID_NOT)
set_pev(victim,pev_takedamage,0.0)
set_pev(victim,pev_maxspeed,0.0)
fm_strip_user_weapons(victim) //不加的话武器就喷不出来
//原插件部分~------------------------
if (!has_item2[victim])
{
g_time[victim] = 5
show_respawn_msg(victim)
}
else
{
set_task(1.0, "respawn_user", victim)
}
//原插件部分~------------------------
//因为会挡掉原本的死亡讯息 所以要重新发送
if (attacker != victim && attacker)
SendDeathMsg(attacker, victim, weapon_name[use_weapon])
else
SendDeathMsg(attacker, victim, "worldspawn")
return HAM_SUPERCEDE //罪魁祸首!!
}
在任意处加入发送死亡讯息的function以及喷光武器的function
复制程式
SendDeathMsg(attacker, victim, const weapon[])
{
message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"))
write_byte(attacker) // killer
write_byte(victim) // victim
write_byte(0) // headshot flag
write_string(weapon) // killer's weapon
message_end()
}
stock fm_strip_user_weapons(id)
{
static ent
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip"))
if (!pev_valid(ent)) return;
dllfunc(DLLFunc_Spawn, ent)
dllfunc(DLLFunc_Use, ent, id)
engfunc(EngFunc_RemoveEntity, ent)
}
噢对了 忘了说 用了之后 非爆头击杀的话 被杀者的Death以及杀人者的Kill不会增加噢~(可以自己找加杀敌数的指令进去)