Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
local sim = ac.getSim() local selectedCar = nil ---@type ac.StateCar local function TeleportHUD() ui.text('Select car to teleport to:') ui.childWindow('##drivers', vec2(ui.availableSpaceX(), 120), function () for i = 1, sim.carsCount - 1 do local car = ac.getCar(i) local driverName = ac.getDriverName(i) if car.isConnected and not car.isAIControlled and not string.find(driverName, "Traffic") then if ui.selectable(driverName, selectedCar == car) then selectedCar = car end end end end) end local function TeleportHUDClosed(okClicked) if okClicked and selectedCar then local dir = selectedCar.look physics.setCarVelocity(0, vec3(0, 0, 0)) -- spawn 8 meters behind, add 0.1 meter height to avoid falling through the map physics.setCarPosition(0, selectedCar.position + vec3(0, 0.1, 0) - dir * 8, -dir) -- Disable collision for 10 seconds physics.setCarCollisionEnabled(0, false) ac.setTimeout(10000, function () physics.setCarCollisionEnabled(0, true) end) end end ui.registerOnlineExtra(ui.Icons.FastForward, 'Teleport To Player', nil, TeleportHUD, TeleportHUDClosed, ui.OnlineExtraFlags.none)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)