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(PLUGIN, VERSION, AUTHOR) // Registramos el plugin
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled") // Registramos el evento de muerte.
}
public fw_PlayerKilled(victim, attacker, shouldgib) // 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(victim, pev_origin, originF)
if (get_user_team(victim) == 1) // Verificamos si es TT (Terrorista)
{
// Codigo de efectos
// Particulas de distintos colores
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_PARTICLEBURST) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
write_short(50) // Radio
write_byte(70) // Color
write_byte(3) // Duracion
message_end()
// Particulas amarillas
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_IMPLOSION) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[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_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_DLIGHT) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[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_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_PARTICLEBURST) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
write_short(50) // Radio
write_byte(240) // Color
write_byte(3) // Duracion
message_end()
// Particulas amarillas
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_IMPLOSION) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[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_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_DLIGHT) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[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(Plugin, Version, Author)
/* Ham forward */
RegisterHam(Ham_Killed, "player", "FWKilled")
}
public FWKilled(victim, attacker, shouldgib)
{
new OriginF[3]
get_user_origin(victim, OriginF)
if (get_user_team(victim) == 1)
{
message_begin(MSG_PVS, SVC_TEMPENTITY, OriginF, 0)
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_PVS, SVC_TEMPENTITY, OriginF, 0)
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_PVS, SVC_TEMPENTITY, OriginF, 0)
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_PVS, SVC_TEMPENTITY, OriginF, 0)
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_PVS, SVC_TEMPENTITY, OriginF, 0)
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_PVS, SVC_TEMPENTITY, OriginF, 0)
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
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
|