AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Moving entity to Origin (https://forums.alliedmods.net/showthread.php?t=225456)

G[o]Q 09-04-2013 20:25

Moving entity to Origin
 
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)


All times are GMT -4. The time now is 19:07.

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