[GUIA][ZP 4.3] Sistema de Niveles por Frags e Infecciones + Menu Reset
#1
[Guia/Mini-Tuto] - Sistema de Niveles por: Frags y Infecciones + Menu de Reset
Si hay alguno que otro error me lo hacen saber y lo edito Whatever

--------------------------------------
[Actualización: 26/07/19]
--------------------------------------


Comenzemos
Definimos las Infecciones y Frags (los marcos)

Código PHP:
// El +1 seria los Frags/Infecciones que se agregan al subir de nivel. Ej: Nivel 2: Necesitaria (2 Infs y Frags),  Lvl 3: (3 Infs y Frags)... Así cada vez al subir de nivel

#define FRAGS(%1)    (%1 * 1) + 1
#define INFECCIONES(%1)    (%1 * 1) + 1
#define Nivel_Maximo 200 // Nivel Maximo
#define Max_Reset 10 // Reset Maximo 

creamos las variables van a
Código PHP:
Player Vars 

Arriba de
Código PHP:
new g_zombie[33
Agregamos
Código PHP:
new g_level[33]
new 
g_frags[33]
new 
g_infecciones[33
new 
g_reset[33

Quedaria
Código PHP:
new g_level[33// Nivel
new g_frags[33// Frags (Asesinatos)
new g_infecciones[33// Infecciones
new g_reset[33// Reset
new g_zombie[33// is zombie
new g_nemesis[33// is nemesis
new g_survivor[33// is survivor
new g_firstzombie[33// is first zombie
new g_lastzombie[33// is last zombie
new g_lasthuman[33// is last human
//Mas codigo... 
Ahora vamos a
Código PHP:
public fw_PlayerKilled(victimattackershouldgib

Y agregamos despues del
Código PHP:
// Stop bleeding/burning/aura when killed
    
if (g_zombie[victim])
    {
        
remove_task(victim+TASK_BLOOD)
        
remove_task(victim+TASK_AURA)
        
remove_task(victim+TASK_BURN)
    } 
Código PHP:
if (g_zombie[victim] || g_nemesis[victim])
    {
        
g_frags[attacker]+= 1
        check_level
(attacker)
    } 

Quedaria..
Código PHP:
// Stop bleeding/burning/aura when killed
    
if (g_zombie[victim])
    {
        
remove_task(victim+TASK_BLOOD)
        
remove_task(victim+TASK_AURA)
        
remove_task(victim+TASK_BURN)
    }
    
    if (
g_zombie[victim] || g_nemesis[victim])
    {
        
g_frags[attacker]+= 1
        check_level
(attacker)
    } 

Ahora buscamos
Código:
zombieme
y en
Código PHP:
// Reward frags, deaths, health, and ammo packs 

Agregamos
Código PHP:
// Ganara Infecciones al infectar
    
g_infecciones[infector]++
    
check_level(infector
Quedaria..
Código PHP:
// Show deathmsg and reward infector?
if (rewards && infector)
{
    
// Send death notice and fix the "dead" attrib on scoreboard
    
SendDeathMsg(infectorid)
    
FixDeadAttrib(id)
        
    
// Reward frags, deaths, health, and ammo packs
    
UpdateFrags(infectoridget_pcvar_num(cvar_fragsinfect), 11)
    
g_ammopacks[infector] += get_pcvar_num(cvar_ammoinfect)
    
fm_set_user_health(infectorpev(infectorpev_health) + get_pcvar_num(cvar_zombiebonushp))
        
    
// Ganara Infecciones
    
g_infecciones[infector]++
    
check_level(infector// Actualiza el nivel (por si sube de lvl)


Bueno ahora vamos a
Código PHP:
reset_vars(idresetall
y agregaremos debajo de
Código PHP:
if (resetall

Código PHP:
g_level[id] = 1
g_reset
[id] = 0
g_frags
[id] = g_infecciones[id] = 

Quedaria...
Código PHP:
if (resetall)
{
    
g_level[id] = 
    g_reset
[id] = 0
    g_frags
[id] = g_infecciones[id] = 0
    g_ammopacks
[id] = 0
    g_zombieclass
[id] = ZCLASS_NONE
    g_zombieclassnext
[id] = ZCLASS_NONE
    
//.... Mas código 

Bueno ahora crearemos el check_level

- El nivel 200 es de ejemplo, de lo que seria el nivel maximo, pueden poner el que ustedes quieran
Código PHP:
//Debajo de todo su plugin pongan esto
public check_level(id)
{
       
// Si es el nivel maximo no subira más!
    
if (g_level[id] == Max_Level)
        return;

       
// Mientras los Frags/Infecciones sean igual o mayores a lo que pide el macro subira de nivel!
    
while (g_frags[id] >= FRAGS(g_level[id]) && g_infecciones[id] >= INFECCIONES(g_level[id]))
    {
        
g_level[id]++
        
g_frags[id] = g_infecciones[id] = 0
        zp_colored_print
(id,"^x04[ZP]^x01 Subiste al nivel: ^x04%d"g_level[id])
    }

Bueno ahora editaremos el hud para que nos diga los frags y todo eso
Vamos a
Código PHP:
public ShowHUD(taskid

Y reemplazan todo ese code por este.
Código PHP:
// Show HUD Task
public ShowHUD(taskid)
{
    static 
id
    id 
ID_SHOWHUD;
    
    
// Player died?
    
if (!g_isalive[id])
    {
        
// Get spectating target
        
id pev(idPEV_SPEC_TARGET)
        
        
// Target not alive
        
if (!g_isalive[id]) return;
    }
    
    
// Format classname
    
static class[32]
    
    if (
g_zombie[id]) // zombies
    
{
        
        if (
g_nemesis[id])
            
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_NEMESIS")
        else
            
copy(class, charsmax(class), g_zombie_classname[id])
    }
    
    else  
// humans
    
{
        
        if (
g_survivor[id])
            
formatex(class, charsmax(class), "%L"ID_SHOWHUD"CLASS_SURVIVOR")
        else
            
copy(class, charsmax(class), g_human_classname[id])
    }
    
    
    
// Spectating someone else?
    
if (id != ID_SHOWHUD)
    {
        static 
name[32]
        
get_user_name(idnamesizeof name 1)
        
        
// Show name, health, class, and ammo packs
        
set_hudmessage(255255255HUD_SPECT_XHUD_SPECT_Y06.01.10.00.0, -1)
        
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L %s^nHP: %d - %L %s - %L %d"ID_SHOWHUD"SPECTATING"namepev(idpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[id])
    }
    else
    {
        static 
szIncompleto[20]; formatexszIncompleto19"%d/%d"g_frags[id], FRAGS(g_level[id]), FRAGS(g_level[id]) - g_frags[id])
        static 
szCompleto[20]; formatexszCompleto19"[COMPLETADO]" )
        
        static 
siIncompleto[20]; formatexsiIncompleto19"%d/%d"g_infecciones[id], INFECCIONES(g_level[id]), INFECCIONES(g_level[id]) - g_infecciones[id])
        static 
siCompleto[20]; formatexsiCompleto19"[COMPLETADO]" )
        
        
// Show health, class and ammo packs
        
set_hudmessage(redgreenblueHUD_STATS_XHUD_STATS_Y06.01.10.00.0, -1)
        
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"Vida: %d - Clase %s - Aps %d^nNivel: %d - Reset: %d - Frags: %s - Infecciones: %s"get_user_health(id),  class, g_ammopacks[id], g_level[id], g_reset[id], g_frags[id] >= FRAGS(g_level[id]) ? szCompleto szIncompletog_infecciones[id] >= INFECCIONES(g_level[id]) ? siCompleto siIncompleto)
    } 


Ahora agregaremos el Menu de Reset
Vamos al final del plugin o donde prefieran.
Código PHP:
// Menu de Reset
show_menu_reset(id)
{
    static 
menu[300], len
    len 
0
    
    
// Titulo
    
len += formatex(menu[len], charsmax(menu) - len"\yMenu de Reset \r - \yMaximo de Resets:\d %d^n^n"Max_Reset)
    
    
// Texto Agregado
    
len += formatex(menu[len], charsmax(menu) - len"\r Condicion para Resetear^n\r- \w Nivel Necesario:\y %d^n^n"Max_Level)
    
    
// 1. Key (boton) para resetear
    
if (g_level[id] == Max_Level// Si es igual al nivel maximo, puede resetear
    
len += formatex(menu[len], charsmax(menu) - len"\r1.\w Resetear Personaje \y[Lvl: %d]^n^n"Max_Level)
    else 
// Sino, vuelve al menu anterior!
    
len += formatex(menu[len], charsmax(menu) - len"\r1.\d Resetear Personaje [Lvl: %d]^n^n"Max_Level)
    
    
// 0. Salir
    
len += formatex(menu[len], charsmax(menu) - len"^n\r0.\w Salir")
    
show_menu(idKEYSMENUmenu, -1"Reset Menu")
}

// Public del menu
public menu_reset(idkey)
{
    
// Bug si se desconecta.
    
if (!g_isconnected[id]) return PLUGIN_HANDLED;
     
    
// Si no esta muerto no va a resetear!
    
if (g_isalive[id])
    {
           
zp_colored_print(id"^x04[ZP]^x01 Tienes que estar muerto para resetear")
           return 
PLUGIN_HANDLED;
    }

    switch (
key)
    {
        case 
0:
        {
            if (
g_reset[id] >= Max_Resets// Si ya tiene muchos resets, no podra resetear
            
{
                
zp_colored_print(id"^x04[ZP]^x01 Ya Tienes Muchos Resetes")
                return 
PLUGIN_HANDLED
            
}
            else if (
g_level[id] == Max_Level)
            {
                
g_level[id] = 1
                g_infecciones
[id] = g_frags[id] = 0
                g_reset
[id]++
                
zp_colored_print(id"^x04[ZP]^x01 Perfil Reseteado!")

            }
            else
            {
                
zp_colored_print(id"^x04[ZP]^x01 No tienes lo requerido para resetear!")
                
show_menu_reset(id)
            }
        }
    }
    return 
PLUGIN_HANDLED;

___________________________________
SI NECESITAS UN PLUGIN TE LO HAGO $$$
COMUNICATE A MI DISCORD: emanuelitop15
Responder
#2
Al ultimo humano lo mata si o si, nunca lo infecta, fijate bien cuando chequeas al sumarle la infección...

En lo último que pasas sobre la bomba de infección, en :

Código PHP:
case EXTRA_INFBOMB 

Aca estas comprando la bomba, no tirandola. Para que te sume con la bomba tienes que agregar el g_infecciones[id]++ en:

Código PHP:
// Infection Bomb Explosion
infection_explode(ent

Pero este último creo que no es necesario sumarte por lo que ya le sumas en zombieme y estaria sumandole 2 veces, no me acuerdo bien, podrias chequearlo...
Responder
#3
Arreglado. 07/11/2018!
___________________________________
SI NECESITAS UN PLUGIN TE LO HAGO $$$
COMUNICATE A MI DISCORD: emanuelitop15
Responder
#4
Aquie tienes otro error:

Código PHP:
// Infection Bomb Explosion
infection_explode(ent)
{
    
    
// Round ended (bugfix)
    
if (g_endround) return;
    
    
// Get origin
    
static Float:originF[3]
    
pev(entpev_originoriginF)
    
    
// Make the explosion
    
create_blast(originF)
    
    
// Infection nade explode sound
    
static sound[64]
    
ArrayGetString(grenade_infectrandom_num(0ArraySize(grenade_infect) - 1), soundcharsmax(sound))
    
emit_sound(entCHAN_WEAPONsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Get attacker
    
static attacker
    attacker 
pev(entpev_owner)
    
    
//Sumar Infs!
    
g_infecciones[attacker]++ // error
    
    // Infection bomb owner disconnected? (bugfix)
    
if (!is_user_valid_connected(attacker))
    {
        
// Get rid of the grenade
        
engfunc(EngFunc_RemoveEntityent)
        return;
    }
    
    
// Collisions
    
static victim
    victim 
= -1
    
    
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
    {
        
// Only effect alive non-spawnprotected humans
        
if (!is_user_valid_alive(victim) || g_zombie[victim] || g_nodamage[victim])
            continue;
        
        
// Last human is killed
        
if (fnGetHumans() == 1)
        {
            
ExecuteHamB(Ham_Killedvictimattacker0)
            continue;
        }
        
        
// Infected victim's sound
        
ArrayGetString(grenade_infect_playerrandom_num(0ArraySize(grenade_infect_player) - 1), soundcharsmax(sound))
        
emit_sound(victimCHAN_VOICEsound1.0ATTN_NORM0PITCH_NORM)
        
        
// Turn into zombie
        
zombieme(victimattacker011)
    }
    
    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityent)


Código PHP:
//Sumar Infs!
    
g_infecciones[attacker]++ // error 

esto último va dentro de while asi te suma por cada humano que infectaste y no solo por tirarla..

>>>>>>

Código PHP:
// Infection Bomb Explosion
infection_explode(ent)
{
    
    
// Round ended (bugfix)
    
if (g_endround) return;
    
    
// Get origin
    
static Float:originF[3]
    
pev(entpev_originoriginF)
    
    
// Make the explosion
    
create_blast(originF)
    
    
// Infection nade explode sound
    
static sound[64]
    
ArrayGetString(grenade_infectrandom_num(0ArraySize(grenade_infect) - 1), soundcharsmax(sound))
    
emit_sound(entCHAN_WEAPONsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Get attacker
    
static attacker
    attacker 
pev(entpev_owner)
    
    
// Infection bomb owner disconnected? (bugfix)
    
if (!is_user_valid_connected(attacker))
    {
        
// Get rid of the grenade
        
engfunc(EngFunc_RemoveEntityent)
        return;
    }
    
    
// Collisions
    
static victim
    victim 
= -1
    
    
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
    {
        
// Only effect alive non-spawnprotected humans
        
if (!is_user_valid_alive(victim) || g_zombie[victim] || g_nodamage[victim])
            continue;
        
        
// Last human is killed
        
if (fnGetHumans() == 1)
        {
            
ExecuteHamB(Ham_Killedvictimattacker0)
            continue;
        }
        
        
// Infected victim's sound
        
ArrayGetString(grenade_infect_playerrandom_num(0ArraySize(grenade_infect_player) - 1), soundcharsmax(sound))
        
emit_sound(victimCHAN_VOICEsound1.0ATTN_NORM0PITCH_NORM)
        
        
// Turn into zombie
        
zombieme(victimattacker011)
    
    
//Sumar Infs!
    
g_infecciones[attacker]++ /// suma el g_infecciones por cada humano infectado con la bomba
    
}
    
    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityent)


Pero como te dije más antes, nose si es necesario esto por lo que ya sumás dentro de zombieme, haceme el favor de chequearlo y aclararlo
Responder
#5
When dices que todos los tutos son kk, pero el tuyo es recopilacion de kk Whatever
[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
#6
..............F
___________________________________
SI NECESITAS UN PLUGIN TE LO HAGO $$$
COMUNICATE A MI DISCORD: emanuelitop15
Responder
#7
(08/11/2018, 01:09 PM)[E]manuelitop15 escribió:
(08/11/2018, 01:09 AM)kikizon2 escribió: When dices que todos los tutos son kk, pero el tuyo es recopilacion de kk Whatever

Los otros tutos no sirven y dan muchos erros este funciona bien no hables sin saber Whatever

Los otros tutoriales si andan, tu eres el que no lee bien y cometes muchos errores.
Responder
#8
(08/11/2018, 01:09 PM)[E]manuelitop15 escribió:
(08/11/2018, 01:09 AM)kikizon2 escribió: When dices que todos los tutos son kk, pero el tuyo es recopilacion de kk Whatever

Los otros tutos no sirven y dan muchos erros este funciona bien no hables sin saber Whatever

Pues un poco si se, y te digo que es igual (o mas) "kk" que los demas, no entiendo la necesad de tener que 'aportar' sin saber que es lo que se hace.
[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
#9
(06/11/2018, 05:34 PM)[E]manuelitop15 escribió: Definimos las infecciones y frags por marcos
Código PHP:
#define FRAGS(%1)    (%1 * 1) + 1 //Si sube de nivel, se agregaria 1 frag más
#define INFECCIONES(%1)    (%1 * 1) + 1 // Si sube de nivel, se agregaria 1 infección más 

Muy wena tu guia man, solamente me quedó una duda. *Sarcasm*

¿Que tipo de marcos se utilizan? ¿Marcos de puertas o de ventanas? Genius
Mis Aportes:

[ TTT ] Item: Target Gun

[ TTT ] Item: Skeleton Gun (New)
[ TTT ] Item: Pipe Bomb
[ TTT ] Item: Inverse Golden
[Imagen: 76561198074954930.png] [Imagen: venezuela.gif]
Pregúntate si lo que estás haciendo hoy te acerca a el lugar en el que quieres estar mañana. Corazón
Responder
#10
(08/11/2018, 01:09 AM)kikizon2 escribió: When dices que todos los tutos son kk, pero el tuyo es recopilacion de kk Whatever

+1


(08/11/2018, 08:19 PM)SthoNy escribió:
(06/11/2018, 05:34 PM)[E]manuelitop15 escribió: Definimos las infecciones y frags por marcos
Código PHP:
#define FRAGS(%1)    (%1 * 1) + 1 //Si sube de nivel, se agregaria 1 frag más
#define INFECCIONES(%1)    (%1 * 1) + 1 // Si sube de nivel, se agregaria 1 infección más 

Muy wena tu guia man, solamente me quedó una duda. *Sarcasm*

¿Que tipo de marcos se utilizan? ¿Marcos de puertas o de ventanas? Genius

Marcos el del cs wey ese mero
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#11
deberia poner algo completo no los de la ventana chiquita por que me confundo, y deberia poner completo para que asi podamos aprender los scripts para que todo salga bien y tenga una oportunidad crear nuestro plugins Approved
Responder
#12
Es un tutorial muy malo la verdad pero tampoco puede ponerte un vídeo para que tu lo hagas..
& además esto no es para que aprendas a crear un plugin, para eso hay otras guías que no es esta, te lanzas a hacer un ZP si no sabes ni programar wow, te recomendaría practicar antes de hacer tal cosa..


& si ocupas la guía intentalo y esta la sección scripting para que postees tus errores Whatever
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#13
Esto no es un tutorial, mas bien es un aporte nomas, tenes que explicar detalladamente que es tal cosa y que hace tal cosa, deberias de ponerlo en aportes nomas, de todas formas gracias por intentarlo

Suerte.
Plata o Plomo Usted decide


- Pablo Emilio Escobar Gaviria -
Responder
#14
Me puedes pasar el Sma Es que me tira error al copilar RainbowRainbow
Responder
#15
(29/12/2018, 08:33 AM)xo_222 escribió: Me puedes pasar el Sma Es que me tira error al copilar RainbowRainbow

Pásame tu sma que te lo adapto
___________________________________
SI NECESITAS UN PLUGIN TE LO HAGO $$$
COMUNICATE A MI DISCORD: emanuelitop15
Responder
#16
(29/12/2018, 05:50 PM)[E]manuelitop15 escribió:
(29/12/2018, 08:33 AM)xo_222 escribió: Me puedes pasar el Sma Es que me tira error al copilar RainbowRainbow

Pásame tu sma que te lo adapto

Hay esta Cuando le ponlas los levels lo termino de empiezo a editar


Archivos adjuntos
.sma   Descargar AMXX / zombie_plague40 (12).sma (Tamaño: 319.91 KB / Descargas: 66)
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)