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

[ZP] Crear niveles por Experiencia [SIN BUGS]


  
 
 
Thread Tools Display Modes
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-18-2012 , 19:46   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#11

Y en SQL ?
bazhenov93 is offline
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 04-19-2012 , 16:00   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#12

Quote:
Originally Posted by bazhenov93 View Post
Y en SQL ?
y en SQL que ?
__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-19-2012 , 16:11   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#13

pues que guarde toda esa info en SQL, cada vez que el player se conecte, el plugin cargara sus dato (xp,kills,etc) y en el hud saldra su info..

eje: show_hudmessage(id, "Level: %s" - Kills: %s", level,kills)
bazhenov93 is offline
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 04-19-2012 , 16:19   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#14

en este tutorial o guía, te enseñan a hacer los niveles, no a guardarlos ni mostrarlos.
aun que el creador de este tema podría agregar mas cosas para hacerlo mas completo, algo así.
__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-19-2012 , 17:32   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#15

de eso hablo yo!
bazhenov93 is offline
RauliTop
BANNED
Join Date: Apr 2012
Location: España
Old 04-20-2012 , 12:08   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#16

Quote:
Originally Posted by bazhenov93 View Post
Y en SQL ?
Esto es un sistema de niveles (no muy bien hecho...), no un sistema de guardado
RauliTop is offline
Send a message via MSN to RauliTop
Geoslide
Senior Member
Join Date: Jun 2011
Location: Chilean player
Old 04-23-2012 , 19:09   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#17

Solo hiciste un copypaste de esto y modificaste

https://forums.alliedmods.net/showthread.php?t=168356
__________________
Basebuilder V6 - plugin for sale
Jailbreak V6 - plugin for sale
more plugins in progress ...

Geoslide ?
Geoslide is offline
BlackFur
BANNED
Join Date: Apr 2012
Location: RCL
Old 04-23-2012 , 19:12   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#18

Quote:
Originally Posted by AdNPrO View Post
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
Ya existe este tutorial , ademas este tutorial es muy simple , cuando tenga tiempo hare un bueno.
Igual gracias por el intento
BlackFur is offline
GokuX
BANNED
Join Date: Jun 2011
Location: Quilpué , Chile
Old 05-19-2012 , 17:45   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#19

Quote:
Originally Posted by AdNPrO View Post
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
Emm es facil llegar copiar un tuto que hize yo hace mucho tiempo (cuando empeze con script) y postearlo cambiando la variable
PHP Code:
g_frags[33
PHP Code:
g_exp[33
Y decir que lo hiciste tú ?

Mi Tutorial

PD: Por si no creen ahí se los deje xd

Last edited by GokuX; 05-19-2012 at 17:46.
GokuX is offline
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 05-22-2012 , 16:45   Re: [ZP] Crear niveles por Experiencia [SIN BUGS]
#20

__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
 



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 10:58.


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