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

Set vectors for entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cpt.nemo
Junior Member
Join Date: Jul 2020
Old 07-23-2020 , 14:54   Set vectors for entity
Reply With Quote #1

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 ((


Last edited by cpt.nemo; 07-23-2020 at 15:04.
cpt.nemo is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-23-2020 , 17:41   Re: Set vectors for entity
Reply With Quote #2

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
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 07-23-2020 at 17:41.
Shadows Adi is offline
cpt.nemo
Junior Member
Join Date: Jul 2020
Old 07-24-2020 , 03:04   Re: Set vectors for entity
Reply With Quote #3

Quote:
Originally Posted by Shadows Adi View Post
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.

Last edited by cpt.nemo; 07-24-2020 at 03:11.
cpt.nemo is offline
cpt.nemo
Junior Member
Join Date: Jul 2020
Old 07-24-2020 , 03:39   Re: Set vectors for entity
Reply With Quote #4

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?
cpt.nemo is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-24-2020 , 04:02   Re: Set vectors for entity
Reply With Quote #5

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
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi 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 00:50.


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