AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set vectors for entity (https://forums.alliedmods.net/showthread.php?t=326231)

cpt.nemo 07-23-2020 14:54

Set vectors for entity
 
Hello!
I can't get try vectors for my entity.

I created entity. How do I tilt the top of entity where I'm looking? At the same time, the bottom of the entity remains in place. After a second, the top of entity returns to its original position?!

Code:

new Float:Velocity[3];
VelocityByAim(id, 1500, Velocity);
for(new i=0;i<3;++i)Velocity[i]*=-1;              // odwrócenie zwrotów wektorów
entity_set_vector(Ent, EV_VEC_velocity ,Velocity);

///////////////////////////////////////////////////
/////////// odpowiedź na drugie pytanie: //////////
///////////////////////////////////////////////////

new Float:Velocity[3];
VelocityByAim(id, 1500, Velocity);
for(new i=1;i<3;++i)Velocity[i]*=-1;              // odwrócenie zwrotów wektorów płaszczyzny poziomej
Velocity[0]=0.0;                                  // wyzerowanie wektora wysokości
entity_set_vector(Ent, EV_VEC_velocity ,Velocity);

It's not working ((

https://img-host.ru/MUM9.png

Shadows Adi 07-23-2020 17:41

Re: Set vectors for entity
 
Code:
    static Float:fVec[3];     pev(ent, pev_origin, fVec);  // Gets pev from the origin of the vector     fVec[2] = fVec[2] - 24.00; // Sets the new origin for the vector, float value     set_pev(ent, pev_origin, fVec); // Sets the pev for the new origin of the entity     // ****** UNTESTED THIS PART: ******* //     fVec[2] = fVec[1]; // Sets the vector to its initial pos     set_pev(ent, pev_origin, fVec); // Sets pev for the vector's entity

Also, see this post:
https://forums.alliedmods.net/showpo...0&postcount=30

cpt.nemo 07-24-2020 03:04

Re: Set vectors for entity
 
Quote:

Originally Posted by Shadows Adi (Post 2711345)
Code:
    static Float:fVec[3];     pev(ent, pev_origin, fVec);  // Gets pev from the origin of the vector     fVec[2] = fVec[2] - 24.00; // Sets the new origin for the vector, float value     set_pev(ent, pev_origin, fVec); // Sets the pev for the new origin of the entity     // ****** UNTESTED THIS PART: ******* //     fVec[2] = fVec[1]; // Sets the vector to its initial pos     set_pev(ent, pev_origin, fVec); // Sets pev for the vector's entity

Also, see this post:
https://forums.alliedmods.net/showpo...0&postcount=30

then entity will be teleported using this method.
I need a smooth deviation.

I checked your code. My entity fell down.

cpt.nemo 07-24-2020 03:39

Re: Set vectors for entity
 
Code:

        static Float:fVec[3];
        new Float: fAim[3];
        velocity_by_aim(iAttacker, 64, fAim)
       
        fVec[2] = fAim[2] + 10.0;

       
        set_entvar(iEntity, var_angles, fVec

);

my entity is acting strangely.
he leans to the left, then to the right, then back again
I can make the object fit into its original coordinates.But the problem is that it tilts only horizontally, on two sides to the left and to the right, how do I make it tilt away from me?

Shadows Adi 07-24-2020 04:02

Re: Set vectors for entity
 
Also, these threads maybe could help you:

https://forums.alliedmods.net/showthread.php?t=214271
https://forums.alliedmods.net/showthread.php?t=16085
https://forums.alliedmods.net/showthread.php?t=149006


All times are GMT -4. The time now is 13:55.

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