下面是引用 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不會增加噢~(可以自己找加殺敵數的指令進去)