[ZP] Addon: Estadisticas de la ronda
#1
Zombie Plague Addon: Estadisticas de la ronda

Descripcion
Cita:Con este plugin se muestra un hud al final de la ronda con los ammopacks ganados en la ronda y con los ammopacks totales, el jugador con mayor recaudación sera premiado con una cantidad de ammopacks x donde x es el valor de la cvar "zp_recompensa_mejor_ronda".

Includes
Cita:amxmodx
hamsandwich
zombieplague


Plugins requeridos
Cita:Zombie Plague


Configuración
Cita:zp_recompensa_mejor_ronda "5" // Entre "" premio en cantidad de ammopacks al mejor de la ronda.


Archivos adjuntos
.sma   Descargar AMXX / zp_mejor_ronda.sma (Tamaño: 2.65 KB / Descargas: 664)
[Imagen: 76561197999970868.png]
Responder
#2
No soy de jugar zp ni de codear, pero me parece una idea bastante buena.
Responder
#3
La verdad que lo puse por que un amigo me lo pidió y lo empece a hacer y supongo que a mas de alguien le servirá, ademas es como para que vaya llegando mas gente, ya que los de alliedmodders no tienen Spanish Section.
[Imagen: 76561197999970868.png]
Responder
#4
Muy bueno, gracias por aportar..
Responder
#5
Simple y no lo había visto antes.
Aprobado.
Responder
#6
Alguien qme ayuda a adaptarlo a ZA ?
EDIT: Solucionado
Responder
#7
Wow tengo un zp de niveles por ammopacks y me sirve mucho asi todos hacen lo posible por matar a los zombies o humanos xD Gracias :p
No firma[/color]
Responder
#8
Me parece buena la idea de que te de los aps al terminar la ronda;
pero creo que lo he visto antes en algunos ZP:
creo que era asi

Evil spiret: Daño 200 - Aps ganados 100 - Frags 7

Algo asi, iba de mayor a menor en 5 lugares. Quien habia hecho mas daño , matado mas , etc

Seguro uso tu plugin ; muchas gracias por aportarlo
NUEVO ZOMBIE PLAGUE + LVLS!! UNETE A LA COMUNIDAD
[Imagen: b_350_20_ffad41_e98100_000000_591f11.png]


Responder
#9
Gracias man, sirvio de mucha ayuda Guiño)
Responder
#10
Lo testee en 5.0 y me sale este log en debug
bueno y ademas del log tampoco me funciona como tal no sale el hud .

