private async Task CreateSpikeStrips() { Ped playerPed = LocalPlayer.Character; PlayKneelAnim(4000); Vector3 playerPos = playerPed.Position; Vector3 playerForwardVector = playerPed.ForwardVector; float playerHeading = playerPed.Heading; const int SpikeStripsToSpawn = 4; for (int i = 0; i < SpikeStripsToSpawn; i++) { const float SeparationFromPlayer = 2f; const float SeparationBetweenStingers = 3.7f; SpikeStrip s = await SpikeStrip.Create( playerPos + playerForwardVector *(SeparationFromPlayer + (SeparationBetweenStingers *i)), playerHeading); SpikesStrips.Add(s); await Delay(500); } Screen.ShowNotification("~g~Deployed 2 spike strips!", true); }
/// <summary> /// Creates two spike strips in-front of the player. /// </summary> private async void CreateSpikeStrips() { Ped playerPed = LocalPlayer.Character; Vector3 playerPos = playerPed.Position; Vector3 playerForwardVector = playerPed.ForwardVector; float playerHeading = playerPed.Heading; const int SpikeStripsToSpawn = 2; for (int i = 0; i < SpikeStripsToSpawn; i++) { const float SeparationFromPlayer = 3.4f; const float SeparationBetweenStingers = 4.825f; SpikeStrip s = await SpikeStrip.Create(playerPos + playerForwardVector *(SeparationFromPlayer + (SeparationBetweenStingers *i)), playerHeading); SpikesStrips.Add(s); } Screen.ShowNotification("~o~Deployed spike strips!", true); }