Raised This Month: $ Target: $400
 0% 

[solved] velocity to a direction


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 05-13-2009 , 03:53   Re: velocity to a direction
Reply With Quote #1

PHP Code:
public throw_something(id)
{
 new 
FloatOrigin[3]
 
 
pev(idpev_origin Origin)
 
Origin[2] += 28
 
new Float:fVelocity[3]
 
 new 
iEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
 
 if(!
iEnt)
  return 
PLUGIN_HANDLED
 
 velocity_by_aim
(id1000fVelocity)
 
set_pev(iEntpev_velocityfVelocity)
 
set_pev(iEntpev_classname"iClassname")
 
 
engfunc(EngFunc_SetSizeiEntFloat:{-1.0, -7.0, -1.0}, Float:{1.07.01.0})
 
engfunc(EngFunc_SetModel,iEnt"iMdl.mdl")
 
 
set_pev(iEntpev_originOrigin)
 
set_pev(iEntpev_solidSOLID_TRIGGER)
 
set_pev(iEntpev_movetypeMOVETYPE_TOSS)
 
set_pev(iEntpev_ownerid)

is it something like that you are looking for?
__________________
Dr.G is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-13-2009 , 06:12   Re: velocity to a direction
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?p=88618

PHP Code:
        case UT_RIGHT:
        {
            new 
Float:force float(get_pcvar_num(baseforce))
            new 
Float:vector[3]
            
entity_get_vector(id,EV_VEC_angles,vector)
            
engfunc(EngFunc_MakeVectors,vector)
            new 
Float:v_right[3]
            
get_global_vector(GL_v_right,v_right)
            
entity_get_vector(id,EV_VEC_velocity,vector)        
            
vector[0] = v_right[0] * force
            vector
[1] = v_right[1] * force
            vector
[2] = 220.0 
            entity_set_vector
(id,EV_VEC_velocity,vector
            
domove[id] = UT_NONE
            
return PLUGIN_CONTINUE
        
}    
        case 
UT_LEFT:
        {
            new 
Float:force float(get_pcvar_num(baseforce)) * -1.0
            
new Float:vector[3]
            
entity_get_vector(id,EV_VEC_angles,vector)
            
engfunc(EngFunc_MakeVectors,vector)
            new 
Float:v_right[3]
            
get_global_vector(GL_v_right,v_right)
            
entity_get_vector(id,EV_VEC_velocity,vector)        
            
vector[0] = v_right[0] * force
            vector
[1] = v_right[1] * force
            vector
[2] = 220.0 
            entity_set_vector
(id,EV_VEC_velocity,vector
            
domove[id] = UT_NONE
            
return PLUGIN_CONTINUE
        

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-13-2009 , 10:38   Re: velocity to a direction
Reply With Quote #3

yep, I managed to do it just perfectly using that code connor, thanks
__________________
Hunter-Digital is offline
Reply



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 01:37.


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