[ZP][GUIA] Logros por frags
#1
Hola gente, les vengo a traer una guia que hice recien que estaba aburrido Fuck yeah
Es una guia de logros por frags. Al completar un logro ganas ammopacks

Empezamos:

Logros por Frags
Paso 1:
Abajo de los includes agregamos:
Código PHP:
enum _:_STRUCT_LOGROS LOGRO_NAME90 ], LOGRO_INFO90 ], LOGRO_REQUIREDLOGRO_REWARD };
enum _:_FRAGS_LOGROS CT};

new const 
g_iszCLogros[ ][ _STRUCT_LOGROS ] = 
{
    
//NOMBRE DE LOGRO                        / FRAGS / GANANCIA
    
"Mi Primera Sangre""Mata 5 Zombie"5},
    { 
"Aprendiz De Humano""Mata 10 Zombie"1010 },
    { 
"Umbrella""Mata 40 Zombie"4040 },
    { 
"Last Man Standing""Mata 100 Zombie"100100 }
};

new const 
g_iszTLogros[ ][ _STRUCT_LOGROS ] = 
{
    { 
"Mi Primera Masacre""Infecta a 5 Humanos"5},
    { 
"Aprendiz de Zombie""Infecta a 10 Humanos"1010 },
    { 
"I Will Destroy""Infecta a 40 Humanos"4040 },
    { 
"Dominating Our Wolrd!""Infecta a 200 Humanos"200200 }
}; 

new 
g_frags33 ][ _FRAGS_LOGROS ];
new 
g_szText500 ]; 


Paso 2:
En plugin_init() nos dirijimos a // Client commands y abajo del todo agregamos
Código PHP:
register_clcmd("say /logros""clcmd_logros"

Quedaria asi:
Código PHP:
// Client commands
        
register_clcmd("say zpmenu""clcmd_saymenu")
    
register_clcmd("say /zpmenu""clcmd_saymenu")
    
register_clcmd("say unstuck""clcmd_sayunstuck")
    
register_clcmd("say /unstuck""clcmd_sayunstuck")
    
register_clcmd("nightvision""clcmd_nightvision")
    
register_clcmd("drop""clcmd_drop")
    
register_clcmd("buyammo1""clcmd_buyammo")
    
register_clcmd("buyammo2""clcmd_buyammo")
    
register_clcmd("chooseteam""clcmd_changeteam")
    
register_clcmd("jointeam""clcmd_changeteam")
    
register_clcmd("say /logros""clcmd_logros"

Paso 3:
En public fw_PlayerKilled(victim, attacker, shouldgib) nos dirijimos abajo de // Get nightvision give setting y agregamos:

Código PHP:
if(!g_zombie[attacker] && g_zombie[victim]) 
    {
        
g_fragsattacker ][ CT ] += 1      
    
}

    if(
g_zombie[attacker] && !g_zombie[victim]) 
    {
        
g_fragsattacker ][ ] += 
    


Y para chequear los logros agregamos:

Código PHP:
get_logro(attacker

Quedaria asi:
Código PHP:
public fw_PlayerKilled(victimattackershouldgib)
{
    
// Last Zombie Check
    
set_task(0.1"fnCheckLastZombie")
    
    
// Enable dead players nightvision
    
set_task(0.2"spec_nvision"victim)
    
    
// Get nightvision give setting
    
static nvggive
    nvggive 
get_pcvar_num(cvar_nvggive)
    
    if(!
g_zombie[attacker] && g_zombie[victim]) 
    {
        
g_fragsattacker ][ CT ] += 1      
    
}

    if(
g_zombie[attacker] && !g_zombie[victim]) 
    {
        
g_fragsattacker ][ ] += 
    

    
    
// Disable nightvision when killed (bugfix)
    
if (nvggive == && g_nvision[victim])
    {
        if (
g_nvisionenabled[victim] && !get_pcvar_num(cvar_cnvg)) set_user_gnvision(victim0)
        
g_nvision[victim] = false
        g_nvisionenabled
[victim] = false
    
}
    
    
// Turn off nightvision when killed (bugfix)
    
if (nvggive == && g_nvision[victim] && g_nvisionenabled[victim])
    {
        if (!
get_pcvar_num(cvar_cnvg)) set_user_gnvision(victim0)
        
g_nvisionenabled[victim] = false
    
}
    
    
// Stop bleeding/burning when killed
    
if (g_zombie[victim])
        
remove_task(victim+TASK_BLOOD)
    
    
// Nemesis explodes!
    
if (g_nemesis[victim])
        
SetHamParamInteger(32)
    
    
// Get deathmatch mode status and whether the player killed himself
    
static deathmatchselfkill
    deathmatch 
get_pcvar_num(cvar_deathmatch)
    
selfkill = (victim == attacker || !is_user_connected(attacker)) ? true false
    
    
// Respawn if deathmatch is enabled
    
if (deathmatch)
    {
        
// Respawn on suicide?
        
if (selfkill && !get_pcvar_num(cvar_respawnonsuicide))
            return;
        
        
// Respawn if only the last human is left?
        
if (!get_pcvar_num(cvar_respawnafterlast) && fnGetHumans() == 1)
            return;
        
        
// Respawn as zombie?
        
if (deathmatch == || (deathmatch == && random_num(01)) || (deathmatch == && fnGetZombies() < fnGetAlive()/2))
            
g_respawn_as_zombie[victim] = true
        
        
// Set the respawn task
        
set_task(get_pcvar_float(cvar_spawndelay), "respawn_player"victim+TASK_SPAWN)
    }
    
    
// Killed by a non-player entity or self killed
    
if (selfkill) return;
    
    
// Ignore Nemesis/Survivor Frags?
    
if ((g_nemesis[attacker] && get_pcvar_num(cvar_nemignorefrags)) || (g_survivor[attacker] && get_pcvar_num(cvar_survignorefrags)))
        
RemoveFrags(attackervictim)
    
    
// Zombie/nemesis killed human, reward ammo packs
    
if (g_zombie[attacker] && (!g_nemesis[attacker] || !get_pcvar_num(cvar_nemignoreammo)))
        
g_ammopacks[attacker] += get_pcvar_num(cvar_ammoinfect)
    
    
// Get frag rewards for humans and zombies
    
static fragskillfragsinfect
    fragskill 
get_pcvar_num(cvar_fragskill)
    
fragsinfect get_pcvar_num(cvar_fragsinfect)
    
    
// Human killed zombie, add up the extra frags for kill
    
if (!g_zombie[attacker] && fragskill 1)
        
UpdateFrags(attackervictimfragskill-100)
    
    
// Zombie killed human, add up the extra frags for kill
    
if (g_zombie[attacker] && fragsinfect 1)
        
UpdateFrags(attackervictimfragsinfect-100)
        
    
get_logro(attacker)    


Paso 4:
Abajo del todo agregamos lo siguiente:
Código PHP:
public clcmd_logrosindex )
{
    new 
Team get_user_teamindex );
    
    switch( 
Team )
    {
        case 
CS_TEAM_CTLogrosCindex );
        case 
CS_TEAM_TLogrosTindex );
    }
    return 
