Raised This Month: $ Target: $400
 0% 

[Consulta] Como puedo hacer que salga el sprite hotflarex como laser ?


  
 
 
Thread Tools Display Modes
Author Message
StorM20
BANNED
Join Date: Dec 2011
Location: de_inferno en Julieta
Old 09-19-2012 , 14:06   [Consulta] Como puedo hacer que salga el sprite hotflarex como laser ?
#1

hola, bueno llevo 2 Dias editando una AWP Laser de xLeoNNN...

Tengo 2 Consultas:

1) Me pueden dar alguna guia o ayuda, para que sirve cada write_byte, en cada TE_
2) He intentado de + de 5 Formas para Multiplicar o Sumar daño para que Haga mucho mas...


Aqui los TE_ que quisiera saber que sirve cada write_byte
Code:
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)             write_byte (1)                 write_short(id | 0x1000)             write_coord (laser2[0])             write_coord (laser2[1])             write_coord (laser2[2])             write_short( sprite_beam )             write_byte(1)             write_byte(5)             write_byte(1)             write_byte(80)             write_byte(20)             write_byte(0)                 write_byte(52)                   write_byte(92)      //r             write_byte(173)    //g             write_byte(20)     //b             message_end()                         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)             write_byte(TE_DLIGHT)             write_coord(laser1[0])             write_coord(laser1[1])             write_coord(laser1[2])             write_byte(13)             write_byte(254)             write_byte(0)             write_byte(0)             write_byte(100)             write_byte(10)             message_end()                             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)             write_byte(TE_SPRITETRAIL)             write_coord(laser1[0])             write_coord(laser1[1])             write_coord(laser1[2])             write_coord(laser2[0])             write_coord(laser2[1])             write_coord(laser2[2])             write_short(hotflarex)             write_byte(80)             write_byte(1)             write_byte(3)             write_byte(34)             write_byte(43)             message_end()

Aqui el Daño:
El daño no me lo multiplica de ninguna forma... :Z
Lo tengo asi
PHP Code:
#include <HamSandWich> 
PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /pruebalaser""ComprarAWP")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_bits)
{
    if (
g_lasergun[attacker] && g_currentweapon[attacker] == CSW_AWP)
    {    
        static 
Float:originF[3]
        
pev(victimpev_originoriginF)
        
        new 
plrWeapIdplrClipplrAmmo
        plrWeapId 
get_user_weapon(attackerplrClipplrAmmo)
        if (
plrWeapId == CSW_AWP)
            
SetHamParamFloat(4damage 9)
        
        
client_print(attackerprint_center"Zombie Electrocutado!")
        if(
get_pcvar_num(cvar_particles_dead))
            
dead_efect(originF)
    }
    return 
PLUGIN_HANDLED
}

