Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async Task OnTick()
- {
- if (Function.Call<bool>(Hash.HAS_STREAMED_TEXTURE_DICT_LOADED, "Deadline"))
- {
- if (Game.PlayerPed.IsSittingInVehicle())
- {
- if (!Function.Call<bool>(Hash._GET_SCREEN_EFFECT_IS_ACTIVE, "DeadlineNeon"))
- {
- Function.Call(Hash._START_SCREEN_EFFECT, "DeadlineNeon", 0, 1);
- }
- Vehicle v = Game.PlayerPed.CurrentVehicle;
- int index = Function.Call<int>(Hash.GET_ENTITY_BONE_INDEX_BY_NAME, v.Handle, "wheel_lr");
- Vector3 poz = Function.Call<Vector3>(Hash.GET_WORLD_POSITION_OF_ENTITY_BONE, v.Handle, index);
- //World.DrawMarker(MarkerType.DebugSphere, poz, Vector3.Zero, Vector3.Zero, Vector3.One * 0.4f, Color.FromArgb(255, 0, 0));
- var currentpos = Game.PlayerPed.CurrentVehicle.Position;
- var oldArray = posList;
- Array.Copy(oldArray, 0, posList, 1, 99);
- posList[0] = new Vector4(currentpos, Game.PlayerPed.CurrentVehicle.Rotation.Y);
- for (int i = 0; i < 99; i++)
- {
- //Debug.WriteLine(i.ToString());
- Vector3 pos = new Vector3(posList[i].X, posList[i].Y, posList[i].Z);
- float rot = MathUtil.DegreesToRadians(posList[i].W);
- Vector3 pos2 = new Vector3(posList[i + 1].X, posList[i + 1].Y, posList[i + 1].Z);
- float rot2 = MathUtil.DegreesToRadians(posList[i + 1].W);
- Vector3 ul = pos + new Vector3(0f, 0f, 0.4f);
- Vector3 ur = pos2 + new Vector3(0f, 0f, 0.4f);
- Vector3 bl = pos + new Vector3(0f, 0f, -0.2f);
- Vector3 br = pos2 + new Vector3(0f, 0f, -0.2f);
- var alpha = 175;
- Function.Call((Hash)0x358BCCE967D10BA5, ur, bl, br, 24, 202, 230, alpha, "Deadline", "Deadline_Trail_01", 0f, 1f, 0f, 0f, 0f, 0f, 1f, 0f, 1f);
- Function.Call((Hash)0x358BCCE967D10BA5, br, bl, ur, 24, 202, 230, alpha, "Deadline", "Deadline_Trail_01", 0f, 0f, 1f, 1f, 0f, 1f, 1f, 1f, 1f);
- Function.Call((Hash)0x358BCCE967D10BA5, ur, ul, bl, 24, 202, 230, alpha, "Deadline", "Deadline_Trail_01", 0f, 0f, 1f, 1f, 0f, 1f, 1f, 1f, 1f);
- Function.Call((Hash)0x358BCCE967D10BA5, ul, ur, bl, 24, 202, 230, alpha, "Deadline", "Deadline_Trail_01", 0f, 0f, 1f, 1f, 0f, 1f, 1f, 1f, 1f);
- }
- }
- else
- {
- if (Function.Call<bool>(Hash._GET_SCREEN_EFFECT_IS_ACTIVE, "DeadlineNeon"))
- {
- Function.Call(Hash._STOP_SCREEN_EFFECT, "DeadlineNeon");
- }
- }
- }
- else
- {
- Function.Call(Hash.REQUEST_STREAMED_TEXTURE_DICT, "Deadline", true);
- }
- await Task.FromResult(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement