Raised This Month: $51 Target: $400
 12% 

[ZP] Crear niveles por Experiencia [SIN BUGS]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
AdNPrO
Senior Member
Join Date: Feb 2012
Location: Santiago, Chile
Old 04-11-2012 , 16:57   [ZP] Crear niveles por Experiencia [SIN BUGS]
#1

PHP Code:
// Nos Vamos a [[Global Variables]] y agregamos 2 variables 

new g_level[33]
new 
g_exp[33]

// Abajo de las variables que creamos agregaremos un const: 

new const LEVELS[] = {010203549

// Nos vamos al siguiente Forward: 

public fw_PlayerKilled(victimattackershouldgib

// Agregaremos lo siguiente: 

if(!g_zombie[attacker] && g_zombie[victim]) // Si el humano es el atacante ganara 10 frags 

g_exp[attacker] += 10 
zp_colored_print
(attacker"^x04[ZP]^x01 Ganaste^x04 10^x01 de^x04 Exp^x01 por:^x04 Matar Zombie^x01." )
check_level(attacker


// Debajo de este agregaremos otro: 

if(g_zombie[attacker] && !g_zombie[victim]) // Si el zombie es el atacante ganara 8 frags 

g_exp[attacker] += 
zp_colored_print
(attacker"^x04[ZP]^x01 Ganaste^x04 8^x01 de^x04 Exp^x01 por:^x04 Matar Humano^x01." )
check_level(attacker


// Nos vamos a esta línea: 

if (resetall

// Agregaremos: 
g_exp[id] = 
g_level
[id] = 

// Esto Significa que cuando un jugador nuevo entre al servidor sus frags comenzarán en 0 y su nivel sera 1 

// Nos vamos al final del scripting y agregamos el siguiente public: 

public check_level(id

    if (
g_exp[id] > LEVELS[sizeof LEVELS 1] - 1
        return 
PLUGIN_HANDLED
     
    if (
g_exp[id] >= LEVELS[g_level[id]]) 
           { 
                 
g_level[id]++ // Esto es para chequee cuando subes de nivel 
         
                
zp_colored_print(id"^x04[ZP]^x01 Felicitaciones Has Subido de Nivel Ahora eres Nivel:^x04 %d^x01."g_level[id]) // Cuando subas de nivel te enviara este mensaje diciendote a que nivel subiste 
           


    return 
PLUGIN_HANDLED


// Si quieren que en el hud salgan los niveles nos vamos a:  

public ShowHUD(taskid

// Buscamos lo siguiente 

set_hudmessage(redgreenblueHUD_STATS_XHUD_STATS_Y06.01.10.00.0, -1
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L: %d - %L %s - %L %d"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD]) 

// Lo reemplazamos por esto: 

set_hudmessage(redgreenblueHUD_STATS_XHUD_STATS_Y06.01.10.00.0, -1
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync2"%L: %d - %L %s - %L %d ^n Nivel: %d - Frags: %d / %d"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD], g_level[ID_SHOWHUD], g_exp[ID_SHOWHUD], LEVELS[g_level[ID_SHOWHUD]]) 
Lo hice en version ZP Advanced, 4.3, 4.2

Last edited by AdNPrO; 04-21-2012 at 14:55.
AdNPrO is offline
Send a message via MSN to AdNPrO
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode