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

[ES][TUT][ZP] Titileo de ScreenFade al Infectarse


  
 
 
Thread Tools Display Modes
Author Message
Fail!
BANNED
Join Date: Jan 2010
Location: BFTCommunity
Old 02-01-2010 , 08:36   [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#1

Tutorial: Titileo de ScreenFade al Infectarse.

Empecemos.

Aclaro previamente algunas cosas. Para lograr este efecto no hacemos nada interesante, solamente ponemos un "set_task" que llame a otra "ScreenFade" y que en donde ejecute el siguiente tutorial es en un plugin de Zombie Plague 4.2.

Para el primer paso debemos dirigirnos esta linea:

PHP Code:
// Infection special effects
infection_effects(id
Luego, despues del "{" encontraremos lo siguiente:

PHP Code:
    // Screen fade?
    
if (get_pcvar_num(cvar_infectionscreenfade))
    {
        
// Add a green tint to their screen
        
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade_id)
        
write_short(UNIT_SECOND*1// duration
        
write_short(floatround(UNIT_SECOND// hold time
        
write_short(FFADE_IN// fade type
        
write_byte(0// red
        
write_byte(255// green
        
write_byte(0// blue
        
write_byte(210// alpha
        
message_end()
    } 
Ese es el efecto de la "ScreenFade". Ahora si queremos que titilee debemos remplazar todo ese code por el siguiente:
PHP Code:
    // Screen fade?
    
if (get_pcvar_num(cvar_infectionscreenfade))
    {    
        new 
Float:g_timescreen
        g_timescreen 
2.0
        
        
// Add a green tint to their screen
        
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade_id)
        
write_short(UNIT_SECOND*1// duration
        
write_short(floatround(UNIT_SECOND*1.0)) // hold time
        
write_short(FFADE_IN// fade type
        
write_byte(0// red
        
write_byte(255// green
        
write_byte(0// blue
        
write_byte(210// alpha
        
message_end()
        
        
set_task(g_timescreen"screen_infect1"id)
    } 
En ese code si se dan cuenta hemos colocado un set task debajo de todo llamando a otro public denominado: "screen_infect1".

Ahora debemos hacer un public que se denomine con ese nombre, para ello debemos dirigirnos al final de todo el zombie plague.

Y colocamos el siguiente code:

PHP Code:
// Screen Fade Infected 1
public screen_infect1(id)
{
    new 
Float:g_timescreenb
    g_timescreenb 
2.0
    
    
// Add a green tint to their screen
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade_id)
    
write_short(UNIT_SECOND*1// duration
    
write_short(floatround(UNIT_SECOND*1.0)) // hold time
    
write_short(FFADE_IN// fade type
    
write_byte(0// red
    
write_byte(255// green
    
write_byte(0// blue
    
write_byte(210// alpha
    
message_end()
        
    
set_task(g_timescreenb"screen_infect2"id)
}

// Screen Fade Infected 2
public screen_infect2(id)
{
    new 
Float:g_timescreenc
    g_timescreenc 
2.0
    
    
// Add a green tint to their screen
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade_id)
    
write_short(UNIT_SECOND*1// duration
    
write_short(floatround(UNIT_SECOND*1.0)) // hold time
    
write_short(FFADE_IN// fade type
    
write_byte(0// red
    
write_byte(255// green
    
write_byte(0// blue
    
write_byte(210// alpha
    
message_end()
        
    
set_task(g_timescreenc"screen_infect3"id)
}

// Screen Fade Infected 3
public screen_infect3(id)
{
    
// Add a green tint to their screen
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade_id)
    
write_short(UNIT_SECOND*1// duration
    
write_short(floatround(UNIT_SECOND*1.0)) // hold time
    
write_short(FFADE_IN// fade type
    
write_byte(0// red
    
write_byte(255// green
    
write_byte(0// blue
    
write_byte(210// alpha
    
message_end()

Como podran ver hay ya hemos llamado al "screen_infect1" y ese llama al "screen_infect2" y el "screen_infect2" al "screen_infect3"

Asi logrando que cuando termine la primera "ScreenFade" salga la segunda, etc dando el dicho efecto de un titileo lento.

Espero que les aya gustado, esto fue todo.

Atte: Fail! Scripting 2010

Last edited by Fail!; 02-01-2010 at 08:39.
Fail! is offline
Send a message via MSN to Fail!
ExidiuS*
Junior Member
Join Date: Jan 2010
Old 02-01-2010 , 08:39   Re: [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#2

Fail muy buen aporte Cuchame Tengo un error en mi zp Me ayudas a arreglarlo?
ExidiuS* is offline
Fail!
BANNED
Join Date: Jan 2010
Location: BFTCommunity
Old 02-01-2010 , 08:42   Re: [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#3

Si, solo por PM.
Fail! is offline
Send a message via MSN to Fail!
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 02-01-2010 , 09:17   Re: [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#4

Por qué le pusiste g_ ?
__________________
Javivi is offline
Fail!
BANNED
Join Date: Jan 2010
Location: BFTCommunity
Old 02-01-2010 , 09:43   Re: [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#5

No se. =D
Fail! is offline
Send a message via MSN to Fail!
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 02-01-2010 , 19:04   Re: [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#6

Quote:
Originally Posted by Javivi View Post
Por qué le pusiste g_ ?

por que seguro el 95% del code fue copy and paste

el g_ i f entre otros.. son habitos de programacion...

el g_ = global

i = integrer

f = float...

entre otros..

y su funcion principa entre comillas es para que a los programadores se les facilite codear .. , como para recordar si una variable array etc.. es float integrer etc..

no me explique muy bien pero ojala me entiendas


EDIT: porsierto hay no es una global haci q esta al p2 poner g_ xDD
__________________
capostrike93 is offline
Fail!
BANNED
Join Date: Jan 2010
Location: BFTCommunity
Old 02-01-2010 , 21:47   Re: [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#7

Te equibocas master, no es C&P.
Le puse el "g_" porque se me dio por ponerle, no savia que el "g_" era global.
Ahora que se para que es lo voy a usar cuando sea necesario.
Fail! is offline
Send a message via MSN to Fail!
▬▬▬
BANNED
Join Date: Feb 2010
Old 02-01-2010 , 21:51   Re: [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#8

Gracias.
▬▬▬ is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 02-02-2010 , 11:56   Re: [ES][TUT][ZP] Titileo de ScreenFade al Infectarse
#9

Quote:
Originally Posted by capostrike93 View Post
EDIT: porsierto hay no es una global haci q esta al p2 poner g_ xDD
Ya lo se capostrike, es la Hungarian Notation esa o HN o como sea xD.

Lo que le queria decir era lo que tu pusiste, para que pones g_ si no es global
__________________
Javivi is offline
 



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 01:02.


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