PLUGIN_HANDLED;
}

public 
LogrosCindex )
{
    new 
iMenu menu_create"Viendo Logros Humanos""Handler_LogrosC" );
    
    for( new 
num 0num sizeofg_iszCLogros ); num++ )
    {
        
formatexg_szTextcharsmaxg_szText ), ( g_fragsindex ][ CT ] >= g_iszCLogrosnum ][ LOGRO_REQUIRED ] ) ? "%s \y[ \wCOMPLETADO \y]":"%s",
        
g_iszCLogrosnum ][ LOGRO_NAME ], g_iszCLogrosnum ][ LOGRO_NAME ] );

        
menu_additemiMenug_szText__menu_makecallback"get_LogroC" ) );
    }
    
menu_displayindexiMenu);
}

public 
LogrosTindex )
{
    new 
iMenu menu_create"Viendo Logros Zombie""Handler_LogrosT" );
    
    for( new 
num 0num sizeofg_iszTLogros ); num++ )
    {
        
formatexg_szTextcharsmaxg_szText ), ( g_fragsindex ][ ] >= g_iszTLogrosnum ][ LOGRO_REQUIRED ] ) ? "%s \y[ \wCOMPLETADO \y]":"%s",
        
g_iszTLogrosnum ][ LOGRO_NAME ], g_iszTLogrosnum ][ LOGRO_NAME ] );

        
menu_additemiMenug_szText__menu_makecallback"get_LogroT" ) );
    }
    
menu_displayindexiMenu);
}

public 
Handler_LogrosTindex iMenuiItem )
{
    
formatexg_szTextcharsmaxg_szText ), "\yLogro: \w%s^n\yInfo: \w%s^n^n\yHumanos Infectados: \w%d\r/\w%d^n^n\rRecompensa: \y%d"
    
g_iszTLogrosiItem ][ LOGRO_NAME ], g_iszTLogrosiItem ][ LOGRO_INFO ], g_fragsindex ][ ], g_iszTLogrosiItem ][ LOGRO_REQUIRED ],
    
g_iszTLogrosiItem ][ LOGRO_REWARD ] );
    
    new 
