The online racing simulator
Is it possible to make the !drag command work only in a specific area?
Hello, Smile

On my server, I have a drag light system that works with the !drag command. However, when I use this command, all players can see the drag lights. What I want is to make this system work only in a specific drag area.

In other words, I don’t want players to be able to use !drag anywhere on the map — it should only be active in the defined drag zone.

Is there a way to coordinate or restrict this?

Thanks.


prnt.sc/GrgQdkIBlMtf
Yes, it is possible. Just let the drag lights to show only if the player is in spefified position
Check open sources for cruise insim at MCI packets and you will find out
Hope it helps (:
The simple drag system I made is for use with LFSLapper ("lapper").

It uses global buttons (openGlobalButton), which means that everyone sees it.

You could change that to private buttons (openPrivButton) so that only the person who enters the !drag command sees the lights.

If you want the lights to only appear in a certain area, you would have to register a node or a zone.

If you want a more developed drag system, you could try Bass-Drivers system (HERE).

I tried to make a drag system before that, but it only partly worked as I couldn't get the penalty part working. Can be found HERE.
Quote from sinanju :The simple drag system I made is for use with LFSLapper ("lapper")...

Thanks a lot for the explanation! 🙏
I understand the difference between openGlobalButton and openPrivButton, that’s very helpful.

What I still need is to restrict the !drag command so that it only works in a specific area (for example, the drag strip). Since I’m new to InSim/Lapper, I’m not sure how to properly define a node/zone or check player position with MCI packets.

Could you maybe give me a small example (or point me to one) on how to set up such a zone check in Lapper? That would help me a lot.
Firstly, you don't have to worry about MCI or other packets with lapper.

The code within lapper, which runs in the background, does all the packet work for you.

In the main, you specify a lapper Event (eg Leave Pits) and execute your own code (eg show button/text) and/or run a sub-routine.

I'd suggest downloading my original drag script and the AU1 layout, which are both in the zip file in the 1st post (HERE). At the same time, have read through all the posts, as there's some useful information there.

Along with the files, you can have a look at the video I made, which shows both the layout and what the script actually does.



I'm not sure if you know the difference between Nodes and Zones, but I made a post about it to explain HERE, which helps explain.

As for how to only show lights to only the drivers you want to have a drag race, that's beyond my capabilities.

Probably what I'd do, is just have a Global message advising drivers not involved in the drag race to stay out of the drag area while lights are on. Although if lights are up and running, should be fairly obvious whats going on.
When I tested it on a server in the demo, the light remains stationary and does not move. I heard that the location coordinates can be set so that they are not visible to everyone. What can I do about this drag system?

Frown


The drag commands you shared are good, but the light remains stationary, it does not move like in this video, I want a drag system, what can I do for this?
Are you talking about my older drag system with the 'xmas lights' layout rather than my newer and simpler set?

Did you use the AU1 drag layout I bundled with the drag.lpr set? This is required as the code needs the car to enter into various marked zones to trigger the light sequences.

Did the lights come on as per my video?

Did they come on, go through the sequence, but then didn't clear from the screen? If so, did you use the !dragoff command?

My script was written a lot of years ago, and the lapper code has been updated since then, so there may be some issues there, in which case, maybe try Bass-Drivers system.
#8 - gu3st
Quote from sinanju :Are you talking about my older drag system with the 'xmas lights' layout rather than my newer and simpler set?

Did you use the AU1 drag layout I bundled with the drag.lpr set? This is required as the code needs the car to enter into various marked zones to trigger the light sequences.

Did the lights come on as per my video?

Did they come on, go through the sequence, but then didn't clear from the screen? If so, did you use the !dragoff command?

My script was written a lot of years ago, and the lapper code has been updated since then, so there may be some issues there, in which case, maybe try Bass-Drivers system.

demo user won't be able to use AU1 or any layouts for that matter
Quote from gu3st :demo user won't be able to use AU1 or any layouts for that matter

Didn't notice was demo player. Thanks for pointing that out.

Not being able to use layouts explains why xmas drag lights don't work as expected, and don't close - the script will only progress when a checkpoint triggers are activated on the AU1 layout.

Not much else I can do or recommend, except use the basic drag light system, or maybe fork out for at least a S1 license.

FGED GREDG RDFGDR GSFDG