como usar una variable que guarde el daño de todas las variables que contengan daño
#1
como dice el titulo implemente el sistema de party 2.2 y estoy teniendo problemas al disparar ya puse un plugin para verificar cuanto le saco al zombie y por ejemplo el plugin me dice que le quito 1000 y el hud del combo me dice 400 entonces eso quiere decir que no me esta tomando las siguientes variables: g_arma_prim[attacker], y g_mejoras[attacker]

Código PHP:
if(g_currentweapon[attacker] == menu_death[g_arma_prim[attacker]][item_id])
SetHamParamFloat(damage *= menu_death[g_arma_prim[attacker]][item_damage])

:

if (
g_mejoras[attacker][0][M_DANIO])
{
    
damage *= DANIO_HUMANO(g_mejoras[attacker][0][M_DANIO])
    
SetHamParamFloat(4damage)


la del daño del combo es la siguiente : g_damage
No me impresiona nada que mis ojos no puedan ver. Fuck yeah
Responder
#2
Hola, pasa el código completo. El party 2.2 el hud del combo lo llama por un task, quizas es eso que al aparecer en 0.2 no te muestra el daño que le sacas en el momento según el arma..
Responder
#3
en el takedamage
Código PHP:
        if(!g_PartyData[attacker][In_Party]) // Combos Sin Party
        
{
            
// Combos Agregados
            
g_damage[attacker] += floatround(damage)
            
g_Hits[attacker]++
            while(
g_damage[attacker]>=(power(g_combo[attacker], 1)*1000))
            {
                
g_combo[attacker]++
            }
            
remove_task(attacker+TASK_COMBO)
            
set_task(0.1"task_combo"attacker+TASK_COMBO)
            
set_task(5.0"reset_combo"attacker+TASK_COMBO)    
        }
        else 
// Combos Del Party
        
{
            new 
Players[32], user
            get_party_index
(attackerPlayers)
            for(new 
ig_PartyData[attacker][Amount_In_Party]; i++)
            {
                
user Players[i]
                
g_damagep[user] += floatround(damage) / g_PartyData[user][Amount_In_Party]
                
g_Hitsp[user]++
                while(
g_damagep[user]>=(power(g_combop[user], 1)*2000))
                {
                    
g_combop[user]++
                }
                
remove_task(user+TASK_COMBOP)
                
set_task(0.1"task_party_combo"user+TASK_COMBOP)
                
set_task(4.0"reset_party_combo"user+TASK_COMBOP)
            }
        } 

Código PHP:
public task_combo(attacker)
{
    
attacker -= TASK_COMBO
    
//static flags
    //flags = get_user_flags(attacker)
    
    
if(g_combo[attacker]>0)
    {
        if(
g_happytime) {
            
set_hudmessage(02550, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(attackerg_hudmsg1"==== HAPPY COMBO ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
            
g_Hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*1000), g_combo[attacker], g_combo[attacker] * 1)
        } 
        else {
            
set_hudmessage(0200200, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(attackerg_hudmsg1"==== COMBOS ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
            
g_Hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*2000), g_combo[attacker], g_combo[attacker] * 0.5)
        }
    }
}
public 
task_party_combo(i)
{
    
-= TASK_COMBOP
    
    
//static flags
    //flags = get_user_flags(i)
    
    
if(g_combop[i]>&& !g_zombie[i] && is_user_alive(i))
    {
        if(
g_PartyData[i][In_Party])
        {
            if(
g_happytime) {
                
set_hudmessage(0255255, -1.00.610.15.00.010.01, -1)
                
ShowSyncHudMsg(ig_hudmsg1"==== HAPPY COMBO PARTY ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos Party: %d]^n[==== %d de AP ====]"
                
g_Hitsp[i], g_damagep[i], g_damagep[i], (power(g_combop[i], 1)*4000), g_combop[i], g_combop[i] * 1)
                } else {
                
set_hudmessage(0200200, -1.00.610.15.00.010.01, -1)
                
ShowSyncHudMsg(ig_hudmsg1"====COMBO DE LA PARTY ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
                
g_Hitsp[i], g_damagep[i], g_damagep[i], (power(g_combop[i], 1)*2000), g_combop[i], g_combop[i] * 0.5)
            }
        }
    }
}

public 
reset_combo(id)
{
    
id -= TASK_COMBO
    
//static flags
    //flags = get_user_flags(id)
    
    //static ganancia; ganancia = g_combo[id]
    
if (g_combo[id]>0)
    {
        if(
g_happytime) {
            if(
is_user_admin(id)){
                
zp_colored_print(id"%s [HAPPYHOUR]^x03 Combo Total:^x04 %d^x03|Daño Total:^x04 %d^x03|Hits Echos:^x04 %d^x03|Ganancia:^x04 %d |Total:^x04 %d^x03 por estar en Happy Hour y ser admin"TAGg_combo[id], g_damage[id], g_Hits[id], g_combo[id], (g_combo[id] * g_ganancia[id]))
                
g_ammopacks[id] += g_combo[id] * g_ganancia[id]
            }
            else{
                
zp_colored_print(id"%s [HAPPYHOUR]^x01 Combo Total:^x04 %d^x01|Daño Total:^x04 %d^x01|Hits Echos:^x04 %d^x01|Ganancia:^x04 %d^x01 por estar en Happy Hour"TAGg_combo[id], g_damage[id], g_Hits[id], g_combo[id])
                
g_ammopacks[id] += g_combo[id]
            }
        } 
        else {
            
//set_hudmessage(120, 120, 120, -1.0, 0.25, 0, 0.1, 4.0, 0.01, 0.01, -1)
            //ShowSyncHudMsg(id, g_hudmsg1, "^n^n^n^n Combo Terminado (%d)^nGanancia: %d AMMO PACKS", g_combo[id], ganancia)
            
zp_colored_print(id"%s Combo Total:^x04 %d^x01 | Damage Total:^x04 %d^x01 | Hits Echos:^x04 %d^x01 | Ganancia:^x04 %d"TAGg_combo[id], g_damage[id], g_Hits[id], g_combo[id])
            
g_ammopacks[id] += g_combo[id]
        }
    }
    
g_damage[id] = 0
    g_Hits
[id] = 0
    g_combo
[id] = 0
}
public 
reset_party_combo(i)
{
    
-= TASK_COMBOP
    
//static flags
    //flags = get_user_flags(i)
    
    //static gananciap; gananciap = g_combop[i]
    
if(g_PartyData[i][In_Party])
    {
        if(
g_happytime) {
            
zp_colored_print(i"%s [Hora Vicio] Combo party Total:^x04 %d^x01 | Daño Total:^x04 %d^x01 | Hits Echos:^x04 %d^x01 | Ganancia:^x04 %d^x01 por estar en HappyHour"TAGg_combop[i], g_damagep[i], g_Hitsp[i], g_combop[i])
            
g_ammopacks[i] += g_combop[i]
        } 
        else {
            
zp_colored_print(i"%s Combo party Total:^x04 %d^x01 | Damage Total:^x04 %d^x01 | Hits Echos:^x04 %d^x01 | Ganancia:^x04 %d"TAGg_combop[i], g_damagep[i], g_Hitsp[i], g_combop[i])
        }
        
g_ammopacks[i] += g_combop[i]
    }
    
g_damagep[i] = 0
    g_Hitsp
[i] = 0
    g_combop
[i] = 0



Archivos adjuntos Miniatura(s)
   
No me impresiona nada que mis ojos no puedan ver. Fuck yeah
Responder
#4
Te faltó pasar el código donde te dice el nombre ,daño y vida de la foto xd

en:

Código PHP:
task_party_combo(i

tepites 2 veces esta variable, deja solo una...

Código PHP:
g_damagep[i], g_damagep[i
Responder
#5
Código PHP:
public task_combo(attacker)
{
    
attacker -= TASK_COMBO
    
//static flags
    //flags = get_user_flags(attacker)
    
    
if(g_combo[attacker] > 0)
    {
        if(
g_happytime) {
            
set_hudmessage(02550, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(attackerg_hudmsg1"==== HORA VICIO COMBO ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
            
g_Hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*1000), g_combo[attacker], g_combo[attacker] * 1)
        } 
        else {
            
set_hudmessage(0200200, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(attackerg_hudmsg1"==== COMBOS ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
            
g_Hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*2000), g_combo[attacker], g_combo[attacker] * 0.5)
        }
    }
}
public 
task_party_combo(i)
{
    
-= TASK_COMBOP
    
    
//static flags
    //flags = get_user_flags(i)
    
    
if(g_combop[i] > 0)
    {
        if(
g_PartyData[i][In_Party])
        {
            if(
g_happytime) {
                
set_hudmessage(0255255, -1.00.610.15.00.010.01, -1)
                
ShowSyncHudMsg(ig_hudmsg1"==== HORA VICIO COMBO PARTY ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos Party: %d]^n[==== %d de AP ====]"
                
g_Hitsp[i], g_damagep[i], g_damagep[i], (power(g_combop[i], 1)*4000), g_combop[i], g_combop[i] * 1)
            } else {
                
set_hudmessage(0200200, -1.00.610.15.00.010.01, -1)
                
ShowSyncHudMsg(ig_hudmsg1"==== COMBO DE LA PARTY ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
                
g_Hitsp[i], g_damagep[i], g_damagep[i], (power(g_combop[i], 1)*2000), g_combop[i], g_combop[i] * 0.5)
            }
        }
    }


entonces puedo guardar el daño del party y sin party en 1 sola variable o tengo que poner g_damage[33] en g_damage[33][2]? o como tambien pense en quitar g_damage[33] por g_damagedealt[33] que es la que trae el zp por default.
No me impresiona nada que mis ojos no puedan ver. Fuck yeah
Responder
#6
En esta linea divides el daño causado por la cantidad de miembros en la party, corrije eso:

Código PHP:
g_damagep[user] += floatround(damage) / g_PartyData[user][Amount_In_Party

Prueba eso si es el problema...
Responder
#7
(23/09/2018, 12:11 PM)warrior escribió: En esta linea divides el daño causado por la cantidad de miembros en la party, corrije eso:

Código PHP:
g_damagep[user] += floatround(damage) / g_PartyData[user][Amount_In_Party

Prueba eso si es el problema...

y como tendria que ponerlo?

en realidad estoy probando primero sin party luego voy por el del party, ya que estoy probando solo,

en este caso seria :
Código PHP:
        if(!g_PartyData[attacker][In_Party]) // Combos Sin Party
        
{
            
// Combos Agregados
            
g_damage[attacker] += floatround(damage)
            
g_Hits[attacker]++
            while(
g_damage[attacker]>=(power(g_combo[attacker], 1)*1000))
            {
                
g_combo[attacker]++
            }
            
remove_task(attacker+TASK_COMBO)
            
set_task(0.1"task_combo"attacker+TASK_COMBO)
            
set_task(5.0"reset_combo"attacker+TASK_COMBO)    
        } 

Código PHP:
public task_combo(attacker)
{
    
attacker -= TASK_COMBO
    
    
if(g_combo[attacker] > 0)
    {
        if(
g_happytime) {
            
set_hudmessage(02550, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(attackerg_hudmsg1"==== HORA VICIO COMBO ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
            
g_Hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*1000), g_combo[attacker], g_combo[attacker] * 1)
        } 
        else {
            
set_hudmessage(0200200, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(attackerg_hudmsg1"==== COMBOS ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
            
g_Hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*2000), g_combo[attacker], g_combo[attacker] * 0.5)
        }
    }

Código PHP:
public reset_combo(id)
{
    
id -= TASK_COMBO
    
    
if (g_combo[id]>0)
    {
        if(
g_happytime) {
            if(
is_user_admin(id)){
                
zp_colored_print(id"%s [Hora Vicio]^x03 Combo Total:^x04 %d^x03|Daño Total:^x04 %d^x03|Hits Echos:^x04 %d^x03|Ganancia:^x04 %d |Total:^x04 %d^x03 por estar en Hora Vicio y ser admin"TAGg_combo[id], g_damage[id], g_Hits[id], g_combo[id], (g_combo[id] * g_ganancia[id]))
                
g_ammopacks[id] += g_combo[id] * g_ganancia[id]
            }
            else{
                
zp_colored_print(id"%s [Hora Vicio]^x01 Combo Total:^x04 %d^x01|Daño Total:^x04 %d^x01|Hits Echos:^x04 %d^x01|Ganancia:^x04 %d^x01 por estar en Hora Vicio"TAGg_combo[id], g_damage[id], g_Hits[id], g_combo[id])
                
g_ammopacks[id] += g_combo[id]
            }
        } 
        else {
            
zp_colored_print(id"%s Combo Total:^x04 %d^x01 | Damage Total:^x04 %d^x01 | Hits Echos:^x04 %d^x01 | Ganancia:^x04 %d"TAGg_combo[id], g_damage[id], g_Hits[id], g_combo[id])
            
g_ammopacks[id] += g_combo[id]
        }
    }
    
g_damage[id] = 0
    g_Hits
[id] = 0
    g_combo
[id] = 0


ahora que veo practicamente es el combo el que me esta jodiendo, o a tu punto de vista esta todo bien no?
No me impresiona nada que mis ojos no puedan ver. Fuck yeah
Responder
#8
Usate la variable de la imagen que pasaste para el combo
Responder
#9
(23/09/2018, 12:47 PM)warrior escribió: Usate la variable de la imagen que pasaste para el combo

ya descarte el combo es efectivamente que no se suman todos los daños use el siguiente combo y el problema es el mismo
https://forums.alliedmods.net/showthread.php?t=169040
es decir solo toma el daño normal, mas no el de mejoras, ni el daño modificado del arma, hay forma de sumar todas esas variables y meter el resultado en otra variable?
No me impresiona nada que mis ojos no puedan ver. Fuck yeah
Responder
#10
Mira, aca te dejo el link de un combo que el autor LuKks, lo actualizo hace poco y esta bastante bien, solo que no tiene party jaja

https://amxmodx-es.com/Thread-ZP-sistema...ra-hm-y-zm

___________________

aca te dejo otra solución para mostrar el daño en tu combo:

Código PHP:
new g_damagep_[33// principio del plugin 

Código PHP:
g_damagep_[user] = floatround(damage

luego en el hud agrega la variable g_damagep_[attacker]

Reemplaza esto

Código PHP:
if(!g_PartyData[attacker][In_Party]) // Combos Sin Party
        
{
            
// Combos Agregados
            
g_damage[attacker] += floatround(damage)
            
g_Hits[attacker]++
            while(
g_damage[attacker]>=(power(g_combo[attacker], 1)*1000))
            {
                
g_combo[attacker]++
            }
            
remove_task(attacker+TASK_COMBO)
            
set_task(0.1"task_combo"attacker+TASK_COMBO)
            
set_task(5.0"reset_combo"attacker+TASK_COMBO)    
        }
        else 
// Combos Del Party
        
{
            new 
Players[32], user
            get_party_index
(attackerPlayers)
            for(new 
ig_PartyData[attacker][Amount_In_Party]; i++)
            {
                
user Players[i]
                
g_damagep[user] += floatround(damage) / g_PartyData[user][Amount_In_Party]
                
g_Hitsp[user]++
                while(
g_damagep[user]>=(power(g_combop[user], 1)*2000))
                {
                    
g_combop[user]++
                }
                
remove_task(user+TASK_COMBOP)
                
set_task(0.1"task_party_combo"user+TASK_COMBOP)
                
set_task(4.0"reset_party_combo"user+TASK_COMBOP)
            }
        } 

>>>>>>>>>>>>>>>>>>>>>>

Código PHP:
if(!g_PartyData[attacker][In_Party]) // Combos Sin Party
        
{
            
// Combos Agregados
            
g_damage[attacker] += floatround(damage)
            
g_Hits[attacker]++
            while(
g_damage[attacker]>=(power(g_combo[attacker], 1)*1000))
            {
                
g_combo[attacker]++
            }
            
remove_task(attacker+TASK_COMBO)
            
set_task(0.1"task_combo"attacker+TASK_COMBO)
            
set_task(5.0"reset_combo"attacker+TASK_COMBO)    
        }
        else 
// Combos Del Party
        
{
            new 
Players[32], user
            get_party_index
(attackerPlayers)
            for(new 
ig_PartyData[attacker][Amount_In_Party]; i++)
            {
                
user Players[i]
                
g_damagep[user] += floatround(damage) / g_PartyData[user][Amount_In_Party]
                
g_damagep_[user] = floatround(damage
                
g_Hitsp[user]++
                while(
g_damagep[user]>=(power(g_combop[user], 1)*2000))
                {
                    
g_combop[user]++
                }
                
remove_task(user+TASK_COMBOP)
                
set_task(0.1"task_party_combo"user+TASK_COMBOP)
                
set_task(4.0"reset_party_combo"user+TASK_COMBOP)
            }
        } 

Te agregue la variable g_damagep_ estando en party, te faltaria agregar esta variable en el hud del party. Deberias hacer lo mismo al estar sin party, pruebaa
Responder
#11
por ahora no me ha servido nada, el combo de lukks si me sirvio pero usandolo externo ojo me refiero a que si concuerda el daño del hit con el print del plugin que yo tengo que refleja el daño por hit, warrior recuerda que el problema que tengo por ahora no es el party sino el combo que no me refleja el daño total de 1 bala.
No me impresiona nada que mis ojos no puedan ver. Fuck yeah
Responder
#12
Código PHP:
new g_danioo[33// creamos variable 

En takedamage:

Código PHP:
g_danioo[attacker] = floatround(damage)    // guardamos el damage en esta variable
client_print(attackerprint_chat"%i"g_danioo[attacker]) 


En tu caso:

Código PHP:
if(g_currentweapon[attacker] == menu_death[g_arma_prim[attacker]][item_id])
SetHamParamFloat(damage *= menu_death[g_arma_prim[attacker]][item_damage])

g_danioo[attacker] = floatround(damage)         // guardamos el damage en esta variable
client_print(attackerprint_chat"%i"g_danioo[attacker]) // mostramos el daño guardado en la variable de arriba e imprimimos en el say 

Espero que te sirva...
Responder
#13
warrior gracias por la paciencia y la ayuda logre resolver el problema poniendo lo siguiente:
Código PHP:
g_damage[attacker] += floatround(damage) * 
y ahora si me refleja el daño total supongo que fue por esto que me di cuenta ya hace uno minutos :

Código PHP:
        // Armor multiplier for the final damage on normal zombies
        
if (!g_nemesis[victim] && !g_assassin[victim] && !g_sniper[attacker])
        {
            
damage *= get_pcvar_float(cvar_zombiearmor)
            
SetHamParamFloat(4damage / (DEFENSA_ZOMBIE(g_mejoras[victim][1][M_DEFENSA]) + 1))
        } 

ahora si vamos a optimizar, tu me dices que la variable g_damagep[id] esta demas? puedo usar entonces la misma variable g_damage[id] en la parte del party?

Código PHP:
        if(!g_PartyData[attacker][In_Party]) // Combos Sin Party
        
{
            
// Combos Agregados
            
g_damage[attacker] += floatround(damage) * 4
            g_damage_hits
[attacker] = floatround(damage) * 4
            g_Hits
[attacker]++
            while(
g_damage[attacker]>=(power(g_combo[attacker], 1)*(get_pcvar_num(cvar_damage_combo))))
            {
                
g_combo[attacker]++
            }
            
remove_task(attacker+TASK_COMBO)
            
set_task(0.1"task_combo"attacker+TASK_COMBO)
            
set_task(5.0"reset_combo"attacker+TASK_COMBO)    
        }
        else 
// Combos Del Party
        
{
            new 
Players[32], user
            get_party_index
(attackerPlayers)
            for(new 
ig_PartyData[attacker][Amount_In_Party]; i++)
            {
                
user Players[i]
                
g_damage[user] += floatround(damage) * g_PartyData[user][Amount_In_Party]
                
g_Hits[user]++
                while(
g_damage[user]>=(power(g_combo[user], 1)*(get_pcvar_num(cvar_damage_combo_party))))
                {
                    
g_combo[user]++
                }
                
remove_task(user+TASK_COMBOP)
                
set_task(0.1"task_party_combo"user+TASK_COMBOP)
                
set_task(5.0"reset_party_combo"user+TASK_COMBOP)
            }
        } 
asi? al igual cambiar las del task_party_combo

y como optimizaria mas este codigo:

Código PHP:
public task_combo(attacker)
{
    
attacker -= TASK_COMBO
    
    
if(g_combo[attacker]>0)
    {
        if(
g_happytime) {
            
set_hudmessage(02550, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(attackerg_hudmsg1"==== HORA VICIO COMBO ====^n[Hits: %d][Daño Hit: %d] [Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
            
g_Hits[attacker], g_damage_hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*(get_pcvar_num(cvar_damage_combo_hv))), g_combo[attacker], g_combo[attacker] * 1)
        } 
        else {
            
set_hudmessage(0200200, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(attackerg_hudmsg1"==== COMBOS ====^n[Hits: %d][Daño Hit: %d] [Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
            
g_Hits[attacker], g_damage_hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*(get_pcvar_num(cvar_damage_combo))), g_combo[attacker], (g_combo[attacker] / 2))
        }
    }
}
public 
task_party_combo(i)
{
    
-= TASK_COMBOP
    
    
if(g_combop[i]>0)
    {
        if(
g_PartyData[i][In_Party])
        {
            if(
g_happytime) {
                
set_hudmessage(0255255, -1.00.610.15.00.010.01, -1)
                
ShowSyncHudMsg(ig_hudmsg1"==== HORA VICIO COMBO PARTY ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos Party: %d]^n[==== %d de AP ====]"
                
g_Hitsp[i], g_damagep[i], (power(g_combop[i], 1)*(get_pcvar_num(cvar_damage_combo_party_hv))), g_combop[i], g_combop[i] * 1)
            } else {
                
set_hudmessage(0200200, -1.00.610.15.00.010.01, -1)
                
ShowSyncHudMsg(ig_hudmsg1"==== COMBO DE LA PARTY ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
                
g_Hitsp[i], g_damagep[i], (power(g_combop[i], 1)*(get_pcvar_num(cvar_damage_combo_party))), g_combop[i], g_combop[i] / 2)
            }
        }
    }
}

public 
reset_combo(id)
{
    
id -= TASK_COMBO

    
if (g_combo[id]>0)
    {
        if(
g_happytime) {
            if(
is_user_admin(id)){
                
zp_colored_print(id"%s ^x04[Hora Vicio] ^x03Daño Total:^x04 %d^x03Hits Echos:^x04 %d^x03Ganancia:^x04 %d x %d ^x03Total:^x04 %d^x03 por estar en Hora Vicio y ser admin"TAGg_damage[id], g_Hits[id], g_combo[id], g_ganancia[id], (g_combo[id] * g_ganancia[id]))
                
g_ammopacks[id] += g_combo[id] * g_ganancia[id]
            }
            else{
                
zp_colored_print(id"%s ^x04[Hora Vicio] ^x03Daño Total:^x04 %d^x01|Hits Echos:^x04 %d^x01Ganancia:^x04 %d^x01 por estar en Hora Vicio"TAGg_damage[id], g_Hits[id], g_combo[id])
                
g_ammopacks[id] += g_combo[id]
            }
        } 
        else {
            if(
is_user_admin(id)){
                
zp_colored_print(id"%s Daño Total:^x04 %d^x03 | Hits Echos:^x04 %d^x03 Ganancia:^x04 %d x %d ^x03Total:^x04 %d^x03 por ser admin"TAGg_damage[id], g_Hits[id], g_combo[id], g_ganancia[id], (g_combo[id] * g_ganancia[id]))
                
g_ammopacks[id] += g_combo[id] * g_ganancia[id]
            }
            else{
                
zp_colored_print(id"%s Daño Total:^x04 %d^x03 Hits Echos:^x04 %d^x03 Ganancia:^x04 %d"TAGg_damage[id], g_Hits[id], g_combo[id])
                
g_ammopacks[id] += g_combo[id]
            }
        }
    }
    
g_damage[id] = g_Hits[id] = g_combo[id] = 0
}
public 
reset_party_combo(i)
{
    
-= TASK_COMBOP

    
if(g_PartyData[i][In_Party]){
        if(
g_happytime) {
            if(
is_user_admin(i)){
                
zp_colored_print(i"%s ^x04[Hora Vicio Party] ^x03Daño Total:^x04 %d^x03 | Hits Echos:^x04 %d^x03 | Ganancia:^x04 %d^x03 |Total:^x04 %d^x03 por estar en Hora Vicio y ser admin"TAGg_damagep[i], g_Hitsp[i], g_combop[i], (g_combo[i] * g_ganancia[i]))
                
g_ammopacks[i] += g_combo[i] * g_ganancia[i]
            }
            else{
                
zp_colored_print(i"%s ^x04[Hora Vicio Party] ^x03Daño Total:^x04 %d^x03 | Hits Echos:^x04 %d^x03 | Ganancia:^x04 %d^x03 por estar en Hora Vicio"TAGg_damagep[i], g_Hitsp[i], g_combop[i])
                
g_ammopacks[i] += g_combop[i]
            }
        } 
        else {
            if(
is_user_admin(i)){
                
zp_colored_print(i"%s ^x04[Party] ^x03Daño Total:^x04 %d^x03 | Hits Echos:^x04 %d^x03 | Ganancia:^x04 %d^x03 |Total:^x04 %d^x03 por estar en Hora Vicio y ser admin"TAGg_damagep[i], g_Hitsp[i], g_combop[i], (g_combo[i] * g_ganancia[i]))
                
g_ammopacks[i] += g_combo[i] * g_ganancia[i]
            }
            else{
                
zp_colored_print(i"%s ^x04[Party] ^x03Daño Total:^x04 %d^x03 | Hits Echos:^x04 %d^x03 | Ganancia:^x04 %d"TAGg_damagep[i], g_Hitsp[i], g_combop[i])
                
g_ammopacks[i] += g_combop[i]
            }
        }
    }
    
g_damagep[i] = g_Hitsp[i] = g_combop[i] = 0

No me impresiona nada que mis ojos no puedan ver. Fuck yeah
Responder
#14
No mezcles las cosas jaja,

Mira en esto de lo que pasaste más arriba:

Código PHP:
g_damagep[user] += floatround(damage) / g_PartyData[user][Amount_In_Party

Aca divides el valor lo que le sumas en g_damagep[user] , por lo tanto te mostaria otra cantidad en el hud... y la division del ap es al final del party aclaro.

Para reducir el código, yo lo haria de esta forma:

Código PHP:
public task_combo(attacker)
{
    
attacker -= TASK_COMBO
    
    
if(g_combo[attacker]>0)
    {
        
set_hudmessage(02550, -1.00.610.15.00.010.01, -1)
        
ShowSyncHudMsg(attackerg_hudmsg1"==== %s ====^n[Hits: %d][Daño Hit: %d] [Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
        
g_happytime "HORA VICIO COMBO" "COMBOS",g_Hits[attacker], g_damage_hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*(get_pcvar_num(cvar_damage_combo_hv))),
        
g_combo[attacker], g_happytime ? (g_combo[attacker] * 1) : (g_combo[attacker] / 2) )
    }
}
public 
task_party_combo(i)
{
    
-= TASK_COMBOP
    
    
if(g_combop[i]>0)
    {
        if(
g_PartyData[i][In_Party])
        {
            
set_hudmessage(0255255, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(ig_hudmsg1"==== %s PARTY ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos Party: %d]^n[==== %d de AP ====]"
            
g_happytime "HORA VICIO COMBO" "COMBOS",g_Hitsp[i], g_damagep[i], (power(g_combop[i], 1)*(get_pcvar_num(cvar_damage_combo_party_hv))), g_combop[i],
            
g_happytime? (g_combop[i] * 1) :(g_combop[i] / 2))
        }    
    }


Te doy un ejemplo..
Esto:

Código PHP:
if(g_happytime)
    
zp_colored_print(id"Hora vicio ")
else    
    
zp_colored_print(id"Hora vicio "

es lo mismo que esto, en una sola linea:

Código PHP:
zp_colored_print(id"Hora vicio %s",g_happytime ?  "ACTIVADO""DESACTIVADO"


Código PHP:
if(is_user_admin(id))
    
g_ammopacks[id] += g_combo[id] * g_ganancia[id]
else     
    
g_ammopacks[id] += g_combo[id

>>>>>>>>>>>>>>>>>>>>>>>

Código PHP:
g_ammopacks[id] += g_combo[id] * (is_user_admin(id) ? g_ganancia[id] : 1/*Lo multiplica x1 para que deje el valor asi como está*/


Además tene en cuenta sobre la tabulación para que sea las legible el código, si al que te pasé yo no esta bien tabulado es por el navegador Thats what she said
Responder
#15
(24/09/2018, 09:38 PM)warrior escribió: No mezcles las cosas jaja,

Mira en esto de lo que pasaste más arriba:

Código PHP:
public task_combo(attacker)
{
    
attacker -= TASK_COMBO
    
    
if(g_combo[attacker]>0)
    {
        
set_hudmessage(02550, -1.00.610.15.00.010.01, -1)
        
ShowSyncHudMsg(attackerg_hudmsg1"==== %s ====^n[Hits: %d][Daño Hit: %d] [Daño: %d / %d]^n[Total de Combos: %d]^n[==== %d de AP ====]"
        
g_happytime "HORA VICIO COMBO" "COMBOS",g_Hits[attacker], g_damage_hits[attacker], g_damage[attacker], (power(g_combo[attacker], 1)*(get_pcvar_num(cvar_damage_combo_hv))),
        
g_combo[attacker], g_happytime ? (g_combo[attacker] * 1) : (g_combo[attacker] / 2) )
    }
}
public 
task_party_combo(i)
{
    
-= TASK_COMBOP
    
    
if(g_combop[i]>0)
    {
        if(
g_PartyData[i][In_Party])
        {
            
set_hudmessage(0255255, -1.00.610.15.00.010.01, -1)
            
ShowSyncHudMsg(ig_hudmsg1"==== %s PARTY ====^n[Hits: %d | Daño: %d / %d]^n[Total de Combos Party: %d]^n[==== %d de AP ====]"
            
g_happytime "HORA VICIO COMBO" "COMBOS",g_Hitsp[i], g_damagep[i], (power(g_combop[i], 1)*(get_pcvar_num(cvar_damage_combo_party_hv))), g_combop[i],
            
g_happytime? (g_combop[i] * 1) :(g_combop[i] / 2))
        }    
    }


Te doy un ejemplo..
Esto:

Código PHP:
if(g_happytime)
    
zp_colored_print(id"Hora vicio ")
else    
    
zp_colored_print(id"Hora vicio "

es lo mismo que esto, en una sola linea:

Código PHP:
zp_colored_print(id"Hora vicio %s",g_happytime ?  "ACTIVADO""DESACTIVADO"


Código PHP:
if(is_user_admin(id))
    
g_ammopacks[id] += g_combo[id] * g_ganancia[id]
else     
    
g_ammopacks[id] += g_combo[id

>>>>>>>>>>>>>>>>>>>>>>>

Código PHP:
g_ammopacks[id] += g_combo[id] * (is_user_admin(id)) ? g_ganancia[id] : 1/*Lo multiplica x1 para que deje el valor asi como está*/


Además tene en cuenta sobre la tabulación para que sea las legible el código, si al que te pasé yo no esta bien tabulado es por el navegador Thats what she said

FIX
Si no te gusta algo, cámbialo. Si no lo puedes cambiar, cambia la forma en que piensas sobre ello <3
Responder
#16
Edite el último mensaje, me falto una cosa lo de la división que haces Trolleyes
Responder
#17
por ahora todo lo estoy entendiendo bien pero aclaro que esa division lo trajo el party 2.2 + combo y es obvio que el hud dara falsos dijitos ya que mas bien deberia sumar el daño de todos los integrantes del party, ahora ahorrando lineas tambien me di cuenta que se ahora bytes, me ahorre 3.000 bytes con ese metodo xD ahora presento un problema al aplicarlo al reset_combo
Código PHP:
public reset_combo(id)
{
    
id -= TASK_COMBO

    
if (g_combo[id]>0)
    {
        
zp_colored_print(id"%s ^x04[%s]^x03 [Ganancia:^x04 %d^x03] X ^x04[ %s ] ^x03[Total:^x04 %s^x03] %s"
            
TAGg_happytime "HORA VICIO" "COMBOS"g_combo[id], is_user_admin(id) ? g_ganancia[id] : 1is_user_admin(id) ? (g_combo[id] * g_ganancia[id]) : (g_combo[id] * 1), g_happytime "por estar en Hora Vicio" "")
        
        
g_ammopacks[id] += g_combo[id] * (is_user_admin(id) ? g_ganancia[id] : 1)
    }
    
g_damage[id] = g_Hits[id] = g_combo[id] = 0


deberia verse de la siguiente manera: si es HV y es admin x10 en mi caso solo suposicion:

[ZP] [HORA VICIO] [Ganancia: 50] X [10] [Total: 500] por estar en Hora Vicio
y solo se ve de la siguiente manera :

[ZP] [HORA VICIO] [Ganancia: 50] X [ ] [Total: ] por estar en Hora Vicio : aveces salen direcciones de sonidos

ahora sin HV y sin ser admin:
[ZP] [COMBOS] [Ganancia: 50] X [1] [Total: 50]

sale :

[ZP] [COMBOS] [Ganancia: 50] X [ ] [Total: ]

trate encerrando todo y nada osea :
Código PHP:
(is_user_admin(id) ? g_ganancia[id] : 1

esas condiciones son limitadas?

PD: ya lo resolvi puse los %s en %d ahora explicame %d se usa para llamar una variable y las demas para que? :S
No me impresiona nada que mis ojos no puedan ver. Fuck yeah
Responder
#18
https://forums.alliedmods.net/showpost.p...ostcount=3
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)