iMenu menu_createg_szText"LogrosInfo" );
    
    
menu_additemiMenu"Salir" );
    
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
menu_displayindexiMenu);
}
    
        
public 
Handler_LogrosCindex iMenuiItem )
{
    
formatexg_szTextcharsmaxg_szText ), "\yLogro: \w%s^n\yInfo: \w%s^n^n\yZombie Matados: \w%d\r/\w%d^n^n\rRecompensa: \y%d"
    
g_iszCLogrosiItem ][ LOGRO_NAME ], g_iszCLogrosiItem ][ LOGRO_INFO ], g_fragsindex ][ CT ], g_iszCLogrosiItem ][ LOGRO_REQUIRED ],
    
g_iszCLogrosiItem ][ LOGRO_REWARD ] );
    
    new 
iMenu menu_createg_szText"LogrosInfo" );
    
    
menu_additemiMenu"Salir" );
    
menu_setpropiMenuMPROP_EXITMEXIT_NEVER );
    
menu_displayindexiMenu);
}

public 
LogrosInfoindexiMenuiItem menu_destroyiMenu );

public 
get_LogroCindexiMenuiItem ) return g_fragsindex ][ CT ] >= g_iszCLogrosiItem ][ LOGRO_REQUIRED ] ? ITEM_DISABLED ITEM_ENABLED;

public 
get_LogroTindexiMenuiItem ) return g_fragsindex ][ ] >= g_iszTLogrosiItem ][ LOGRO_REQUIRED ] ? ITEM_DISABLED ITEM_ENABLED;


public 
get_logroindex )
{
    new 
Teams get_user_teamindex );
    
    switch( 
Teams )
    {
        case 
CS_TEAM_CT:
        {
            for( new 
0sizeofg_iszCLogros ); n++ )
            {
                if( 
g_fragsindex ][ CT ] == g_iszCLogros][ LOGRO_REQUIRED ] )
                {
                    
zp_colored_printindex"^x04[ZP]^x01 Logro completado:^x03 %s^x01. Ganaste^x04 %d^x01 Ammopacks "g_iszCLogros][ LOGRO_NAME ], g_iszCLogros][ LOGRO_REWARD ] );
                    
g_ammopacksindex ] += g_iszCLogros][ LOGRO_REWARD ];
                }
            }
        }
        case 
CS_TEAM_T:
        {
            for( new 
num 0num sizeofg_iszTLogros ); num++ )
            {
                if( 
g_fragsindex ][ ] == g_iszTLogrosnum ][ LOGRO_REQUIRED ] )
                {
                    
zp_colored_printindex"^x04[ZP]^x01 Logro completado:^x03 %s^x01. Ganaste^x04 %d^x01 Ammopacks "g_iszTLogrosnum ][ LOGRO_NAME ], g_iszTLogrosnum ][ LOGRO_REWARD ] );
                    
g_ammopacksindex ] += g_iszTLogrosnum ][ LOGRO_REWARD ];
                }
            }
        }
    }


Bueno hasta ahi estarian listo los logros, si tube algun error por favor avisarme abajo, lo adapte del sistema de logros de I'mBuggimen
No lo probe, pero compila perfecto.

Despues agregare 2 guias mas (una con hud, y otra con guardado adv_vault)

Creditos:
I'mBuggimen [sistema de logros]
NkkI [Ayudarme a solucionar un problema]
Responder
#2
yo creo que deberias probar las cosas antes de hacer un tutu no?

aparte yo preferiria hacerlo en playerkilled pero bueh.
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#3
(27/10/2015, 11:43 AM)NkkI escribió: yo creo que deberias probar las cosas antes de hacer un tutu no?

Tenes razon, pero me daba pereza borrar o desactivar el mod que tengo para probar algo sencillo y despues borrarlo..

Necesitaba instalar todos los models/sound/sprites y todas esas mier** que tiene un zp

EDIT: igual no modifique nada solo lo adapte asique funciona.
Solo le cambie los nombre a los logros / cambie los puntos por ammopacks / saque el hud
Responder
#4
por que colocas los frags en takedmg Dafuq

cuando llegue ala casa hago una actualizacion para zp xD
~Digito ergo sum~
Responder
#5
(27/10/2015, 01:40 PM)ImBuggimen escribió: por que colocas los frags en takedmg Dafuq

cuando llegue ala casa hago una actualizacion para zp xD

Por que ya estaba el default que seria el de infectar, y ya que esta le mande el de ct
Responder
#6
ponlo en fw_playerkilled mira si es zm o ct pacman

Código PHP:
if(!g_zombie[attacker] && g_zombie[victim]) // aqui decimos si el humano es el atacante
{
  
// aca sumas           
}

