View Full Version : TeleportEntity Problem (Angle)
Hello
How can I force a player to look at a other player ?
I try this:
new Float:Pos1[3];
new Float:Pos2[3];
new Float:vec[3];
GetEntPropVector(client1, Prop_Send, "m_angRotation", Pos1);
GetEntPropVector(client2, Prop_Send, "m_angRotation", Pos2);
MakeVectorFromPoints(Pos1, Pos2, vec);
TeleportEntity(client1,NULL_VECTOR,vec,NULL_V ECTOR);
// here the client1 must look at client2
Impact123
02-18-2012, 15:13
Look here (http://forums.alliedmods.net/showthread.php?t=175658), use the search next time.
Yours sincerely
Impact
doesn't work for my request, I want to teleport both players and to 'face' each players to the other
"m_angRotation" is an angle vector not a position vector.
after making a vector between the players position you need to make a copy and negate it then turn them both into angle vectors.
"m_angRotation" is an angle vector not a position vector.
after making a vector between the players position you need to make a copy and negate it then turn them both into angle vectors.
Can you convert your thing into a script xD I don't understand ^^
you won't learn anything if i do all the work for you.
use "m_vecOrigin" instead of "m_angRotation" in your snippet.
use GetVectorAngles (http://docs.sourcemod.net/api/index.php?fastload=show&id=552&) and NegateVector (http://docs.sourcemod.net/api/index.php?fastload=show&id=557&) for what i said in my previous post.
vec will give you the vector from client1 to client2 but you need another one for client2 to client1 which is the same as negating vec, thats why you need a copy.
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.