public static void OnCreateMove(CUserCmd *pCmd) { QAngle angPunchAngles = Utils.GetLocalPlayer().GetPunchAngles(); angPunchAngles.roll = 0; pCmd->viewangles = pCmd->viewangles.Subtract(angPunchAngles.Multiply(2)); }
public override Task Read(SourceBufferReader buf, SourceDemo demo) { Relative = buf.ReadBoolean(); Angle = new QAngle ( buf.ReadInt16(), buf.ReadInt16(), buf.ReadInt16() ); return(Task.CompletedTask); }
public Split(int flags, Vector viewOrigin, QAngle viewAngles, QAngle localViewAngles, Vector viewOrigin2, QAngle viewAngles2, QAngle localViewAngles2) { Flags = flags; ViewOrigin = viewOrigin; ViewAngles = viewAngles; LocalViewAngles = localViewAngles; ViewOrigin2 = viewOrigin2; ViewAngles2 = viewAngles2; LocalViewAngles2 = localViewAngles2; }
public static Vector2D EntityToRadar(int EntityID, Vector2D RadarPosition, int RadarSize) { Vector2D DotPos; Vector2D Direction; // Get Origin Of Entity Vector3D EntityPosition = Arrays.Entity[EntityID].m_VecOrigin; // Get Origin Of LocalPlayer Vector3D LocalPosition = LocalPlayer.m_VecOrigin; // Calculate Direction Direction.x = -(EntityPosition.y - LocalPosition.y); Direction.y = EntityPosition.x - LocalPosition.x; // Get Rotation QAngle LocalAngles = LocalPlayer.m_angEyeAngles; float Radian = Maths.DEG2RAD(LocalAngles.y - 90.0f); // Calculate Raw DotPos DotPos.x = (Direction.y * (float)System.Math.Cos(Radian) - Direction.x * (float)System.Math.Sin(Radian)) / 20.0f; DotPos.y = (Direction.y * (float)System.Math.Sin(Radian) + Direction.x * (float)System.Math.Cos(Radian)) / 20.0f; // Add RadarPos To Calculated DotPos DotPos.x += RadarPosition.x + RadarSize / 2; DotPos.y += RadarPosition.y + RadarSize / 2; // Clamp Dots To RadarSize if (DotPos.x < RadarPosition.x) { DotPos.x = RadarPosition.x; } if (DotPos.x > RadarPosition.x + RadarSize - 5) { DotPos.x = RadarPosition.x + RadarSize - 5; } if (DotPos.y < RadarPosition.y) { DotPos.y = RadarPosition.y; } if (DotPos.y > RadarPosition.y + RadarSize - 5) { DotPos.y = RadarPosition.y + RadarSize - 5; } return(DotPos); }
public static void OnCreateMove(CUserCmd *pCmd) { if ((pCmd->buttons & IN_ATTACK) == 0) { return; } PlayerHelper pEntity = GetTarget(pCmd); if (!pEntity.IsValid()) { return; } QAngle targetAngle = SpacialUtils.CalcAngle(Utils.GetLocalPlayer().GetEyePos(), pEntity.GetEyePos()); targetAngle.Normalize(); pCmd->viewangles = pCmd->viewangles.Add(targetAngle.Subtract(pCmd->viewangles).Divide(2)); pCmd->viewangles.Normalize(); }
/** * Spawns a door at the specified location */ Entity SpawnDoor( string mdl = "models/props_downtown/door_interior_112_01.mdl", Vector pos = Vector(0,0,0), QAngle ang = QAngle(0,0,0), object[] keyvalues = null );
/** * Spawns a fuel barrel at the specified location */ Entity SpawnFuelBarrel( Vector pos, QAngle ang = QAngle(0,0,0), object[] keyvalues = null );
/** * Spawns an ammo pile at the specified location */ Entity SpawnAmmo( string mdl = "models/props/terror/ammo_stack.mdl", Vector pos = Vector(0,0,0), QAngle ang = QAngle(0,0,0), object[] keyvalues = null );
/** * Spawns the requested weapon at the specified location */ Entity SpawnWeapon( string weaponName, int Count = 4, Vector pos = Vector(0,0,0), QAngle ang = QAngle(0,0,90), object[] keyvalues = null );
/** * Spawns a L4D1 minigun at the specified location */ Entity SpawnL4D1Minigun( Vector pos, QAngle ang = QAngle(0,0,0), object[] keyvalues = null );
/** * Spawns a ragdoll model at the specified location */ Entity SpawnRagdoll( string mdl, Vector pos, QAngle ang = QAngle(0,0,0), object[] keyvalues = null );
/** * Spawns a physics model at the specified location */ Entity SpawnPhysicsProp( string mdl, Vector pos, QAngle ang = QAngle(0,0,0), object[] keyvalues = null );
/** * Converts QAngles into vectors, with an optional vector length. */ Vector VectorFromQAngle(QAngle angles, double radius = 1.0);
/** * Spawns the requested commentary zombie at the location you want. */ void SpawnCommentaryZombie(string zombieModel = "common_male_tshirt_cargos", Vector pos = Vector(0,0,0), QAngle ang = QAngle(0,0,0));
/** * Spawns the requested L4D1 Survivor at the location you want. * * \todo Possibly add a way to determine if a requested survivor should glow or not. */ void SpawnL4D1Survivor(int survivor = 4, Vector pos = Vector(0,0,0), QAngle ang = QAngle(0,0,0));
/** * Spawns a new entity and returns it as VSLib::Entity. * * @param _classname The classname of the entity * @param pos Where to spawn it (a Vector object) * @param ang Angles it should spawn with * @param keyvalues Other keyvalues you may want it to have * @return A VSLib entity object */ Entity CreateEntity(string _classname, Vector pos = Vector(0,0,0), QAngle ang = QAngle(0,0,0), object[] keyvalues = null);
public static bool Equals(QAngle qanA, QAngle qanB) => (qanA.X == qanB.X) && (qanA.Y == qanB.Y) && (qanA.Z == qanB.Z);
/** * Spawns a commentary dummy model at the specified location */ Entity SpawnCommentaryDummy( string mdl = "models/survivors/survivor_gambler.mdl", string weps = "weapon_pistol", string anim = "Idle_Calm_Pistol", Vector pos = Vector(0,0,0), QAngle ang = QAngle(0,0,0), object[] keyvalues = null );