if(
g_zombie[attacker] && !g_zombie[victim]) // aqui decimos si el zombie es el atacante
{
            
//aca tambien

[/quote]
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#7
pero si lo haces en takedmg no es casi seguro que infecte un zombie ya que el humano puede tener escudoNothingdohere
~Digito ergo sum~
Responder
#8
Ya lo cambio :3
Responder
#9
edita un poco los nombres xd
Código PHP:
new const g_iszCLogros[ ][ _STRUCT_LOGROS ] = 
{
    
//NOMBRE DE LOGRO                        / FRAGS / GANANCIA
    
"Mi Primera Sangre""Mata 5 Zombie"5},
    { 
"Aprendiz De Humano""Mata 10 Zombie"1010 },
    { 
"Umbrella""Mata 40 Zombie"4040 },
    { 
"Last Man Standing""Mata 100 Zombie"100100 }
};

new const 
g_iszTLogros[ ][ _STRUCT_LOGROS ] = 
{
    { 
"Mi Primera Masacre""Infecta a 5 Humanos"5},
    { 
"Aprendiz de Zombie""Infecta a 10 Humanos"1010 },
    { 
"I Will Destroy""Infecta a 40 Humanos"4040 },
    { 
"Dominating Our Wolrd!""Infecta a 200 Humanos"200200 }
}; 

y en ves de infectar coloca matar ya que matas no infetas es frags :$
Aparte de eso buen aporte para los que buscan tutoriales
~Digito ergo sum~
Responder
#10
(27/10/2015, 04:37 PM)ImBuggimen escribió: edita un poco los nombres xd
Código PHP:
new const g_iszCLogros[ ][ _STRUCT_LOGROS ] = 
{
    
//NOMBRE DE LOGRO                        / FRAGS / GANANCIA
    
"Mi Primera Sangre""Mata 5 Zombie"5},
    { 
"Aprendiz De Humano""Mata 10 Zombie"1010 },
    { 
"Umbrella""Mata 40 Zombie"4040 },
    { 
"Last Man Standing""Mata 100 Zombie"100100 }
};

new const 
g_iszTLogros[ ][ _STRUCT_LOGROS ] = 
{
    { 
"Mi Primera Masacre""Infecta a 5 Humanos"5},
    { 
"Aprendiz de Zombie""Infecta a 10 Humanos"1010 },
    { 
"I Will Destroy""Infecta a 40 Humanos"4040 },
    { 
"Dominating Our Wolrd!""Infecta a 200 Humanos"200200 }
}; 

y en ves de infectar coloca matar ya que matas no infetas es frags :$
Aparte de eso buen aporte para los que buscan tutoriales

Listo gracias, le mande cualquier nombre ya que no juego mucho zp y nose nombres de logros
Por sierto un zombie infecta a un humano no lo mata.
Solo mata al ultimo humano vivo.
Deje g_frags ya que infectar te suma frags...
Responder
#11
podrias hacerlo perfectamente un plugin aparte usando las forwards del zp :V
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#12
(27/10/2015, 05:05 PM)kikizon2 escribió: podrias hacerlo perfectamente un plugin aparte usando las forwards del zp :V

La idea es ayudar a los nuevos para que aprendan.. Por que si no usan 30 plugins para poder hacer su zp
Como yo, antes venia sacaba el plugins y lo mandaba como estaba.

En cambio mirando guias/tut pueden hacer su zp en 1 solo plugin y de paso aprenden por que van mirando lo que estan haciendo
Responder
#13
(27/10/2015, 05:11 PM)Soy nuevo escribió:
(27/10/2015, 05:05 PM)kikizon2 escribió: podrias hacerlo perfectamente un plugin aparte usando las forwards del zp :V

La idea es ayudar a los nuevos para que aprendan.. Por que si no usan 30 plugins para poder hacer su zp
Como yo, antes venia sacaba el plugins y lo mandaba como estaba.

En cambio mirando guias/tut puden hacer su zp en 1 solo plugins y de paso aprenden por que van mirando lo que haciendo

Que tiene de eficiente tener todo en un solo plugin ?
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#14
(27/10/2015, 05:12 PM)kikizon2 escribió:
(27/10/2015, 05:11 PM)Soy nuevo escribió:
(27/10/2015, 05:05 PM)kikizon2 escribió: podrias hacerlo perfectamente un plugin aparte usando las forwards del zp :V

La idea es ayudar a los nuevos para que aprendan.. Por que si no usan 30 plugins para poder hacer su zp
Como yo, antes venia sacaba el plugins y lo mandaba como estaba.

En cambio mirando guias/tut puden hacer su zp en 1 solo plugins y de paso aprenden por que van mirando lo que haciendo

Que tiene de eficiente tener todo en un solo plugin ?

Los que quieren aprender hacen todo en 1 para despues publicarlo...
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)