Mensajes: 1,240
Temas: 96
Registro en: Oct 2013
Reputación:
10
01/05/2014, 01:44 PM
(Última modificación: 29/05/2020, 10:47 AM por ivan. Edited 3 times in total.)
"hola aca les en señare como aser awp frost , fuego ok comensemos esto sirve para la vercion 4.2, 4.1, 4.3"
SIRVE PARA CUALQUIER ARMA, SOLO SE LE DEBE AGREGAR EL EFECTO EN EL HANDLE...
Código PHP: new g_weapon_effect[33]; // AWP O EL ARMA QUE QUIERAN...
// luego buscan : public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) // y en la parte donde es humano "if (!g_zombie[attacker])" debajo de la llave "{"
switch (g_weapon_effect[attacker]) { case 1: CHECK___EFFECT(victim, 0) // aca podrian poner la funcion "fire_explode" de la que trae default el zp case 2: CHECK___EFFECT(victim, 1) // aca podrian poner la funcion "frost_explode" de la que trae default el zp }
// ESTO SE PUEDE REMPLAZAR POR EL QUE TRAE EL ZOMBIE PLAGUE DEFAULT PERO POR SIN NO LO QUIEREN LES DEJO ESTE // ESTO LO COPIAN DONDE QUIERAN...
CHECK___EFFECT(victim, type) { static Float:originF[3] pev(victim, pev_origin, originF) if (!is_user_alive(victim) || !g_zombie[victim] || g_frozen[victim] || g_nemesis[victim] // SI QUIEREN QUE EL NEMESIS RECIBA EL EFECTO LO BORRAN... || g_nodamage[victim]) return; message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim) write_byte(0) // damage save write_byte(0) // damage take write_long(type == 0 ? DMG_BURN : DMG_DROWN) // damage type - DMG_FREEZE write_coord(0) // x write_coord(0) // y write_coord(0) // z message_end() static Float:EFECT_TIME; EFECT_TIME = 3.0; message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, victim) write_short(UNIT_SECOND*1) write_short(floatround(UNIT_SECOND*EFECT_TIME)) write_short(FFADE_IN) write_byte(type == 1 ? 0 : 150) // red write_byte(type == 1 ? 50 : 0) // green write_byte(type == 1 ? 255: 0) // blue write_byte(100) // alpha message_end() if (type == 1) { set_rendering(victim, kRenderFxGlowShell, 0, 150, 250, kRenderNormal, 1) if (pev(victim, pev_flags) & FL_ONGROUND) set_pev(victim, pev_gravity, 999999.9) else set_pev(victim, pev_gravity, 0.000001) g_frozen[victim] = true; set_task(EFECT_TIME, "remove_freeze", victim) } else { static params[1] if (g_nemesis[victim]) params[0] = get_pcvar_num(cvar_fireduration) else params[0] = get_pcvar_num(cvar_fireduration)*5 set_task(0.1, "burning_flame", victim+TASK_BLOOD, params, sizeof params) } }
// PARA AGREGAR EL EFECTO, YA SEA CUALQUIER ARMA, EN SU MENU DE ARMAS EN EL HANDLE AGREGAN EL SWITCH EJEMPLO EN EL ZP // BUSCAN buy_primary_weapon(id, selection) Y DEBAJO DEL CANBUY "g_canbuy[id] = false" AGREGAN
switch (selection) { case 5: g_weapon_effect[id] = 1 // EL ARMA NUMERO 5 TENDRA EFECTO DE FUEGO case 6: g_weapon_effect[id] = 2 // EL ARMA NUMERO 6 TENDRA EFECTO DE HIELO default: g_weapon_effect[id] = 0 // SI SELECCIONO OTRA ARMA LE SACAMOS EL EFECTO }
/*ESTO YA ES OPCIONAL GENTE*/
// para poner un model para cada awp tenesmos q aser esto
new const model_awp_frost[] = { "models/zombie_plague/v_awp1.mdl" } new const model_awp_fire[] = { "models/zombie_plague/awp2.mdl" }
ahora para precachar el model bamos a : public plugin_precache y ponemos
engfunc(EngFunc_PrecacheModel, model_awp_frost) engfunc(EngFunc_PrecacheModel, model_awp_fire)
y buscamos : replace_models y agregamos esto al final
case CSW_AWP: { if (g_weapon_effect[id] == 1) set_pev(id, pev_weaponmodel2, model_awp_fire) else if (g_weapon_effect[id] == 2) set_pev(id, pev_weaponmodel2, model_awp_frost) }
// esto fue todo comente si me olvide algo dijan
CODIGO MEJORADO... SI VEN ERRORES ME AVISA!
Mensajes: 6,664
Temas: 81
Registro en: Jan 2014
Reputación:
68
Ohhh pero que bonita guita jaja xD
► NO DOY AYUDA VIA MENSAJE PRIVADO ◄
* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Mensajes: 1,240
Temas: 96
Registro en: Oct 2013
Reputación:
10
01/05/2014, 08:32 PM
(Última modificación: 01/05/2014, 08:35 PM por ivan.)
(01/05/2014, 08:17 PM)kikizon2 escribió: Ohhh pero que bonita guita jaja xD
:o hay arreglo el titulo se escrivio mal jajajaj
Mensajes: 843
Temas: 13
Registro en: Nov 2013
Reputación:
11
Los comentarios hazlo fuera de las etiquetas asi queda mejor.
Mensajes: 2,176
Temas: 99
Registro en: Dec 2013
Reputación:
42
Esta bien pero para mi es al pedo crear otra 2 funciones de "fire_player" y "frost_player".. Usa la de las granadas queda mejor
Solo hay que cambiar algunas condiiciones e.e
Free agent - Vendo plugins, mods o apps del foro IPB (Invision community)
Contactarme vía Discord >>> AtselTV#8202
Mensajes: 3,020
Temas: 49
Registro en: Oct 2013
Reputación:
33
Se puede mejorar.
Estoy de viaje sino dejo code...
Ingeniero agrónomo y desarrollador de Software.
tutoriales-allied
buscas un zp?
"La imitación es la forma más sincera de admiración con la que puede pagar la mediocridad a la grandeza"
Merci Alliedmodders pour m'introduire dans la programmation.
Mensajes: 1,240
Temas: 96
Registro en: Oct 2013
Reputación:
10
02/05/2014, 08:02 AM
(Última modificación: 02/05/2014, 08:52 AM por ivan.)
(01/05/2014, 09:31 PM)CSAxel escribió: Esta bien pero para mi es al pedo crear otra 2 funciones de "fire_player" y "frost_player".. Usa la de las granadas queda mejor
Solo hay que cambiar algunas condiiciones e.e
xd ami me ase facil asi como lo deje (._.)
(01/05/2014, 09:23 PM)UnrealT escribió: Los comentarios hazlo fuera de las etiquetas asi queda mejor.
LA prox Guia o tuto q ago lo ago como me desis ok.
(01/05/2014, 11:09 PM)roccoxx escribió: Se puede mejorar.
Estoy de viaje sino dejo code...
roccoxx me ayudas en algo no creo q sea doble post
bue el prolema es este cuando yo lo pongo las 2 awp en
seme mesclan la awp osea disparo y aprede fuego y hielo eso es bugs creo sem e mesclan los effecto uso el menu viejo delas armas
// Weapons bought
g_canbuy[id] = false
switch (selection)
{
case 18: g_awpfrost[id] = true
case 19: g_awpfire[id] = true
}
Mensajes: 2,176
Temas: 99
Registro en: Dec 2013
Reputación:
42
02/05/2014, 11:32 AM
(Última modificación: 02/05/2014, 11:36 AM por CSAxel.)
Cuando el player se conecta, setealos en false a las 2 variables
Y tambirn si tenes en true la variable del awp de hielo, que la de fuego que este en false y viceversa
EDIT: Tipo
Código PHP: public client_putinserver(id) { g_awpfire[id] = false g_awpfrost[id] = false }
if (g_awpfire[id]) g_awpfrost[id] = false else if (g_awpfrost[id]) g_awpfire[id] = false
Creo que ahi esta bien.. Vos proba
Free agent - Vendo plugins, mods o apps del foro IPB (Invision community)
Contactarme vía Discord >>> AtselTV#8202
Mensajes: 843
Temas: 13
Registro en: Nov 2013
Reputación:
11
02/05/2014, 12:10 PM
(Última modificación: 02/05/2014, 12:11 PM por UnrealT.)
Yo te diria que podrias hacer algo asi
Código PHP: switch (g_awp[attacker]) { case 1: Congelar(victim) case 2: Quemar(victim) }
Y para darle la AWP que congela pon
o la que quema
y para removerla
Mensajes: 2,105
Temas: 196
Registro en: Mar 2014
Reputación:
13
Mensajes: 2,600
Temas: 33
Registro en: Oct 2013
Reputación:
36
habiendo g_currentweapon utilizas get_user_weapon?
(17/04/2015, 03:36 PM)Neeeeeeeeeel.- escribió: No se va a volver a conectar a internet en toda su puta vida... nadie sube porno a mi foro y vive para contarlo.
Mensajes: 3,020
Temas: 49
Registro en: Oct 2013
Reputación:
33
(02/05/2014, 04:47 PM)RauliTop escribió: habiendo g_currentweapon utilizas get_user_weapon?
en 4.2 no viene por eso lo puso.
ademas puso g_level no se para que,
en todo caso deberia ir g_level primero y despues llamar a la native get_user_weapon
yo usaria un enum para asignarle la awp.
Ingeniero agrónomo y desarrollador de Software.
tutoriales-allied
buscas un zp?
"La imitación es la forma más sincera de admiración con la que puede pagar la mediocridad a la grandeza"
Merci Alliedmodders pour m'introduire dans la programmation.
Mensajes: 2,600
Temas: 33
Registro en: Oct 2013
Reputación:
36
ah vale, creí haber leído que lo probó en 4.3
(17/04/2015, 03:36 PM)Neeeeeeeeeel.- escribió: No se va a volver a conectar a internet en toda su puta vida... nadie sube porno a mi foro y vive para contarlo.
Mensajes: 1,240
Temas: 96
Registro en: Oct 2013
Reputación:
10
03/05/2014, 03:23 PM
(Última modificación: 03/05/2014, 03:32 PM por ivan.)
(02/05/2014, 12:20 PM)K.- escribió: como dijo unrealT pon los comentarios afuera de las etiquetas
Saludos
sobre el tutorial creo que esta bueno , si podrias hacerlo para Cs normal osea normal xD sin el ZP xD
Osea para el hns O.o
(02/05/2014, 12:10 PM)UnrealT escribió: Yo te diria que podrias hacer algo asi
Código PHP: switch (g_awp[attacker]) { case 1: Congelar(victim) case 2: Quemar(victim) }
Y para darle la AWP que congela pon
o la que quema
y para removerla
se pero seme ase mejor ami manera :3
(02/05/2014, 05:19 PM)roccoxx escribió: (02/05/2014, 04:47 PM)RauliTop escribió: habiendo g_currentweapon utilizas get_user_weapon?
en 4.2 no viene por eso lo puso.
ademas puso g_level no se para que,
en todo caso deberia ir g_level primero y despues llamar a la native get_user_weapon
yo usaria un enum para asignarle la awp.
xd no uso las demas por q me gusta mi manera . pero grax igual
Mensajes: 6,664
Temas: 81
Registro en: Jan 2014
Reputación:
68
y como podria hacer para que no todas las balas congelen ejemplo que congelen 1 o 2 balas random?
► NO DOY AYUDA VIA MENSAJE PRIVADO ◄
* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Mensajes: 276
Temas: 5
Registro en: Oct 2013
Reputación:
6
18/05/2014, 02:09 PM
(Última modificación: 18/05/2014, 02:09 PM por LNATIC.)
(07/05/2014, 11:52 AM)kikizon2 escribió: y como podria hacer para que no todas las balas congelen ejemplo que congelen 1 o 2 balas random?
Código PHP: switch (random_num(0,1)) { case 0:{ Congelar(victim) g_awp[id] = 1 } case 1:{ Quemar(victim) g_awp[id] = 2 } }
Mensajes: 76
Temas: 24
Registro en: Jan 2015
Reputación:
0
Error: Invalid statement; not in switch on line 7193
Warning: Expression has no effect on line 7193
Error: Expected token: ";", but found ":" on line 7193
Error: Invalid expression, assumed zero on line 7193
case CSW_AWP:
Mensajes: 37
Temas: 9
Registro en: Jul 2015
Reputación:
0
(03/02/2015, 04:28 AM)Ch3p escribió: Error: Invalid statement; not in switch on line 7193
Warning: Expression has no effect on line 7193
Error: Expected token: ";", but found ":" on line 7193
Error: Invalid expression, assumed zero on line 7193
case CSW_AWP:
Yo lo reemplaze por esto :p
Código PHP: if(CSW_AWP) { if (g_awpfire[id]) { set_pev(id, pev_weaponmodel2, model_awp_fire) } else if (g_awpfrost[id]) { set_pev(id, pev_weaponmodel2, model_awp_frost) } }
Pero me dejo un warning :c
Tan malo no soy
Mensajes: 17
Temas: 2
Registro en: Apr 2020
ayuuda como la ago para un menu normal soy nuevo en esto
Mensajes: 1,240
Temas: 96
Registro en: Oct 2013
Reputación:
10
26/04/2020, 04:39 PM
(Última modificación: 26/04/2020, 04:41 PM por ivan. Edited 3 times in total.)
(26/04/2020, 03:23 PM)sNk escribió: ayuuda como la ago para un menu normal soy nuevo en esto
Hola, estan un poco mal codeado lo que hice por que recien empezaba xd, pronto lo actualizare asi lo podras usar sin ningun bug;
Código PHP: switch (item) { case 0: { g_awpfrost[id] = true g_awpfire[id] = false } case 1: { g_awpfire[id] = true g_awpfrost[id] = false } }
eso agregas en el handle de tu menu; si tenes los menus viejos en la parte del switch lo cambias por key; y es el otro le pones item(O DEPENDE DE COMO LO HAYAS PUESTO xd)....
Mensajes: 17
Temas: 2
Registro en: Apr 2020
amigo kuando compilo me tira estos errrores
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team
C:\Users\Franco\ServidorDedicado\test.sma(141) : warning 203: symbol is never used: "fire_player"
C:\Users\Franco\ServidorDedicado\test.sma(141) : warning 203: symbol is never used: "frost_man"
Header size: 260 bytes
Code size: 836 bytes
Data size: 748 bytes
Stack/heap size: 16384 bytes; estimated max. usage=42 cells (168 bytes)
Total requirements: 18228 bytes
2 Warnings.
Done.
[Finished in 0.2s]
mi codigo q hize es esto soy nuevo por eso pido ayuda
Código PHP: #include <amxmodx>
new bool: g_awpfrost[33] // variable de la awp Frost new bool: g_awpfire[33] // variale de la awp Fuego
public plugin_init() { register_plugin("Menu Basico", "1.0", "[Anti]"); register_clcmd( "say /menu", "cmdMenu" ); } public cmdMenu(id) { new gMenu = menu_create("\r[HNS] \wArmas especiales", "handlerMenu")
menu_additem(gMenu, "\wAwp congeladora", "1") menu_additem(gMenu, "\dAwp fuego", "2") menu_additem(gMenu, "\yOpcion #3", "3")
menu_display(id, gMenu, 0) } public handlerMenu(id, menu, item) { if ( item == MENU_EXIT ) { menu_destroy(menu) return PLUGIN_HANDLED; } switch(item) { case 0: { g_awpfrost[id] = true g_awpfire[id] = false } case 1: { g_awpfire[id] = true g_awpfrost[id] = false } } return PLUGIN_HANDLED; } frost_man(victim) { // Get origin static Float:originF[3] pev(victim, pev_origin, originF) // Frost nade explode sound engfunc(EngFunc_EmitSound, victim, CHAN_WEAPON, grenade_frost[random_num(0, sizeof grenade_frost - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) // Only effect alive unfrozen zombies if (!is_user_alive(victim) || !g_zombie[victim] || g_frozen[victim] || g_nodamage[victim]) return; // Freeze icon? if (get_pcvar_num(cvar_hudicons)) { message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim) write_byte(0) // damage save write_byte(0) // damage take write_long(DMG_DROWN) // damage type - DMG_FREEZE write_coord(0) // x write_coord(0) // y write_coord(0) // z message_end() } // Light blue glow while frozen #if defined HANDLE_MODELS_ON_SEPARATE_ENT fm_set_rendering(g_ent_playermodel[victim], kRenderFxGlowShell, 0, 150, 250, kRenderNormal, 1) #else fm_set_rendering(victim, kRenderFxGlowShell, 0, 150, 250, kRenderNormal, 1) #endif // Freeze sound engfunc(EngFunc_EmitSound, victim, CHAN_BODY, grenade_frost_player[random_num(0, sizeof grenade_frost_player - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) // Get freeze duration setting static Float:freezeduration freezeduration = get_pcvar_float(cvar_freezeduration) // Add a blue tint to their screen message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, victim) write_short(UNIT_SECOND*1) // duration write_short(floatround(UNIT_SECOND*freezeduration)) // hold time write_short(FFADE_IN) // fade type write_byte(0) // red write_byte(50) // green write_byte(200) // blue write_byte(100) // alpha message_end() // Prevent from jumping if (pev(victim, pev_flags) & FL_ONGROUND) set_pev(victim, pev_gravity, 999999.9) // set really high else set_pev(victim, pev_gravity, 0.000001) // no gravity // Set a task to remove the freeze g_frozen[victim] = true; set_task(freezeduration/2, "remove_freeze", victim) }
// y el otro para el effecto de fuego
fire_player(victim) { // Get origin static Float:originF[3] pev(victim, pev_origin, originF) // Fire nade explode sound engfunc(EngFunc_EmitSound, victim, CHAN_WEAPON, grenade_fire_player[random_num(0, sizeof grenade_fire_player - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) // Only effect alive zombies if (!is_user_alive(victim) || !g_zombie[victim] || g_nodamage[victim]) return; // Heat icon? if (get_pcvar_num(cvar_hudicons)) { message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim) write_byte(0) // damage save write_byte(0) // damage take write_long(DMG_BURN) // damage type write_coord(0) // x write_coord(0) // y write_coord(0) // z message_end() } // Our task params static params[1] if (g_nemesis[victim]) // fire duration (nemesis takes less) params[0] = get_pcvar_num(cvar_fireduration) else params[0] = get_pcvar_num(cvar_fireduration)*5 // Set burning task on victim set_task(0.1, "burning_flame", victim+TASK_BLOOD, params, sizeof params) }
Mensajes: 811
Temas: 99
Registro en: Jun 2019
Reputación:
8
(26/04/2020, 06:05 PM)sNk escribió: amigo kuando compilo me tira estos errrores
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team
C:\Users\Franco\ServidorDedicado\test.sma(141) : warning 203: symbol is never used: "fire_player"
C:\Users\Franco\ServidorDedicado\test.sma(141) : warning 203: symbol is never used: "frost_man"
Header size: 260 bytes
Code size: 836 bytes
Data size: 748 bytes
Stack/heap size: 16384 bytes; estimated max. usage=42 cells (168 bytes)
Total requirements: 18228 bytes
2 Warnings.
Done.
[Finished in 0.2s]
mi codigo q hize es esto soy nuevo por eso pido ayuda
Código PHP: #include <amxmodx>
new bool: g_awpfrost[33] // variable de la awp Frost new bool: g_awpfire[33] // variale de la awp Fuego
public plugin_init() { register_plugin("Menu Basico", "1.0", "[Anti]"); register_clcmd( "say /menu", "cmdMenu" ); } public cmdMenu(id) { new gMenu = menu_create("\r[HNS] \wArmas especiales", "handlerMenu")
menu_additem(gMenu, "\wAwp congeladora", "1") menu_additem(gMenu, "\dAwp fuego", "2") menu_additem(gMenu, "\yOpcion #3", "3")
menu_display(id, gMenu, 0) } public handlerMenu(id, menu, item) { if ( item == MENU_EXIT ) { menu_destroy(menu) return PLUGIN_HANDLED; } switch(item) { case 0: { g_awpfrost[id] = true g_awpfire[id] = false } case 1: { g_awpfire[id] = true g_awpfrost[id] = false } } return PLUGIN_HANDLED; } frost_man(victim) { // Get origin static Float:originF[3] pev(victim, pev_origin, originF) // Frost nade explode sound engfunc(EngFunc_EmitSound, victim, CHAN_WEAPON, grenade_frost[random_num(0, sizeof grenade_frost - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) // Only effect alive unfrozen zombies if (!is_user_alive(victim) || !g_zombie[victim] || g_frozen[victim] || g_nodamage[victim]) return; // Freeze icon? if (get_pcvar_num(cvar_hudicons)) { message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim) write_byte(0) // damage save write_byte(0) // damage take write_long(DMG_DROWN) // damage type - DMG_FREEZE write_coord(0) // x write_coord(0) // y write_coord(0) // z message_end() } // Light blue glow while frozen #if defined HANDLE_MODELS_ON_SEPARATE_ENT fm_set_rendering(g_ent_playermodel[victim], kRenderFxGlowShell, 0, 150, 250, kRenderNormal, 1) #else fm_set_rendering(victim, kRenderFxGlowShell, 0, 150, 250, kRenderNormal, 1) #endif // Freeze sound engfunc(EngFunc_EmitSound, victim, CHAN_BODY, grenade_frost_player[random_num(0, sizeof grenade_frost_player - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) // Get freeze duration setting static Float:freezeduration freezeduration = get_pcvar_float(cvar_freezeduration) // Add a blue tint to their screen message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, victim) write_short(UNIT_SECOND*1) // duration write_short(floatround(UNIT_SECOND*freezeduration)) // hold time write_short(FFADE_IN) // fade type write_byte(0) // red write_byte(50) // green write_byte(200) // blue write_byte(100) // alpha message_end() // Prevent from jumping if (pev(victim, pev_flags) & FL_ONGROUND) set_pev(victim, pev_gravity, 999999.9) // set really high else set_pev(victim, pev_gravity, 0.000001) // no gravity // Set a task to remove the freeze g_frozen[victim] = true; set_task(freezeduration/2, "remove_freeze", victim) }
// y el otro para el effecto de fuego
fire_player(victim) { // Get origin static Float:originF[3] pev(victim, pev_origin, originF) // Fire nade explode sound engfunc(EngFunc_EmitSound, victim, CHAN_WEAPON, grenade_fire_player[random_num(0, sizeof grenade_fire_player - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) // Only effect alive zombies if (!is_user_alive(victim) || !g_zombie[victim] || g_nodamage[victim]) return; // Heat icon? if (get_pcvar_num(cvar_hudicons)) { message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim) write_byte(0) // damage save write_byte(0) // damage take write_long(DMG_BURN) // damage type write_coord(0) // x write_coord(0) // y write_coord(0) // z message_end() } // Our task params static params[1] if (g_nemesis[victim]) // fire duration (nemesis takes less) params[0] = get_pcvar_num(cvar_fireduration) else params[0] = get_pcvar_num(cvar_fireduration)*5 // Set burning task on victim set_task(0.1, "burning_flame", victim+TASK_BLOOD, params, sizeof params) }
No las estás usando.
I dream of someday being able to have your near.
Mensajes: 17
Temas: 2
Registro en: Apr 2020
Mensajes: 1,240
Temas: 96
Registro en: Oct 2013
Reputación:
10
(26/04/2020, 08:07 PM)sNk escribió: como amigo no entiendo
te falta registrar el frost y fire en fw takedamage; es decir no completaste la guia te salteaste un paso
Mensajes: 17
Temas: 2
Registro en: Apr 2020
un amigo me iso esto pero cuando alguien baja una escale se kiebra aparte ni lo congela solo le da un brillo ayuda amigo soy nuevo si supiera no estaria aka pidiendo ayuda
Código PHP: #include <amxmodx> #include <hamsandwich> #include <engine> #include <fakemeta> #include <fun>
new g_awpfrost[33]; new g_glassSpr, g_msgDamage, g_msgScreenFade;
public plugin_init() { register_plugin("Menu Basico", "1.0", "[Anti]"); RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage"); register_clcmd("say /menu", "cmdMenu");
g_msgDamage = get_user_msgid("Damage") g_msgScreenFade = get_user_msgid("ScreenFade") } public plugin_precache() { g_glassSpr = engfunc(EngFunc_PrecacheModel, "models/glassgibs.mdl") } public cmdMenu(id) { new gMenu = menu_create("\r[HNS] \wArmas especiales", "handlerMenu")
menu_additem(gMenu, "\wAwp congeladora", "1")
menu_display(id, gMenu, 0) } public handlerMenu(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } switch(item) { case 0: { g_awpfrost[id] = true give_item(id, "weapon_awp"); } } return PLUGIN_HANDLED; } public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { if(victim == attacker || !is_user_connected(attacker)) return HAM_IGNORED;
if(get_user_weapon(attacker) == CSW_AWP) { if(g_awpfrost[attacker]) { frost_man(victim) } } return HAM_SUPERCEDE; } frost_man(victim) { // Get origin new Float:originF[3] pev(victim, pev_origin, originF)
// Only effect alive unfrozen zombies if (!is_user_alive(victim)) return;
message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim) write_byte(0) // damage save write_byte(0) // damage take write_long(DMG_DROWN) // damage type - DMG_FREEZE write_coord(0) // x write_coord(0) // y write_coord(0) // z message_end()
set_rendering(victim, kRenderFxGlowShell, 0, 150, 250, kRenderNormal, 1)
new Float:freezeduration freezeduration = 2.0
// Add a blue tint to their screen message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, victim) write_short((1<<12)*1) // duration write_short(floatround((1<<12)*freezeduration)) // hold time write_short(0x0000) // fade type write_byte(0) // red write_byte(50) // green write_byte(200) // blue write_byte(100) // alpha message_end()
// Prevent from jumping if (pev(victim, pev_flags) & FL_ONGROUND) { set_pev(victim, pev_gravity, 999999.9) // set really high } else { set_pev(victim, pev_gravity, 0.000001) // no gravity } set_task(freezeduration/2, "remove_freeze", victim) } public remove_freeze(id) { if (!is_user_alive(id)) return;
set_rendering(id)
// Get player's origin new Float:origin2F[3] pev(id, pev_origin, origin2F)
// Glass shatter engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin2F, 0) write_byte(TE_BREAKMODEL) // TE id engfunc(EngFunc_WriteCoord, origin2F[0]) // x engfunc(EngFunc_WriteCoord, origin2F[1]) // y engfunc(EngFunc_WriteCoord, origin2F[2]+24.0) // z write_coord(16) // size x write_coord(16) // size y write_coord(16) // size z write_coord(random_num(-50, 50)) // velocity x write_coord(random_num(-50, 50)) // velocity y write_coord(25) // velocity z write_byte(10) // random velocity write_short(g_glassSpr) // model write_byte(10) // count write_byte(25) // life write_byte(0x01) // flags message_end() }
|