Mensajes: 5
Temas: 1
Registro en: Jun 2017
Reputación:
0
15/06/2017, 02:09 PM
(Última modificación: 15/06/2017, 02:13 PM por xHann.)
Hola, quisiera saber como poder hacer una arma explosiva osea que al disparar al piso cause X Cantidad de daño al rededor de un radio.
con la deagle por ejemplo
Ejemplo Radio tal 400
Ejemplo Daño tal 450
saludos.
Mensajes: 684
Temas: 36
Registro en: Oct 2016
Reputación:
2
Sección equivocada chamaco perro.
Lea las reglas por amor a cristo: https://amxmodx-es.com/showthread.php?tid=3
Luego lea un tutorial si cree que es pan de jalea hacer eso.
Y luego cuando lo intente hacer lo postea acá para ayudarle con los bugs, de resto, puede ir a Pedido de Plugins y/o Compra, y formular este post nuevamente, quizá alguno le pueda ayudar mejor.
Java, Mysql, PHP, Python and more.
Mensajes: 3,238
Temas: 47
Registro en: Feb 2015
Reputación:
34
15/06/2017, 05:19 PM
(Última modificación: 15/06/2017, 05:21 PM por Skylar.)
(15/06/2017, 04:59 PM)Dieguito escribió: Sección equivocada chamaco perro.
Lea las reglas por amor a cristo: https://amxmodx-es.com/showthread.php?tid=3
Luego lea un tutorial si cree que es pan de jalea hacer eso.
Y luego cuando lo intente hacer lo postea acá para ayudarle con los bugs, de resto, puede ir a Pedido de Plugins y/o Compra, y formular este post nuevamente, quizá alguno le pueda ayudar mejor.
Está bien donde posteó, si lees el thr dice "quisiera saber como hacer" no, "quiero que me hagan"..
EDIT: Es buena idea, veré si lo hago y luego la aporto..
Mensajes: 684
Temas: 36
Registro en: Oct 2016
Reputación:
2
(15/06/2017, 05:19 PM)Skylar escribió: (15/06/2017, 04:59 PM)Dieguito escribió: Sección equivocada chamaco perro.
Lea las reglas por amor a cristo: https://amxmodx-es.com/showthread.php?tid=3
Luego lea un tutorial si cree que es pan de jalea hacer eso.
Y luego cuando lo intente hacer lo postea acá para ayudarle con los bugs, de resto, puede ir a Pedido de Plugins y/o Compra, y formular este post nuevamente, quizá alguno le pueda ayudar mejor.
Está bien donde posteó, si lees el thr dice "quisiera saber como hacer" no, "quiero que me hagan"..
EDIT: Es buena idea, veré si lo hago y luego la aporto..
Entre pedir y que te expliquen como hacer, hay una pequeña diferencia... que este tiene 1 mensaje recién .
Java, Mysql, PHP, Python and more.
Mensajes: 3,238
Temas: 47
Registro en: Feb 2015
Reputación:
34
(15/06/2017, 05:49 PM)Dieguito escribió: (15/06/2017, 05:19 PM)Skylar escribió: (15/06/2017, 04:59 PM)Dieguito escribió: Sección equivocada chamaco perro.
Lea las reglas por amor a cristo: https://amxmodx-es.com/showthread.php?tid=3
Luego lea un tutorial si cree que es pan de jalea hacer eso.
Y luego cuando lo intente hacer lo postea acá para ayudarle con los bugs, de resto, puede ir a Pedido de Plugins y/o Compra, y formular este post nuevamente, quizá alguno le pueda ayudar mejor.
Está bien donde posteó, si lees el thr dice "quisiera saber como hacer" no, "quiero que me hagan"..
EDIT: Es buena idea, veré si lo hago y luego la aporto..
Entre pedir y que te expliquen como hacer, hay una pequeña diferencia... que este tiene 1 mensaje recién .
Really?
Puede ser un usuario con conocimientos en pawn, pero tal vez no puede hacer este plugin, es un tanto difícil hacerlo.
Mensajes: 5
Temas: 1
Registro en: Jun 2017
Reputación:
0
17/06/2017, 02:53 AM
(Última modificación: 17/06/2017, 02:54 AM por xHann.)
Buenas probando y tal toqueteando y pensando buscando etc e podido conseguir esto
Código: /* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <fun>
#define PLUGIN ""
#define VERSION "1.0"
#define AUTHOR ""
new g_explode_sprite
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_deagle", "F_HAM_PRIMARYATTACK_DEAGLE", true );
}
public plugin_precache( )
{
g_explode_sprite = precache_model( "sprites/fire.spr" );
}
public F_HAM_PRIMARYATTACK_DEAGLE( weapon )
{
new index; index = get_pdata_cbase( weapon, 46, 4 );
if(cs_get_weapon_ammo( weapon ) <= 0 ) return;
F_CREATE_EXPLOSION( index, 1 );
client_cmd( index, "-attack" );
}
public F_CREATE_EXPLOSION( index, type )
{
new t_iOrigin[3], Float:t_fOrigin[3];get_user_origin( index, t_iOrigin, 3 );IVecFVec( t_iOrigin, t_fOrigin );
new t_entity = create_entity( "info_target" );
t_fOrigin[ 2 ] += 5.0
entity_set_vector( t_entity, EV_VEC_origin, t_fOrigin );
entity_set_size( t_entity, Float:{ -5.0, -5.0, -5.0 }, Float:{ 5.0, 5.0, 5.0 } );
entity_set_int( t_entity, EV_INT_solid, SOLID_TRIGGER );
entity_set_int( t_entity, EV_INT_movetype, MOVETYPE_FLY );
if ( type == 1 )
{
static Float:vel_a[3], Float:vel_n[3], i
VelocityByAim(index, -400, vel_n);
entity_get_vector(index, EV_VEC_velocity, vel_a);
for (i = 0; i < 3; i++)
vel_n[i] += vel_a[i];
entity_set_vector(index, EV_VEC_velocity, vel_n)
}
new iEnt = -1
while( iEnt = find_ent_in_sphere(iEnt, t_fOrigin, 100.0) )
{
if ( is_user_alive( iEnt ) )
{
if ( get_user_health( iEnt ) <= 0 )
{
user_silentkill( iEnt )
set_user_frags( iEnt, get_user_frags( iEnt ) + 1 );
set_user_frags( index, get_user_frags( index ) + 1 );
}else{
if ( iEnt != index ) set_user_health( iEnt, get_user_health( iEnt ) - 50 );
}
}
}
message_begin(MSG_PVS, SVC_TEMPENTITY, t_iOrigin, 0);
write_byte(TE_EXPLOSION);
write_coord(t_iOrigin[0]); // X
write_coord(t_iOrigin[1]); // Y
write_coord(t_iOrigin[2]); // Z
write_short(g_explode_sprite); // sprite
switch( type )
{
case 1: write_byte( 40 );
case 2: write_byte( 20 );
}
write_byte(10); // framerate
write_byte(0); // flags
message_end();
remove_entity( t_entity );
}
[
Pero esta linea me da error :
while( iEnt = find_ent_in_sphere(iEnt, t_fOrigin, 100.0) )
Warning: Possibly unintended assignment on line 59
y añadir las 2 cvar de Radio y Damage
Gracias por vuestra ayuda
Mensajes: 5
Temas: 1
Registro en: Jun 2017
Reputación:
0
Ayuda porfa no doy con el fallo
Mensajes: 449
Temas: 66
Registro en: Aug 2016
Reputación:
3
Código PHP: /* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <cstrike> #include <engine> #include <fun>
#define PLUGIN "" #define VERSION "1.0" #define AUTHOR "" new g_explode_sprite
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_deagle", "F_HAM_PRIMARYATTACK_DEAGLE", true ); }
public plugin_precache( ) { g_explode_sprite = precache_model( "sprites/fire.spr" ); }
public F_HAM_PRIMARYATTACK_DEAGLE( weapon ) { new index; index = get_pdata_cbase( weapon, 46, 4 ); if(cs_get_weapon_ammo( weapon ) <= 0 ) return; F_CREATE_EXPLOSION( index, 1 ); client_cmd( index, "-attack" ); }
public F_CREATE_EXPLOSION( index, type ) { new t_iOrigin[3], Float:t_fOrigin[3];get_user_origin( index, t_iOrigin, 3 );IVecFVec( t_iOrigin, t_fOrigin );
new t_entity = create_entity( "info_target" ); t_fOrigin[ 2 ] += 5.0 entity_set_vector( t_entity, EV_VEC_origin, t_fOrigin ); entity_set_size( t_entity, Float:{ -5.0, -5.0, -5.0 }, Float:{ 5.0, 5.0, 5.0 } ); entity_set_int( t_entity, EV_INT_solid, SOLID_TRIGGER ); entity_set_int( t_entity, EV_INT_movetype, MOVETYPE_FLY ); if ( type == 1 ) { static Float:vel_a[3], Float:vel_n[3], i VelocityByAim(index, -400, vel_n); entity_get_vector(index, EV_VEC_velocity, vel_a); for (i = 0; i < 3; i++) vel_n[i] += vel_a[i]; entity_set_vector(index, EV_VEC_velocity, vel_n) } new iEnt = -1 while( iEnt = find_ent_in_sphere(iEnt, t_fOrigin, 100.0) ) { if ( is_user_alive( iEnt ) ) { if ( get_user_health( iEnt ) <= 0 ) { user_silentkill( iEnt ) set_user_frags( iEnt, get_user_frags( iEnt ) + 1 ); set_user_frags( index, get_user_frags( index ) + 1 ); }else{ if ( iEnt != index ) set_user_health( iEnt, get_user_health( iEnt ) - 50 ); } } } message_begin(MSG_PVS, SVC_TEMPENTITY, t_iOrigin, 0); write_byte(TE_EXPLOSION); write_coord(t_iOrigin[0]); // X write_coord(t_iOrigin[1]); // Y write_coord(t_iOrigin[2]); // Z write_short(g_explode_sprite); // sprite switch( type ) { case 1: write_byte( 40 ); case 2: write_byte( 20 ); } write_byte(10); // framerate write_byte(0); // flags message_end();
remove_entity( t_entity ); }
Mensajes: 5
Temas: 1
Registro en: Jun 2017
Reputación:
0
18/06/2017, 04:37 PM
(Última modificación: 18/06/2017, 04:38 PM por xHann.)
Gracias Franco pero no funciona sigo testeando esta dificil xD
Warning: Possibly unintended assignment on line 59
Sigue dando warning yo diria que no funciona por eso xD
while( iEnt = find_ent_in_sphere(iEnt, t_fOrigin, 100.0) )
Mensajes: 1,902
Temas: 35
Registro en: Jan 2014
Reputación:
28
Código PHP: while( iEnt = find_ent_in_sphere(iEnt, t_fOrigin, 100.0) )
>>>>>>>>>>
Código PHP: while( (iEnt = find_ent_in_sphere(iEnt, t_fOrigin, 100.0)) )
Mensajes: 5
Temas: 1
Registro en: Jun 2017
Reputación:
0
Nada sigue sin funcionar no da ningun warning pero tampoco hace daño en area xD
Mensajes: 1,902
Temas: 35
Registro en: Jan 2014
Reputación:
28
18/06/2017, 07:24 PM
(Última modificación: 18/06/2017, 07:26 PM por Chamo..)
Solo vi lo referente a ese error, no revise el resto del codigo .
Sin embargo, aquí te dejo una forma sencilla y rápida de realizar daño, ya que no se que sentido tiene la forma anterior que crea una entidad.
Código PHP: // const DMG_EXPLOSION = (1<<24)
//..... static Float:AF_Origin[3];
//obtener coordenadas....
RadiusDamageToEnemies(AF_Origin, Radius, Inflictor, Attacker, Damage, (DMG_ALWASYGIB|DMG_EXPLOSION))
//...
RadiusDamageToEnemies(const Float:AF_Origin[3], const Float:F_Radius, const I_Inflictor, const I_Attacker, const Float:F_TotalDamage, const I_DamageBits) { new I_Victim = -1; while ((I_Victim = find_ent_in_sphere(I_Victim, AF_Origin, F_Radius))) { if (!is_user_alive(I_Victim)) continue;
ExecuteHamB(Ham_TakeDamage, I_Victim, I_Inflictor, I_Attacker, F_TotalDamage, I_DamageBits) } }
Trata de adaptarlo por ti mismo...
|