|
楼主 |
发表于 2009-6-24 13:50:03
|
显示全部楼层
来自 中国–内蒙古–巴彦淖尔
你看看这段有什么问题?
public doDamage(id){
if (zombie_enabled != 1)
return PLUGIN_CONTINUE
new plrWeap
new plrPartHit
new plrAttacker = get_user_attacker(id, plrWeap, plrPartHit)
if(zombies[id] == 0 && zombies[plrAttacker] == 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[id] == 1 && zombies[plrAttacker] == 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[attacker] == 1) && (weapon == CSW_HEGRENADE))
return PLUGIN_CONTINUE
if (zombies[attacker] != 1) {
if (zombies[id] != 1) {
set_user_health(id,get_user_health(id)+damage)
return PLUGIN_CONTINUE
} else {
new ids[5]
ids[0] = id
ids[1] = attacker
ids[2] = damage
ids[3] = body
ids[4] = weapon
set_task(0.1, "do_team_dmg", 0, ids, 5)
}
}
if (zombies[id] == 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[id] == 0) && (weapon == CSW_KNIFE)) {
zombies[id] = 2
new ids[2]
ids[0] = id
ids[1] = 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
} |
|