Raised This Month: $32 Target: $400
 8% 

Agregar efecto al morir (2 Tutoriales en 1 Thread)


  
 
 
Thread Tools Display Modes
Author Message
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 11-29-2009 , 01:24   Agregar efecto al morir (2 Tutoriales en 1 Thread)
#1

Bueno este tutorial sirve para agregar un efecto al morir.
Bueno empieso a explicarlo, todo adentro del [ php ]

PHP Code:
#include <amxmodx> // Sin esto el plugin no andaria si o si es nesesario
#include <hamsandwich> // Para registrar el evento de muerte
#include <fakemeta> // Para tomar la posicion del player

#define PLUGIN    "Tutorial efecto al morir" // Registramos el nombre del plugin
#define AUTHOR    "Raddish" // Registramos el author del plugin
#define VERSION    "1.0" // Registramos la version del plugin

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR// Registramos el plugin
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled"// Registramos el evento de muerte.
}

public 
fw_PlayerKilled(victimattackershouldgib// Creamos el public del evento de muerte
{
    
// Tomamos la posicion del player (usuario que muere)
    
    
static Float:originF[3// Creamos un static Para poder utilizar el static para no crearlo al abrir {
    
pev(victimpev_originoriginF)
    
    if (
get_user_team(victim) == 1// Verificamos si es TT (Terrorista)
    
{
        
// Codigo de efectos
        
        // Particulas de distintos colores
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_PARTICLEBURST// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]) // z
        
write_short(50// Radio
        
write_byte(70// Color
        
write_byte(3// Duracion
        
message_end()
        
        
// Particulas amarillas
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_IMPLOSION// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]) // z
        
write_byte(128// Radio
        
write_byte(20// Cantidad de particulas
        
write_byte(3// Duracion
        
message_end()
        
        
// Efecto de luz (En el zombie plague el nemesis tiene alrededor un "aura" roja.
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_DLIGHT// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]) // z
        
write_byte(20// radio (20 = como la del nemesis en el zombie plague)
        
        // COLORES RGB
        
        
write_byte(255// R
        
write_byte(0// G
        
write_byte(0// B
        
        // En este caso le ponemos color rojo seria 255 0 0
        
        
write_byte(2// life ( no lo traduci xq no se que es)
        
write_byte(0// decay rate ( no lo traduci xq no se que es)
        
message_end()
        
    }
    else if (
get_user_team(victim) == 2// Verificamos si es CT (Counter-Terrorist)
    
{
        
// Codigo de efectos
        
        // Particulas de distintos colores
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_PARTICLEBURST// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]) // z
        
write_short(50// Radio
        
write_byte(240// Color
        
write_byte(3// Duracion
        
message_end()
        
        
// Particulas amarillas
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_IMPLOSION// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]) // z
        
write_byte(128// Radio
        
write_byte(20// Cantidad de particulas
        
write_byte(3// Duracion
        
message_end()
        
        
// Efecto de luz (En el zombie plague el nemesis tiene alrededor un "aura" roja.
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_DLIGHT// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]) // z
        
write_byte(20// radio (20 = como la del nemesis en el zombie plague)
        
        // COLORES RGB
        
        
write_byte(0// R
        
write_byte(0// G
        
write_byte(255// B
        
        // En este caso le ponemos color aziñ seria 0 0 255
        
        
write_byte(2// life ( no lo traduci xq no se que es)
        
write_byte(0// decay rate ( no lo traduci xq no se que es)
        
message_end()
    }

Bueno, creo que no me olvide nada.. solamente me falta poner lo de definir los colores de las particulas de distintos colores.
lo habia visto en el foro pero me olvide..

Bueno si ven algun error o mal explicado algo nose guarden las explicaciones mejores y posteenlas.


Tutorial 2 Por Asd'


PHP Code:
#include <amxmodx>
#include <hamsandwich>

new Plugin[] = ""
new Version[] = "1.0"
new Author[] = "Asd'"

public plugin_init()
{
    
/* Plugin */
    
register_plugin(PluginVersionAuthor)
    
    
/* Ham forward */
    
RegisterHam(Ham_Killed"player""FWKilled")
}

public 
FWKilled(victimattackershouldgib)
{
    new 
OriginF[3]
    
get_user_origin(victimOriginF
    
    if (
get_user_team(victim) == 1)
    {
        
message_begin(MSG_PVSSVC_TEMPENTITYOriginF0)
        
write_byte(TE_PARTICLEBURST// TE id
        
write_short(OriginF[0])
        
write_short(OriginF[1])
        
write_short(OriginF[2])
        
write_short(50)
        
write_byte(240)
        
write_byte(3)
        
message_end()
        
        
message_begin(MSG_PVSSVC_TEMPENTITYOriginF0)
        
write_byte(TE_IMPLOSION// TE id
        
write_short(OriginF[0])
        
write_short(OriginF[1])
        
write_short(OriginF[2])
        
write_byte(128)
        
write_byte(20)
        
write_byte(3)
        
message_end()
        
        
message_begin(MSG_PVSSVC_TEMPENTITYOriginF0)
        
write_byte(TE_DLIGHT// TE id
        
write_short(OriginF[0])
        
write_short(OriginF[1])
        
write_short(OriginF[2])
        
write_byte(20)
        
write_byte(0)
        
write_byte(0)
        
write_byte(255
        
write_byte(2)
        
write_byte(0)
        
message_end()
        
    }
    else if(
get_user_team(victim) == 2)
    {
        
message_begin(MSG_PVSSVC_TEMPENTITYOriginF0)
        
write_byte(TE_PARTICLEBURST// TE id
        
write_short(OriginF[0])
        
write_short(OriginF[1])
        
write_short(OriginF[2])
        
write_short(50)
        
write_byte(240)
        
write_byte(3)
        
message_end()
        
        
message_begin(MSG_PVSSVC_TEMPENTITYOriginF0)
        
write_byte(TE_IMPLOSION// TE id
        
write_short(OriginF[0])
        
write_short(OriginF[1])
        
write_short(OriginF[2])
        
write_byte(128)
        
write_byte(20)
        
write_byte(3)
        
message_end()
        
        
message_begin(MSG_PVSSVC_TEMPENTITYOriginF0)
        
write_byte(TE_DLIGHT// TE id
        
write_short(OriginF[0])
        
write_short(OriginF[1])
        
write_short(OriginF[2])
        
write_byte(20)
        
write_byte(0)
        
write_byte(0)
        
write_byte(255
        
write_byte(2)
        
write_byte(0)
        
message_end()
    }

Informacion (Yapa ) Por Capostrike93

Quote:
Originally Posted by capostrike93 View Post
PHP Code:
#define MSG_BROADCAST 0 //Unreliable message to everyone
#define MSG_ONE 1 //Reliable message to one client
#define MSG_ALL 2 //Reliable message to everyone
#define MSG_INIT 3 //Write to the init string
#define MSG_PVS 4 //Ents in PVS of origin
#define MSG_PAS 5 //Ents in PAS of origin
#define MSG_PVS_R 6 //Reliable to PVS
#define MSG_PAS_R 7 //Reliable to PAS
#define MSG_ONE_UNRELIABLE 8 //Send to one client, but don't put in reliable stream
#define MSG_SPEC 9 //Sends to all spectator proxies 

Last edited by Raddish; 11-29-2009 at 02:13.
Raddish is offline
Old 11-29-2009, 01:58
Asd'
This message has been deleted by Asd'.
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 11-29-2009 , 02:01   Re: [ES][TUT] Agregar efecto al morir
#2

Quote:
Originally Posted by Asd' View Post
Te recomendaria que antes de hacer un tutorial sepas el funcionamiento de cada cosa, que por lo que vi hay cosas que no sabes, para la proxima, seria bueno que sepas que hace cada cosa del tutorial.

Saludos.
PHP Code:
write_byte(2// life ( no lo traduci xq no se que es)
        
write_byte(0// decay rate ( no lo traduci xq no se que es)
        
message_end() 
Creo que lo decis por eso

Es que no me acuerdo.. ya que life es vida, y no tiene ningun sentido.. xd
decay rate es (Segun el traductor) tasa de atenuación
Raddish is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 11-29-2009 , 02:03   Re: [ES][TUT] Agregar efecto al morir (2 Tutoriales en 1 Thread)
#3

life es lo que dura, y decay rate es cuando se va quitando el efecto si lo quieres hacer mas lento o mas rapido, en este caso la luz se hace mas pequeña ^^
__________________
capostrike93 is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 11-29-2009 , 02:04   Re: [ES][TUT] Agregar efecto al morir (2 Tutoriales en 1 Thread)
#4

Quote:
Originally Posted by capostrike93 View Post
life es lo que dura, y decay rate es cuando se va quitando el efecto si lo quieres hacer mas lento o mas rapido, en este caso la luz se hace mas pequeña ^^
Gracias ahora lo corrijo.
pd: yo como un boludo le cambiaba el life y ponia 800 "efectos" XD

lo q es ser idiota ehh XD
Raddish is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 11-29-2009 , 02:04   Re: [ES][TUT] Agregar efecto al morir (2 Tutoriales en 1 Thread)
#5

Como ya te criticaron, aclaras cosas obvias, innecesarias, y no cosas como, porque static y no new, porque MSG_PVS y no MSG_BROADCAST etccc
01101101 is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 11-29-2009 , 02:06   Re: [ES][TUT] Agregar efecto al morir (2 Tutoriales en 1 Thread)
#6

Quote:
Originally Posted by 01101101 View Post
Como ya te criticaron, aclaras cosas obvias, innecesarias, y no cosas como, porque static y no new, porque MSG_PVS y no MSG_BROADCAST etccc
Lo que esta en negrita, ahora lo agregoe, y en negrita subrayado me falta q me expliquen, xq nose la diferencia u.u
Raddish is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 11-29-2009 , 02:07   Re: [ES][TUT] Agregar efecto al morir (2 Tutoriales en 1 Thread)
#7

Quote:
Originally Posted by 01101101 View Post
Como ya te criticaron, aclaras cosas obvias, innecesarias, y no cosas como, porque static y no new, porque MSG_PVS y no MSG_BROADCAST etccc

static por q no queremos cambiar el valor osea va a ser estatico rolf

y..

PHP Code:

#define MSG_BROADCAST 0 //Unreliable message to everyone
#define MSG_ONE 1 //Reliable message to one client
#define MSG_ALL 2 //Reliable message to everyone
#define MSG_INIT 3 //Write to the init string
#define MSG_PVS 4 //Ents in PVS of origin
#define MSG_PAS 5 //Ents in PAS of origin
#define MSG_PVS_R 6 //Reliable to PVS
#define MSG_PAS_R 7 //Reliable to PAS
#define MSG_ONE_UNRELIABLE 8 //Send to one client, but don't put in reliable stream
#define MSG_SPEC 9 //Sends to all spectator proxies 
__________________
capostrike93 is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 11-29-2009 , 02:10   Re: [ES][TUT] Agregar efecto al morir (2 Tutoriales en 1 Thread)
#8

Quote:
Originally Posted by capostrike93 View Post
static por q no queremos cambiar el valor osea va a ser estatico rolf
O.o que estas diciendo
el valor si que va a cambiar, static es porque como la funcion va a ser llamada muchas veces, dejara ese float en la memoria, en vez de crearlo cada vez que ejecuta la funcion.
01101101 is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 11-29-2009 , 02:11   Re: [ES][TUT] Agregar efecto al morir (2 Tutoriales en 1 Thread)
#9

Quote:
Originally Posted by 01101101 View Post
O.o que estas diciendo
el valor si que va a cambiar, static es porque como la funcion va a ser llamada muchas veces, dejara ese float en la memoria, en vez de crearlo cada vez que ejecuta la funcion.
Entonces masomenos lo que puse esta bien u.u?
Raddish is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 11-29-2009 , 02:13   Re: [ES][TUT] Agregar efecto al morir (2 Tutoriales en 1 Thread)
#10

Quote:
Originally Posted by 01101101 View Post
O.o que estas diciendo
el valor si que va a cambiar, static es porque como la funcion va a ser llamada muchas veces, dejara ese float en la memoria, en vez de crearlo cada vez que ejecuta la funcion.

:O vivi engañado jhahahaha
__________________
capostrike93 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 18:02.


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