Raised This Month: $51 Target: $400
 12% 

Moving entity to Origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
G[o]Q
Member
Join Date: Jan 2010
Location: Poland (Malopolska)
Old 09-04-2013 , 20:25   Moving entity to Origin
Reply With Quote #1

Code:
public move_EntToOrigin(ent,Float: origin[3]){
    new Float:eOrigin[3];
    new Float:eVelocity[3];
    new Float:out[3];
    
    pev(ent,pev_origin,eOrigin);
    
    for(new i=0;i<3;i++)
        out[i]=(origin[i]-eOrigin[i]) ;
    xs_vec_mul_scalar(out,5.0,eVelocity);
    
    
    set_pev(ent,pev_velocity,eVelocity);
}
I wrote this code but this not work and i don't know why ?

For example I would Like to move my entity(f.ex. weaponbox) to the crosshair origins (entity moving not teleport and is stopping when reach crosshair origins)
G[o]Q 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 15:55.


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