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

[ZP] Efecto al ser transformado en zombie 4.3


  
 
 
Thread Tools Display Modes
Author Message
Sidix
Senior Member
Join Date: Feb 2011
Location: Limbo City
Old 04-16-2012 , 11:07   [ZP] Efecto al ser transformado en zombie 4.3
#1

Bueno, yo aquí les voy a explicar como hacer un efecto al ser transformado en zombie 4.3

con un model.

Utilizado en la versión: 4.3

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

new g_efecto_index[33], g_tuvo_efecto[33// creamos las varibles para llamar el evento y terminarlo
new const efecto_spr[] = "sprites/infeccion_efecto.spr" // creamos una constante para el sprite.

new cvar_escalacvar_tiemposprcvar_nivelefecto // creamos tres cvars

// cvar_scale: Para cambiar la escala o nivel del efecto
// cvar_showtime: El tiempo en mostrar en efecto
// cvar_lightlevel: el nivel de luz del efecto.

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Llamo a la forward de la libreria Ham Sandwich: Ham_Spawn
        // estamos registrando la entidad llamada al player
    
RegisterHam(Ham_Spawn"player""fw_spawn_post"1)
    
register_forward(FM_AddToFullPack"fw_WhatTheFuck_Post"1// Registramos la forward del evento
    
    // Cvars
    
cvar_escala register_cvar("zp_in-ef_scale""0.035"// registramos la cvar
    
cvar_tiempospr register_cvar("zp_in-ef_showtime""2.0")  // registramos la cvar
    
cvar_nivelefecto register_cvar("zp_in-ef_lightlevel""100.0")  // registramos la cvar
}

public 
plugin_precache()
{
    
precache_model(efecto_spr// Precacheamos

PHP Code:
// Creamos el public "Ham_Spawn"
public fw_spawn_post(id)
{
    if(
g_tuvo_efecto[id])  // termina el efecto despues de la infeccion
        
remover_efecto(id// remueve el efecto.
}

public 
zp_user_infected_post(idattacker)
{
    if(
is_user_alive(attacker)) // chekeamos al jugador conectado
    
{
        
show_effect(id// muestra el efecto
    
}

PHP Code:
// Creamos el public de la entidad que mostrará el efecto.
public show_effect(id)
{
    
g_efecto_index[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_sprite")) // la llamamos
    
    
if (!pev_valid(g_efecto_index[id]))
        return 
// hacemos return
    
    
g_tuvo_efecto[id] = 1
    
    set_pev
(g_efecto_index[id], pev_solidSOLID_NOT//
    
set_pev(g_efecto_index[id], pev_movetypeMOVETYPE_NONE// creamos el movimiento del evento

    
engfunc(EngFunc_SetModelg_efecto_index[id], efecto_spr)
    
    
set_pev(g_efecto_index[id], pev_rendermodekRenderTransAlpha)
    
set_pev(g_efecto_index[id], pev_renderamt0.0)
    
set_pev(g_efecto_index[id], pev_ownerid)
    
set_pev(g_efecto_index[id], pev_scaleget_pcvar_float(cvar_escala)) // setea la escala
    
set_pev(g_efecto_index[id], pev_light_levelget_pcvar_float(cvar_nivelefecto)) // setea el nivel de efecto
    
    
set_task(get_pcvar_float(cvar_tiempospr), "remover_efecto"g_efecto_index[id]) // task para remover el efecto en "x" tiempo.

PHP Code:
// creamos public del evento
public fw_WhatTheFuck_Post(eseenthosthost_flagsplayerp_set)
{
    if(!(
host 33))
        return 
FMRES_IGNORED
        
    
if(ent != g_efecto_index[host] || !pev_valid(ent))
        return 
FMRES_IGNORED
        
    
if(pev(entpev_owner) != host)
        return 
FMRES_IGNORED
        
    
if(!is_user_alive(host))
        return 
FMRES_IGNORED
        
    
static Float:origin[3], Float:forvec[3], Float:voffsets[3], Float:Angles[3]
    
    
pev(hostpev_originorigin)
    
pev(hostpev_view_ofsvoffsets)
    
pev(hostpev_anglesAngles)
    
    
xs_vec_add(originvoffsetsorigin)
    
    
// Vector hacia adelante en la dirección de la victima
    
velocity_by_aim(host10forvec)
    
    
// Setea el sprite en el origin
    
xs_vec_add(originforvecorigin)
    
    
engfunc(EngFunc_SetOriginentorigin)
    
set_es(esES_Originorigin)
    
set_es(esES_AnglesAngles)
    
    
// Hace visible el sprite
    
set_es(esES_RenderModekRenderTransAdd)
    
set_es(esES_RenderAmt200)
        
    return 
FMRES_HANDLED

PHP Code:
// esta remueve la entidad del efecto despues de la infeccion
public remover_efecto(ent)
{
    
g_tuvo_efecto[pev(entpev_owner)] = 0
    
    
if(pev_valid(ent))
        
engfunc(EngFunc_RemoveEntityent// remueve la entidad.

espero que les haya gustado...

se pueden comentar sugerencias constructivas. !

pd: falta explicar un poco pero ahora añado más explicación...

[IMG]http://img560.**************/img560/9900/infeccionefecto.png[/IMG]


Allí varios efectos... !

Creditos a : Dias
Attached Files
File Type: zip infeccion_efecto.zip (20.4 KB, 233 views)
File Type: zip bla33.zip (9.6 KB, 195 views)
File Type: zip bla2.zip (10.0 KB, 219 views)
__________________
[IMG]http://img839.**************/img839/1879/dmcdanteprofile.png[/IMG]

Last edited by Sidix; 03-16-2013 at 02:26.
Sidix is offline
Old 04-16-2012, 13:00
Roccoxx
This message has been deleted by Roccoxx. Reason: me mande cualquiera :S
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 04-16-2012 , 17:29   Re: [ZP] Poner efecto al ser infectado 4.3
#2

1.- que efecto ?
2.- que sprite usar ?
3.- good.
__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
Exc3ll@N
Veteran Member
Join Date: Oct 2009
Location: Donde me lleve el viento
Old 04-16-2012 , 19:17   Re: [ZP] Poner efecto al ser infectado 4.3
#3

el efecto lo ve el usuario que fue infectado en su pantalla o todos' , si lo ven todos , podes usar otra forma con menos code y misma funcion....
__________________
Haz lo que sientas y te haga feliz.
Exc3ll@N is offline
Send a message via MSN to Exc3ll@N
Sidix
Senior Member
Join Date: Feb 2011
Location: Limbo City
Old 04-16-2012 , 19:37   Re: [ZP] Poner efecto al ser infectado 4.3
#4

el efecto lo visualiza el usuario infectado en el momento de ser tocado por un zombie... !!!
__________________
[IMG]http://img839.**************/img839/1879/dmcdanteprofile.png[/IMG]
Sidix is offline
Old 04-16-2012, 20:29
XINLEI
This message has been deleted by XINLEI. Reason: fucking edits
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 04-16-2012 , 20:33   Re: [ZP] Poner efecto al ser infectado 4.3
#5

Digame quien le dio eso y de donde lo sacó, o viene con el cuento de que se lo encontró.
XINLEI is offline
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 04-16-2012 , 20:40   Re: [ZP] Poner efecto al ser infectado 4.3
#6

el modelo lo vi en another zombie models collection yo xdd.
cambia el titulo, suena raro "efecto al ser infectado", podria ser efecto al ser contagiado ...
__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
Sidix
Senior Member
Join Date: Feb 2011
Location: Limbo City
Old 04-16-2012 , 22:19   Re: [ZP] Poner efecto al ser infectado 4.3
#7

XINLEI: La idea no es mía pero quise poste-arla, solo trato de aportar ya que siempre salen con "hacer niveles para zp" pienso que eso ya cansa... !!!

xLeonNNN: No es lo mismo? o puede ser "Efecto al ser transformado en zombie" ?
__________________
[IMG]http://img839.**************/img839/1879/dmcdanteprofile.png[/IMG]

Last edited by Sidix; 04-16-2012 at 22:22.
Sidix is offline
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 04-16-2012 , 22:21   Re: [ZP] Poner efecto al ser infectado 4.3
#8

es lo mismo, pero suena raro "efecto al ser infectado", dilo en voz alta y dime Jaa.
contagiado es mejor.
__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
Sidix
Senior Member
Join Date: Feb 2011
Location: Limbo City
Old 04-16-2012 , 22:30   Re: [ZP] Poner efecto al ser infectado 4.3
#9

esta bien ;)

ya cambié
__________________
[IMG]http://img839.**************/img839/1879/dmcdanteprofile.png[/IMG]

Last edited by Sidix; 04-16-2012 at 22:30.
Sidix is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 04-16-2012 , 23:00   Re: [ZP] Poner efecto al ser infectado 4.3
#10

Quote:
Originally Posted by Sidix View Post
XINLEI: La idea no es mía pero quise poste-arla
no dije de la idea, el code.

Quote:
Originally Posted by xLeoNNN View Post
es lo mismo, pero suena raro "efecto al ser infectado", dilo en voz alta y dime Jaa.
contagiado es mejor.
¿contagiado? ni que fuera gripe.
XINLEI is offline
 


Thread Tools
Display Modes

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


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