AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity Go Through Player (https://forums.alliedmods.net/showthread.php?t=233571)

m4m3ts 01-16-2014 22:27

Entity Go Through Player
 
i want to hit through multiple player with entity, it have beamfollow.
when i set the velocity 1000.0 its work great, the entity go through and correctly hit player.

but when i set velocity 9999.0
the entity can go through player but its not hit the player.
please help...

(i've set sv_maxvelocity 9999)

here is my code

i use

register_think("entity_class", "fw_Think")
register_touch("entity_class", "*", "fw_touch")

PHP Code:

public Throw_entity(id)
{
    static 
Float:StartOrigin[3], Float:TargetOrigin[3], Float:angles[3], Float:StartOriginX[3]
    
get_position(id2.00.00.0StartOrigin)

    
pev(id,pev_angles,angles)
    static 
EntEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    if(!
pev_valid(Ent)) return

    
set_pev(Entpev_movetypeMOVETYPE_FLY)
    
set_pev(Entpev_ownerid)
    
set_pev(Entpev_fuser1get_gametime() + 4.0)
    
set_pev(Entpev_nextthinkhalflife_time() + 0.1)

    
entity_set_string(EntEV_SZ_classname"entity_class")
    
engfunc(EngFunc_SetModelEntENTITY_MODEL)
    
set_pev(Entpev_minsFloat:{-1.0, -1.0, -1.0})
    
set_pev(Entpev_maxsFloat:{1.01.01.0})
    
set_pev(Entpev_originStartOrigin)
    
set_pev(Entpev_anglesangles)
    
set_pev(Entpev_gravity0.01)
    
set_pev(Entpev_solidSOLID_TRIGGER)
    
set_pev(Entpev_frame0.0)

    static 
Float:Velocity[3]
    
fm_get_aim_origin(idTargetOrigin)
    
get_speed_vector(StartOriginTargetOrigin9999.0Velocity)
    
set_pev(Entpev_velocityVelocity)

    
charge_start false

    message_begin
(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// Temporary entity ID
    
write_short(Ent// Entity
    
write_short(sTrail// Sprite index
    
write_byte(7// Life
    
write_byte(1// Line width
    
write_byte(255// Red
    
write_byte(80// Green
    
write_byte(80// Blue
    
write_byte(100// Alpha
    
message_end() 
}

public 
fw_Think(ent)
{
    if(!
pev_valid(ent)) 
    return

    static 
Float:fFramepev(entpev_framefFrame)

    
fFrame += 1.5
    fFrame 
floatmin(21.0fFrame)

    
set_pev(entpev_framefFrame)
    
set_pev(entpev_nextthinkget_gametime() + 0.05)

    
// time remove
    
static Float:fTimeRemoveFloat:Amount
    pev
(entpev_fuser1fTimeRemove)
    
pev(entpev_renderamtAmount)

    if(
get_gametime() >= fTimeRemove
    {
        
remove_entity(ent)
    }
}

public 
fw_touch(EntId)
{
    
// If ent is valid
    
if(!pev_valid(Ent))
    return
    static 
OwnerOwner pev(Entpev_owner)
    if(
pev(Entpev_movetype) == MOVETYPE_NONE)
    return

    static 
classnameptd[32]
    
pev(Idpev_classnameclassnameptd31)
    if (
equali(classnameptd"func_breakable")) ExecuteHamBHam_TakeDamageId00200.0DMG_GENERIC )

    new 
Float:originF[3]
    
pev(Entpev_originoriginF)

    if(
is_user_alive(Id))
    {
        
remove_entity(Ent)
        
make_blood(originF)
        
ExecuteHamB(Ham_TakeDamageIdEntAttacker65.0DMG_BULLET)
        
emit_sound(IdCHAN_VOICEhit_sound1.0ATTN_NORM0PITCH_NORM)
    }
    else
    {
        
make_bullet(OwneroriginF)
        
engfunc(EngFunc_EmitSoundEntCHAN_WEAPONhit_wall1.0ATTN_STATIC0PITCH_NORM)
        
fake_smokes(OwneroriginF)
        
set_pev(Entpev_movetypeMOVETYPE_NONE)
        
set_pev(Entpev_solidSOLID_NOT)
    }



meTaLiCroSS 01-18-2014 15:10

Re: Entity Go Through Player
 
If you want to do a bullet, use TraceLines, there exists many threads with this kind of things. Please search

m4m3ts 01-18-2014 18:05

Re: Entity Go Through Player
 
Quote:

Originally Posted by meTaLiCroSS (Post 2087779)
If you want to do a bullet, use TraceLines, there exists many threads with this kind of things. Please search

ok, thanks.

wickedd 01-18-2014 18:10

Re: Entity Go Through Player
 
Don't blank out your post.

m4m3ts 06-10-2014 12:06

Re: Entity Go Through Player
 
Quote:

Originally Posted by meTaLiCroSS (Post 2087779)
If you want to do a bullet, use TraceLines, there exists many threads with this kind of things. Please search

i dont want to do it with bullet.
in this case i use entity model, such us fire sprite or like an arrow model.
so i have set it in high velocity, but its not hit on player.
please help..


All times are GMT -4. The time now is 10:04.

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