The online racing simulator
Searching in All forums
(6 results)
The traffic light (Start Light) is always red never changes on auto
buntidondo
S3 licensed
https://www.lfs.net/forum/thread/95531-LFSLapper%3ACruise-TrafficLightSystem

From there I used the code but when I'm done w/ the intersections and then also enabling the intersections one traffic light keeps green and 2 other keeps red and never changes Frown
Here's some screenshots: (idk if you see the image 1 time or 2 times)
buntidondo
S3 licensed
In Logfile
8/23/2024 9:36:25 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174
8/23/2024 9:37:44 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174
8/23/2024 9:38:56 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174
8/23/2024 9:40:04 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174
8/23/2024 9:40:54 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174
8/23/2024 9:41:09 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174
8/23/2024 9:43:56 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174
8/23/2024 9:45:05 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174
8/23/2024 9:50:44 PM -> Var not defined on file: ".\default\LFSLapper.lpr" at line #174

In LFSLapper.lpr at line 174
$StoreOfflineData = 0; #storedvalue.dbs Store Offline data , even when the player doesnt exist in the database.

Last edited by buntidondo, . Reason : Editing text
buntidondo
S3 licensed
Sorry for late reply, I'm not sure where to find Lapper error log
buntidondo
S3 licensed
<?php
# LFSLapper Script for Speed Radar (Only for Cops)

# List of usernames that should work for the radar
$CopUsernames = array("CopUser1", "CopUser2", "CopUser3");

Event OnInterval(1000) # Check every second
$Players = GetListOfPlayers();
foreach($Players as $Player) {
$UserName = GetCurrentPlayerVar("UserName", $Player);
$Speed = GetCurrentPlayerVar("Speed", $Player);
$Heading = GetCurrentPlayerVar("Heading", $Player);
$Distance = GetCurrentPlayerVar("Distance", $Player);

# Check if the player is a cop
$IsCop = in_array($UserName, $CopUsernames);

if($IsCop) {
# Check if there's a car in front within a certain distance (e.g., 50 meters)
$CarInFront = false;
foreach($Players as $OtherPlayer) {
if($Player != $OtherPlayer) {
$OtherDistance = GetCurrentPlayerVar("Distance", $OtherPlayer);
$OtherHeading = GetCurrentPlayerVar("Heading", $OtherPlayer);

if($OtherDistance < 50 && abs($Heading - $OtherHeading) < 10) { # Adjust distance and heading tolerance as needed
$CarInFront = true;
$OtherSpeed = GetCurrentPlayerVar("Speed", $OtherPlayer);
break;
}
}
}

if($CarInFront) {
if($OtherSpeed > 100) { # Speed limit (adjust as needed)
btnCreate("^1Speed Radar", 5, 5, 50, 10, 1, "^1Speeding car detected at " . $OtherSpeed . " km/h!");
} else {
btnCreate("^1Speed Radar", 5, 5, 50, 10, 1, "^2Car in front is within speed limit.");
}
} else {
btnCreate("^1Speed Radar", 5, 5, 50, 10, 1, "^2No car in front.");
}
}
}
EndEvent
?>

buntidondo
S3 licensed
Alright
I made a speed radar with AI for a cruise server, tho it does not work, no errors in chat. Sending code
[Request] Can someone make me a speed radar plugin and only for cops
buntidondo
S3 licensed
I've tried some tries and couldn't make it, can someone help?
FGED GREDG RDFGDR GSFDG