Raised This Month: $ Target: $400
 0% 

Velocity and DLLFunc_Spawn, creating entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 10-01-2009 , 09:06   Velocity and DLLFunc_Spawn, creating entity
Reply With Quote #1

dllfunc( DLLFunc_Spawn, sprite_ent ) and setting Velocity cause a bug in server, the entity is thrown from player to aim direction and when I don't use dllfunc( DLLFunc_Spawn, sprite_ent ) , it throws normally as it must.
So why it is buggy with setting Velocity?
It something like it goes only 1/4 of his direction and just stops...


PHP Code:
public Set_Sprite_Player(id, const sprite[])
{
    new 
sprite_ent create_entity("env_sprite")

    
entity_set_stringsprite_entEV_SZ_classname"FireShit")
    
entity_set_modelsprite_entsprite);

    
entity_set_edictsprite_entEV_ENT_ownerid)

    
entity_set_intsprite_entEV_INT_movetypeMOVETYPE_FLY)
    
set_pevsprite_entpev_solidSOLID_BBOX)

    
set_pevsprite_entpev_minsFloat:{-1.0,-1.0,-1.0})
    
set_pevsprite_entpev_maxsFloat:{1.0,1.0,1.0})

    
set_pevsprite_entpev_rendermodekRenderTransAdd )
    
set_pevsprite_entpev_renderamt200.0 )
    
    
set_pevsprite_entpev_framerate22.0 )
    
set_pevsprite_entpev_scale1.0 )

    
dllfuncDLLFunc_Spawnsprite_ent )
    
set_pevsprite_entpev_spawnflagsSF_SPRITE_STARTON )

    new 
Float:fAim[3],Float:fAngles[3],Float:fOrigin[3]
    
velocity_by_aim(id,64,fAim)
    
vector_to_angle(fAim,fAngles)
    
pev(id,pev_origin,fOrigin)
    
    
fOrigin[0] += fAim[0]
    
fOrigin[1] += fAim[1]
    
fOrigin[2] += fAim[2]
    
    
set_pevsprite_ent,pev_origin,fOrigin)
    
set_pevsprite_ent,pev_angles,fAngles)
    
    new 
Float:fVel[3]
    
velocity_by_aim(id1000,fVel)    
    
set_pevsprite_ent,pev_velocity,fVel)


__________________
xbatista is offline
Send a message via Skype™ to xbatista
 



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:41.


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