我的ZP伺服器装了个人类升级插件。复制程式
……
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
……
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// 插件开关
if (!g_pluginenabled) return HAM_IGNORED;
if (victim == attacker || !is_user_connected(attacker))
return HAM_IGNORED;
// 如果是人类攻击
if(!zp_get_user_zombie(attacker))
{
// 攻击倍数
if(g_human_level[attacker][HLU_DAMAGE])
damage *=float(g_human_level[attacker][HLU_DAMAGE])*1.2
//如果满级则不增加经验
if(g_human_level[attacker][HLU_LEVEL] < sizeof LEVELSCORE-1)
{
// 储存伤害值
g_damagedealt[attacker] += floatround(damage)
// 经验值增加
while (g_damagedealt[attacker] > hlu_damage_reward)
{
if(get_user_flags(attacker) & ADMIN_RESERVATION)
{
g_human_level[attacker][HLU_EXPERIENCE] += floatround(float(hlu_experience) * hlu_vip) // VIP获得经验倍数
}else{
g_human_level[attacker][HLU_EXPERIENCE] += hlu_experience // 普通用户获得经验
}
g_damagedealt[attacker] -= hlu_damage_reward
}
for(new i = 0; i < sizeof LEVELSCORE; i++)
{
if(g_human_level[attacker][HLU_EXPERIENCE]<LEVELSCORE[i])
{
if(i>0)
{
g_human_level[attacker][HLU_LEVEL] = i;
g_human_level[attacker][HLU_EXPSCORE] = g_human_level[attacker][HLU_EXPERIENCE] - LEVELSCORE[i-1]; // 当前经验值
g_human_level[attacker][HLU_EXPNEED] = LEVELSCORE[i] - LEVELSCORE[i-1]; // 升级所需经验值
}else{
g_human_level[attacker][HLU_EXPNEED] = 100;
g_human_level[attacker][HLU_EXPSCORE] = g_human_level[attacker][HLU_EXPERIENCE];
}
g_human_level[attacker][HLU_EXPRATE] = floatround(float(g_human_level[attacker][HLU_EXPSCORE]) / float(LEVELSCORE[i] - LEVELSCORE[i-1]) * 100.0) // 升级百分比
break;
}
}
}
SetHamParamFloat(4, damage)
check_leveling_up(attacker); // 检查是否升级了
return HAM_IGNORED;
}
SetHamParamFloat(4,damage)
return HAM_HANDLED
}
……
但是我装到伺服器里后,攻击BOT(不是PODBOT)发现经验根本不会增加。
只有攻击PODBOT或者真人,经验才会增加。
有大大知道这是为什么吗?为什么攻击CS1.6自带的BOT不增加经验?