Código PHP:
L 11/05/2014 12:29:52Invalid CVAR pointer
L 11
/05/2014 12:29:52: [AMXXDisplaying debug trace (plugin "zp_mejor_ronda.amxx")
L 11/05/2014 12:29:52: [AMXXRun time error 10native error (native "get_pcvar_num")
L 11/05/2014 12:29:52: [AMXX] [0zp_mejor_ronda.sma::fw_TakeDamage (line 54
Siempre dispuesto a aprendes cosas nuevas todos los días Sonrisa
Responder
#11
El problema es que el 5.0 no usa esos cvars pointers o sea estos zp_human_damage_reward y zp_surv_ignore_rewards, y es mejor usar las natives del 5.0 cuando llegue a mi casa te ayudo..

P.S: proba..

Código PHP:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <zp50_core>
#include <zp50_class_survivor> 
#include <zp50_ammopacks>
#include <zp50_gamemodes>

#define PLUGIN "[ZP] Addon: Estadisticas de la ronda"
#define VERSION "1.0"
#define AUTHOR "LA BANDA"

new g_AmmoPacksRound[33], g_damagedealt_human[33

enum _:iMaxVars
{
    
AmmoDamage,
    
SurvRewards,
    
Recompensa
}

new 
iCvars[iMaxVars]
    
new 
g_MsgSync

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
iCvars[AmmoDamage] = get_cvar_pointer("zp_ammop_zombie_damaged_hp")
    
iCvars[SurvRewards] = get_cvar_pointer("zp_ammop_survivor_ignore")
    
iCvars[Recompensa] = register_cvar("zp_recompensa_mejor_ronda""5"// Ammopacks de recompensa al mejor de la ronda
    
    
g_MsgSync CreateHudSyncObj()
}

public 
client_putinserver(id)
{
    
g_damagedealt_human[id] = 0
    g_AmmoPacksRound
[id] = 0
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if (
victim == attacker || !(<= attacker <= get_maxplayers() && is_user_connected(attacker)))
        return 
HAM_IGNORED;
    
    if (
zp_core_is_zombie(attacker) == zp_core_is_zombie(victim))
        return 
HAM_SUPERCEDE;
        
    if (
zp_core_is_zombie(attacker))
        return 
HAM_IGNORED;
        
    static 
xCvarxCvar get_pcvar_num(iCvars[AmmoDamage])
        
    if (
xCvar && (!zp_class_survivor_get(attacker) || !get_pcvar_num(iCvars[SurvRewards])))
    {
        
g_damagedealt_human[attacker] += floatround(damage)
        
        while (
g_damagedealt_human[attacker] > xCvar)
        {
            
g_AmmoPacksRound[attacker]++
            
g_damagedealt_human[attacker] -= xCvar
        
}
    }
    return 
HAM_IGNORED;
}

public 
zp_fw_gamemodes_end(game_mode_id)
{    
    
fnShowRoundHud()
    
arrayset(g_AmmoPacksRound033)
}

fnShowRoundHud()
{
    if(!
get_pcvar_num(iCvars[AmmoDamage]))
        return
        
    new 
iPlayers[32], iNum;
    
get_players(iPlayersiNum);
     
    if (
iNum 2)
        return;
        
    new 
iMaxAmmoiBestPlayeridxCvarxCvar get_pcvar_num(iCvars[Recompensa])
    
    for (new 
0iNumi++)
    {
        
id iPlayers[i];
        if (
g_AmmoPacksRound[id] > iMaxAmmo)
        {
            
iBestPlayer id;
            
iMaxAmmo g_AmmoPacksRound[iBestPlayer]
        }
            
        
set_hudmessage(0100255, -1.00.2500.06.01.01.0, -1)
        
ShowSyncHudMsg(idg_MsgSync"Estadisticas de esta ronda^n^nGanaste %d ammopacks^nTienes %d Ammopacks"g_AmmoPacksRound[id], zp_ammopacks_get(id));    
    }
    
get_user_name(iBestPlayeriPlayerscharsmax(iPlayers))
    
zp_ammopacks_set(iBestPlayerzp_ammopacks_get(iBestPlayer) + xCvar)
    
client_print(0print_chat"[ZP] Mejor jugador de la ronda: %s [Recompensa: %d Ammopacks]."iPlayersxCvar)

Responder
#12
(05/11/2014, 11:37 PM)wicho escribió: El problema es que el 5.0 no usa esos cvars pointers o sea estos zp_human_damage_reward y zp_surv_ignore_rewards, y es mejor usar las natives del 5.0 cuando llegue a mi casa te ayudo..

P.S: proba..

Código PHP:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <zp50_core>
#include <zp50_class_survivor> 
#include <zp50_ammopacks>
#include <zp50_gamemodes>

#define PLUGIN "[ZP] Addon: Estadisticas de la ronda"
#define VERSION "1.0"
#define AUTHOR "LA BANDA"

new g_AmmoPacksRound[33], g_damagedealt_human[33

enum _:iMaxVars
{
    
AmmoDamage,
    
SurvRewards,
    
Recompensa
}

new 
iCvars[iMaxVars]
    
new 
g_MsgSync

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
iCvars[AmmoDamage] = get_cvar_pointer("zp_ammop_zombie_damaged_hp")
    
iCvars[SurvRewards] = get_cvar_pointer("zp_ammop_survivor_ignore")
    
iCvars[Recompensa] = register_cvar("zp_recompensa_mejor_ronda""5"// Ammopacks de recompensa al mejor de la ronda
    
    
g_MsgSync CreateHudSyncObj()
}

public 
client_putinserver(id)
{
    
g_damagedealt_human[id] = 0
    g_AmmoPacksRound
[id] = 0
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if (
victim == attacker || !(<= attacker <= get_maxplayers() && is_user_connected(attacker)))
        return 
HAM_IGNORED;
    
    if (
zp_core_is_zombie(attacker) == zp_core_is_zombie(victim))
        return 
HAM_SUPERCEDE;
        
    if (
zp_core_is_zombie(attacker))
        return 
HAM_IGNORED;
        
    static 
xCvarxCvar get_pcvar_num(iCvars[AmmoDamage])
        
    if (
xCvar && (!zp_class_survivor_get(attacker) || !get_pcvar_num(iCvars[SurvRewards])))
    {
        
g_damagedealt_human[attacker] += floatround(damage)
        
        while (
g_damagedealt_human[attacker] > xCvar)
        {
            
g_AmmoPacksRound[attacker]++
            
g_damagedealt_human[attacker] -= xCvar
        
}
    }
    return 
HAM_IGNORED;
}

public 
zp_fw_gamemodes_end(game_mode_id)
{    
    
fnShowRoundHud()
    
arrayset(g_AmmoPacksRound033)
}

fnShowRoundHud()
{
    if(!
get_pcvar_num(iCvars[AmmoDamage]))
        return
        
    new 
iPlayers[32], iNum;
    
get_players(iPlayersiNum);
     
    if (
iNum 2)
        return;
        
    new 
iMaxAmmoiBestPlayeridxCvarxCvar get_pcvar_num(iCvars[Recompensa])
    
    for (new 
0iNumi++)
    {
        
id iPlayers[i];
        if (
g_AmmoPacksRound[id] > iMaxAmmo)
        {
            
iBestPlayer id;
            
iMaxAmmo g_AmmoPacksRound[iBestPlayer]
        }
            
        
set_hudmessage(0100255, -1.00.2500.06.01.01.0, -1)
        
ShowSyncHudMsg(idg_MsgSync"Estadisticas de esta ronda^n^nGanaste %d ammopacks^nTienes %d Ammopacks"g_AmmoPacksRound[id], zp_ammopacks_get(id));    
    }
    
get_user_name(iBestPlayeriPlayerscharsmax(iPlayers))
    
zp_ammopacks_set(iBestPlayerzp_ammopacks_get(iBestPlayer) + xCvar)
    
client_print(0print_chat"[ZP] Mejor jugador de la ronda: %s [Recompensa: %d Ammopacks]."iPlayersxCvar)


esto me deja en los log

Código PHP:
L 11/06/2014 - 08:12:49: [ZPInvalid Player (0)
L 11/06/2014 - 08:12:49: [AMXXDisplaying debug trace (plugin "zp_mejor_ronda.amxx")
L 11/06/2014 - 08:12:49: [AMXXRun time error 10native error (native "zp_ammopacks_get")
L 11/06/2014 - 08:12:49: [AMXX] [0mejor_jugador_ronda.sma::fnShowRoundHud (line 104)
L 11/06/2014 - 08:12:49: [AMXX] [1mejor_jugador_ronda.sma::zp_fw_gamemodes_end (line 74
Siempre dispuesto a aprendes cosas nuevas todos los días Sonrisa
Responder
#13
Quien adapta para basebuilder
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)