Witam, na serwerze posiadam RPG Mod'a. Próbowałem zrobić 2x większy exp dla vipa ale coś się buguje.
Ludzie mi piszą że czasami im exp do 4 000 za kill'a leci a jest 25 ustawiony za zabójstwo.
O tak próbowałem zrobić:
public client_damage(attacker, victim, damage, wpnindex, hitplace, TA){
if(!TA){
g_iXP[attacker] += floatround(damage * get_pcvar_float(wpnindex == CSW_KNIFE?g_pXPKnifeDmg:g_pXPDamage));
RPGx_CheckXP(attacker);
}
ExecuteForward(g_fwPlayerHurt, g_fwLastResult, victim, attacker, damage, wpnindex);
}
public client_death(killer, victim, wpnindex, hitplace, TK){
new headshot = hitplace==HIT_HEAD?1:0;
if(!TK){
g_iXP[killer] += get_pcvar_num(g_pXPKill) + headshot?get_pcvar_num(g_pXPHeadshot):0;
RPGx_CheckXP(killer);
}
if(get_user_flags(killer) && ADMIN_LEVEL_H){ // 2x większy exp dla vipa
g_iXP[killer] *= 2;
}
ExecuteForward(g_fwPlayerDeath, g_fwLastResult, victim, killer, headshot);
}
public bomb_defused(defuser){
g_iXP[defuser] += floatround(required_xp(defuser) * get_pcvar_float(g_pXPBombDefuse));
RPGx_CheckXP(defuser);
}
public bomb_planted(planter){
g_iXP[planter] += floatround(required_xp(planter) * get_pcvar_float(g_pXPBombPlant));
RPGx_CheckXP(planter);
}
public bomb_explode(planter, defuser){
static players[32], num, player;
get_players(players, num, "e", "TERRORIST");
for(new i;i<num;i++){
player = players[i];
g_iXP[player] += floatround(required_xp(player) * get_pcvar_float(g_pXPBombExplode));
RPGx_CheckXP(player);
}
g_iXP[planter] += floatround(required_xp(planter) * get_pcvar_float(g_pXPBombPlant));
RPGx_CheckXP(planter);
g_iXP[defuser]++;
RPGx_CheckXP(defuser);
}
public RPGx_CheckXP(id){
new XP = g_iXP[id];
if(XP >= required_xp(id)){
new MaxXP = get_pcvar_num(g_pXPMax);
if(MaxXP > 0 && XP >= MaxXP)
return;
g_iXP[id] -= required_xp(id);
g_iLevel[id]++;
g_iCredits[id] += get_pcvar_num(g_pCreditsInc);
if(get_pcvar_num(g_pXPNotice))
{
static szName[32];
get_user_name(id, szName, 31);
tutorMake(0,TUTOR_GREEN,4.0, "%L", LANG_PLAYER, "rpgx_stats_levelup", szName, g_iLevel[id]);
}
client_print(id, print_chat, "%L", id, "rpgx_notice_newcredits", g_iCredits[id]);
PlaySound(id, "levelup");
ExecuteForward(g_fwPlayerLevelUp, g_fwLastResult, id, g_iLevel[id]);
}
}
Bardzo proszę o szybką pomoc.
Załączone pliki
Użytkownik protypek edytował ten post 09.06.2015 16:55


Dodatki SourceMod




rpgx.amxx