dead_efect(const Float:originF[3])
{    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
write_byte(TE_PARTICLEBURST
engfunc(EngFunc_WriteCoordoriginF[0])
engfunc(EngFunc_WriteCoordoriginF[1]) 
engfunc(EngFunc_WriteCoordoriginF[2]+10
write_short(250
write_byte(70
write_byte(55
message_end()

engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
write_byte(TE_PARTICLEBURST
engfunc(EngFunc_WriteCoordoriginF[0])
engfunc(EngFunc_WriteCoordoriginF[1]) 
engfunc(EngFunc_WriteCoordoriginF[2]+10)
write_short(250
write_byte(70
write_byte(55
message_end()

engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
write_byte(TE_PARTICLEBURST)
engfunc(EngFunc_WriteCoordoriginF[0]) 
engfunc(EngFunc_WriteCoordoriginF[1]) 
engfunc(EngFunc_WriteCoordoriginF[2]+10)
write_short(250)
write_byte(83
write_byte(55)
message_end()

engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
write_byte(TE_IMPLOSION)
engfunc(EngFunc_WriteCoordoriginF[0]) 
engfunc(EngFunc_WriteCoordoriginF[1]) 
engfunc(EngFunc_WriteCoordoriginF[2]+10
write_byte(random_num(100300))
write_byte(20
write_byte(3
message_end()

Me han dicho que es quizas por tener mal los Parametros o algo asi :Z, porfavor si me pueden dar la Forma BUENA de como multiplicar el daño...

Gracias

Last edited by StorM20; 09-19-2012 at 14:10.
StorM20 is offline
Send a message via MSN to StorM20
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 09-19-2012 , 15:30   Re: [Consulta] Como puedo hacer que salga el sprite hotflarex como laser ?
#2

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_bits) {
    
    if (
g_lasergun[attacker] && g_currentweapon[attacker] == CSW_AWP)
    {    
        
SetHamParamFloat(4damage 9.0)
        
        
client_print(attackerprint_center"Zombie Electrocutado!")
        
        if(
get_pcvar_num(cvar_particles_dead)) {
            
            static 
Float:originF[3]
            
            
pev(victimpev_originoriginF)
            
            
dead_efect(originF)
        }
    }
    
    return 
HAM_IGNORED
    

como te darás cuenta.. en hamsandwich se utiliza return HAM_** usa correctamente los returns
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
StorM20
BANNED
Join Date: Dec 2011
Location: de_inferno en Julieta
Old 09-19-2012 , 17:51   Re: [Consulta] Como puedo hacer que salga el sprite hotflarex como laser ?
#3

no me resulta :S
Lo cambie a eso que me diste de

PHP Code:
return HAM_IGNORED 
pero no me lo multiplica :c
StorM20 is offline
Send a message via MSN to StorM20
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 09-19-2012 , 18:19   Re: [Consulta] Como puedo hacer que salga el sprite hotflarex como laser ?
#4

Quote:
Originally Posted by StorM20 View Post
no me resulta :S
Lo cambie a eso que me diste de

PHP Code:
return HAM_IGNORED 
pero no me lo multiplica :c
algo mal tenes.. si pones las cosas incompletas.... pone todo el forward takedamage
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
StorM20
BANNED
Join Date: Dec 2011
Location: de_inferno en Julieta
Old 09-19-2012 , 19:32   Re: [Consulta] Como puedo hacer que salga el sprite hotflarex como laser ?
#5

Ok, filo lo publicare todo si igual es facil hacerlo c:

PHP Code:
// **********************************************************************************
// **********************************************************************************
// ***                                                                            ***
// ***            AWP LASER GUN                                                   ***
// ***                Codigos de xLeoNNN                                          ***
// ***                                                                            ***
// ***                    EDIT:  By StorM 2.0                                     ***
// ***                                                                            ***    
// **********************************************************************************
// **********************************************************************************

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <HamSandWich>
#include <engine>
#include <fakemeta>

#define PLUGIN "AWP Laser"
#define VERSION "1.0"
#define AUTHOR "StorM 2.0"

new hotflarexsprite_beamthunder
new bool:g_lasergun[33]
new 
g_iMaxPlayers
const q_pPlayer 41
const Second = ( 1<<10 )
new 
g_currentweapon[33]
new 
cvar_particles_dead

new const LaserSound[] = "weapons/electro4.wav"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /pruebalaser""ComprarAWP")
    
register_event("CurWeapon""make_tracer""be""1=1""3>0")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_awp""fw_AWP_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
cvar_particles_dead register_cvar("zp_slg_particles""1")
}

public 
plugin_precache()
{
    
hotflarex precache_model("sprites/flare6.spr")
    
sprite_beam precache_model("sprites/laserbeam.spr")
    
thunder precache_model("sprites/zbeam1.spr")
    
precache_sound(LaserSound)
}
    
public 
event_round_start()
{
    for (new 
1<= g_iMaxPlayersi++)
    {
        if (!
is_user_connected(i))
            continue
        
        if (
g_lasergun[i])
        {
            
g_lasergun[i] = false
        
}
    }
}

public 
client_putinserver(id)
{
    
g_lasergun[id] = false
}

public 
client_disconnect(id)
{
    
g_lasergun[id] = false
}

public 
ComprarAWP(id)
{
    if ( !
is_user_alive(id) )
    {
        
client_print(id,print_chat"[AMXX] Para Comprar la AWP laser, Debes estar Vivo.")
        return 
PLUGIN_HANDLED
    
}
    
    
give_item(id"weapon_awp")
    
g_lasergun[id] = true
    
    
return PLUGIN_HANDLED
}

public 
make_tracer(id)
{
    if(
g_lasergun[id])
    {
        new 
clip,ammo
        
new wpnid get_user_weapon(id,clip,ammo)
        new 
pteam[16]
            
        
get_user_team(idpteam15)
            
        if (
wpnid == CSW_AWP
        {
            new 
laser1[3], laser2[3]
            
get_user_origin(idlaser11)
            
get_user_origin(idlaser24)
                
            
message_beginMSG_BROADCAST,SVC_TEMPENTITY)
            
write_byte (1)    
            
write_short(id 0x1000
            
write_coord (laser2[0]) 
            
write_coord (laser2[1])
            
write_coord (laser2[2])
            
write_shortsprite_beam )
            
write_byte(1
            
write_byte(5
            
write_byte(1
            
write_byte(80
            
write_byte(20
            
write_byte(0)    
            
write_byte(52)       
            
write_byte(92)      //r
            
write_byte(173)    //g
            
write_byte(20)     //b
            
message_end() 
            
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_DLIGHT
            
write_coord(laser1[0]) 
            
write_coord(laser1[1]) 
            
write_coord(laser1[2]) 
            
write_byte(13
            
write_byte(254)
            
write_byte(0)
            
write_byte(0
            
write_byte(100)
            
write_byte(10)
            
message_end()
                
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_SPRITETRAIL)
            
write_coord(laser1[0]) 
            
write_coord(laser1[1]) 
            
write_coord(laser1[2]) 
            
write_coord(laser2[0]) 
            
write_coord(laser2[1]) 
            
write_coord(laser2[2]) 
            
write_short(hotflarex)
            
write_byte(80)
            
write_byte(1
            
write_byte(3
            
write_byte(34)
            
write_byte(43)
            
message_end()
            
emit_sound(idCHAN_AUTOLaserSoundVOL_NORMATTN_NORM 0PITCH_NORM)
                
        }
    }
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_bits) { 
     
    if (
g_lasergun[attacker] && g_currentweapon[attacker] == CSW_AWP
    {     
        
SetHamParamFloat(4damage 3.0
         
        
client_print(attackerprint_center"Zombie Electrocutado!"
         
        if(
get_pcvar_num(cvar_particles_dead)) { 
             
            static 
Float:originF[3
             
            
pev(victimpev_originoriginF
             
            
dead_efect(originF
        } 
    } 
     
    return 
HAM_IGNORED 
     
}

dead_efect(const Float:originF[3])
{    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
write_byte(TE_PARTICLEBURST
engfunc(EngFunc_WriteCoordoriginF[0])
engfunc(EngFunc_WriteCoordoriginF[1]) 
engfunc(EngFunc_WriteCoordoriginF[2]+10
write_short(250
write_byte(70
write_byte(55
message_end()

engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
write_byte(TE_PARTICLEBURST
engfunc(EngFunc_WriteCoordoriginF[0])
engfunc(EngFunc_WriteCoordoriginF[1]) 
engfunc(EngFunc_WriteCoordoriginF[2]+10)
write_short(250
write_byte(70
write_byte(55
message_end()

engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)            
write_byte(TE_PARTICLEBURST)
engfunc(EngFunc_WriteCoordoriginF[0]) 
engfunc(EngFunc_WriteCoordoriginF[1]) 
engfunc(EngFunc_WriteCoordoriginF[2]+10)
write_short(250)
write_byte(83
write_byte(55)
message_end()

engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
write_byte(TE_IMPLOSION)
engfunc(EngFunc_WriteCoordoriginF[0]) 
engfunc(EngFunc_WriteCoordoriginF[1]) 
engfunc(EngFunc_WriteCoordoriginF[2]+10
write_byte(random_num(100300))
write_byte(20
write_byte(3
message_end()
}

public 
fw_AWP_PrimaryAttack_Post(awp)
{
    static 
id
    id 
get_pdata_cbase(awpq_pPlayer4)
    
    if(
is_user_connected(id) && g_lasergun[id])
    {    
        new 
iEndOrigin[3]
        
get_user_origin(idiEndOrigin3)
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
        
write_byte(TE_EXPLOSION)    
        
write_coord(iEndOrigin[0]) 
        
write_coord(iEndOrigin[1]) 
        
write_coord(iEndOrigin[2] +10
        
write_short(thunder)    
        
write_byte(90)        
        
write_byte(60)        
        
write_byte(TE_EXPLFLAG_NONE)    
        
message_end() 
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
        
write_byte(TE_EXPLOSION)    
        
write_coord(iEndOrigin[0]) 
        
write_coord(iEndOrigin[1]) 
        
write_coord(iEndOrigin[2]+20
        
write_short(thunder)    
        
write_byte(60)    
        
write_byte(20)        
        
write_byte(TE_EXPLFLAG_NONE)    
        
message_end() 
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
        
write_byte(TE_EXPLOSION)    
        
write_coord(iEndOrigin[0]) 
        
write_coord(iEndOrigin[1]) 
        
write_coord(iEndOrigin[2] +30
        
write_short(thunder)    
        
write_byte(60)        
        
write_byte(20)            
        
write_byte(TE_EXPLFLAG_NONE)    
        
message_end() 
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin
        
write_byte(TE_BEAMCYLINDER)
        
write_coord(iEndOrigin[0])
        
write_coord(iEndOrigin[1])
        
write_coord(iEndOrigin[2])
        
write_coord(iEndOrigin[0])
        
write_coord(iEndOrigin[1])
        
write_coord(iEndOrigin[2]+200)
        
write_short(hotflarex)
        
write_byte(0)
        
write_byte(1)
        
write_byte(6)
        
write_byte(8)
        
write_byte(1)
        
write_byte(255)
        
write_byte(255)
        
write_byte(192)
        
write_byte(128)
        
write_byte(5)
        
message_end()
        
        
// TE_IMPLOSION: partículas que se reunen en un punto determinado
        
message_begin(MSG_BROADCASTSVC_TEMPENTITYiEndOrigin)
        
write_byte(TE_IMPLOSION// TE id
        
write_coord(iEndOrigin[0]) // x
        
write_coord(iEndOrigin[1]) // y
        
write_coord(iEndOrigin[2]) // z
        
write_byte(130// radius
        
write_byte(180// count
        
write_byte(12// duration
        
message_end()
    }
}

public 
fw_PlayerSpawn_Post(id)
{
    if(
g_lasergun[id])
    {
        
g_lasergun[id] = false
        ham_strip_weapon
(id"weapon_awp")
    }
}

stock ham_strip_weapon(idweapon[])
{
    if(!
equal(weapon,"weapon_",7)) 
    return 
0
    
    
new idd get_weaponid(weapon)
    
    if(!
idd) return 0
    
    
new wEnt
    
    
while((wEnt find_ent_by_class(wEntweapon)) && entity_get_edict(wEntEV_ENT_owner) != id) {}
    
    if(!
wEnt) return 0
    
    
if(get_user_weapon(id) == idd
        
ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
    
    if(!
ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) 
        return 
0
    
    ExecuteHamB
(Ham_Item_KillwEnt)
    
    
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) & ~(1<<idd))
    
    return 
1

Espero puedas ayudar a resolverlo y saber en que me equivoque para Aprender
Saludos!

Last edited by StorM20; 09-19-2012 at 19:36.
StorM20 is offline
Send a message via MSN to StorM20
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 09-19-2012 , 19:36   Re: [Consulta] Como puedo hacer que salga el sprite hotflarex como laser ?
#6

make_tracer eso esta mal..

nunca asignas valores a g_currentweapon... te recomiendo leer tutoriales antes de intentar hacer algo sin saber que haces
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
 



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 22:24.


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