10 vector pos_player = player.GetPosition();
22 int hitComponentIndex;
23 DayZPhysics.
RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, NULL, NULL, ignore);
29 bool breakSync =
false;
70 bool breakSync =
false;
87 Object playerRoot = player;
100 if (playerRoot != player.GetTransportCache())
106 if (playerRoot == null)
120 if (
GetGame().IsMultiplayer() && breakSync)
136 if (position[1] <
GetGame().SurfaceGetSeaLevel())
143 playerRoot.SetPosition(position);
147 Param4<float, float, float, bool> params =
new Param4<float, float, float, bool>(position[0], position[1], position[2], breakSync);
148 player.RPCSingleParam(
ERPCs.DEV_RPC_TELEPORT, params,
true);
159 playerRoot.SetDirection(direction);
164 player.RPCSingleParam(
ERPCs.DEV_RPC_SET_PLAYER_DIRECTION, params,
true);
170 #ifdef DIAG_DEVELOPER
171 if ( rpc_type ==
ERPCs.DEV_RPC_TELEPORT )
175 else if ( rpc_type ==
ERPCs.DEV_RPC_SET_PLAYER_DIRECTION )
184 Param4<float, float, float, bool> p =
new Param4<float, float, float, bool>(0, 0, 0,
false);
proto native float SurfaceGetSeaLevel()
proto native vector GetCurrentCameraPosition()
proto native vector GetCurrentCameraDirection()
Super root of all classes in Enforce script.
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
static proto bool SphereCastBullet(vector begPos, vector endPos, float radius, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
static void LogWarning(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as warning message.
static bool IsFreeCameraEnabled()
static const float TELEPORT_DISTANCE_MAX_EX
static void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
static const float TELEPORT_DISTANCE_MAX
static void TeleportAtCursor()
static void TeleportAtCursorEx()
void OnRPCSetPlayerPosition(PlayerBase player, ParamsReadContext ctx)
static Object GetPlayerRootForTeleporting(PlayerBase player)
static void SetPlayerDirection(PlayerBase player, vector direction)
void OnRPCSetPlayerDirection(PlayerBase player, ParamsReadContext ctx)
static void SetPlayerPosition(PlayerBase player, vector position, bool breakSync=false)
proto native Transport GetTransport()
proto bool Read(void value_in)
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Serializer ParamsReadContext
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static const float RAD2DEG
proto native void SetVelocity(notnull IEntity ent, vector vel)
Sets linear velocity (for Rigid bodies)
proto void dBodySetAngularVelocity(notnull IEntity body, vector angvel)
Changed an angular velocity.