register_forward(FM_TraceHull,"ForwardTraceHull",1)
public ForwardTraceLine(Float:v1,Float:v2,EntToSkip,NoMonsters,TR)
{
if(!get_pcvar_num(p_Godmode) || !g_SurfMap || !get_pcvar_num(p_On))
return FMRES_IGNORED
new id = get_tr(TR_pHit)
if(!is_user_alive(id))
return FMRES_IGNORED
new Attacker
while((Attacker = engfunc(EngFunc_FindEntityInSphere,Attacker,v1,10.0)) != 0)
if(Attacker < 33 && Attacker > 0)
break
if(!is_user_alive(Attacker))
return FMRES_IGNORED
new Button = pev(Attacker,pev_button)
if(!(Button & IN_ATTACK) && !(Button & IN_ATTACK2))
return FMRES_IGNORED
set_tr(TR_flFraction,1.0)
return FMRES_IGNORED
}
public ForwardTraceHull(Float:v1,Float:v2,NoMonsters,Hull,EntToSkip,TR)
{
if(!g_SurfMap || !get_pcvar_num(p_On) || !get_pcvar_num(p_Godmode))
return FMRES_IGNORED
new Button = pev(EntToSkip,pev_button)
if(!(Button & IN_ATTACK) && !(Button & IN_ATTACK2))
return FMRES_IGNORED
set_tr(TR_flFraction,1.0)
return FMRES_IGNORED
} 我研究的插件是出现母体僵尸,当然是变成T,可是原来的CT 和 T都能互相攻击,可以互相杀害对方!研究了几天没解决!楼主的QQ多少,想和你细聊!! 你看看这段有什么问题?
public doDamage(id){
if (zombie_enabled != 1)
return PLUGIN_CONTINUE
new plrWeap
new plrPartHit
new plrAttacker = get_user_attacker(id, plrWeap, plrPartHit)
if(zombies == 0 && zombies == 1){
if ( get_cvar_float("bullet_damage") ) {
new aIndex = get_user_attacker(id)
new damage = read_data(2)
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 7)
show_hudmessage(aIndex,"%i", damage)
}
return PLUGIN_CONTINUE
}
if(zombies == 1 && zombies == 0){
if ( get_cvar_float("bullet_damage") ) {
new aIndex = get_user_attacker(id)
new damage = read_data(2)
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 7)
show_hudmessage(aIndex,"%i", damage)
}
return PLUGIN_CONTINUE
}
new plrDmg = read_data(2)
if (!is_user_alive(id)){
return PLUGIN_CONTINUE
}
if (!is_user_alive(plrAttacker)){
return PLUGIN_CONTINUE
}
if (get_user_userid (id) == get_user_userid (plrAttacker)){
return PLUGIN_CONTINUE
}
new plrHealth = get_user_health(id)
new plrNewDmg
plrDmg = floatround(float(plrDmg))
if (plrDmg <= 0){
return PLUGIN_CONTINUE
}
plrNewDmg = (plrHealth + plrDmg)
set_user_health(id, plrNewDmg)
return PLUGIN_CONTINUE
}
public event_damage() {
if (zombie_enabled != 1)
return PLUGIN_CONTINUE
new id = read_data(0)
new damage = read_data(1)
new attacker
if ((!id) || !is_user_connected(id))
return PLUGIN_CONTINUE
new weapon,body
attacker = get_user_attacker(id,weapon,body)
if ((!attacker) || (attacker == id))
return PLUGIN_CONTINUE
if ((zombies == 1) && (weapon == CSW_HEGRENADE))
return PLUGIN_CONTINUE
if (zombies != 1) {
if (zombies != 1) {
set_user_health(id,get_user_health(id)+damage)
return PLUGIN_CONTINUE
} else {
new ids
ids = id
ids = attacker
ids = damage
ids = body
ids = weapon
set_task(0.1, "do_team_dmg", 0, ids, 5)
}
}
if (zombies == 1) {
entity_set_vector(id, EV_VEC_velocity, Float:{0.0, 0.0, 0.0})
return PLUGIN_CONTINUE
}
new health = get_user_health(attacker)
health += 15
if (health < get_cvar_num("amx_zombie_health"))
set_user_health(attacker, health)
if ((id > 0) && (id < 34) && (zombies == 0) && (weapon == CSW_KNIFE)) {
zombies = 2
new ids
ids = id
ids = attacker
set_task(get_cvar_float("amx_zombie_infecttime"), "start_zombie", 0, ids, 2)
client_print(attacker, print_chat, "You have consumed the brains of a human!")
}
return PLUGIN_CONTINUE
} 骂人的两位各禁言一周处罚。希望以后不要再发生这种情况。
页:
1
[2]