The online racing simulator
Hello,
I try to do then I go to cordinates when timer start going but I don't understand how do that. This is my make script
Sub RSA_hi()
IF ( $Mode == "Cruise" )
THEN
IF ( GetCurrentPlayerVar( "IdZone" ) == "TOKO" )
THEN
privmsg( "^7Welcome to ^6" . GetCurrentPlayerVar( "IdZone") );
ENDIF
ENDIF
EndSub

But he don't work...
Ok.

What you're looking for is a message to appear when someone is in a predetermined part of the track, rather than a message that happens at a predetermined time.

RegisterScheduleAction is for time based events.
RegisterZoneAction & RegisterNodeAction are for place based events.

In this case, what you need to do is set up a RegisterZoneAction, e.g.


<?php 
    RegisterZoneAction
"TOKO" ,  "BL1"36,402RSA_hi,"" );
?>

Basically, when you get to a place (specific ZONE on the track), which you call 'TOKO' at Blackwood, at the zone you've defined (I've just picked 2 numbers at random [36 + 402]) then the sub-routine RSA_hi will start.

At the moment you have a "welcome" message, but you can add other messages or buttons in that code.

Also.

If you want to use the same messages, etc, when you get to other zones, then you can re-use the same bit of sub-routine, but just extend it with some more IF statements, such as

<?php 
Sub RSA_hi
()
    IF ( 
$Mode == "Cruise" )
    
THEN
        
IF ( GetCurrentPlayerVar"IdZone" ) == "TOKO" )
        ELSE
        IF ( 
GetCurrentPlayerVar"IdZone" ) == "HERE" )
        ELSE
        IF ( 
GetCurrentPlayerVar"IdZone" ) == "THERE" )
        
THEN   
            privmsg
"^7Welcome to ^6" GetCurrentPlayerVar"IdZone") );
        ENDIF
        ENDIF
        ENDIF
        ENDIF
EndSub
?>


Quote from sinanju :Not quite sure what it is you mean here.

Do you mean when a player changes their nickname?

As in something like


<?php 
Event OnNameChange
($userName,$oldNickName,$newNickName# Player event
cmdLFS("/kick " GetCurrentPlayerVar("UserName") );
EndEvent
?>



This is, I know. I need as a player, the player takes over the car and then kicked Lapper and I have not found such a system.

----------------------------------
NickName took over from NickName
cmdLFS("/kick " . GetCurrentPlayerVar("UserName") );
------------------------------------

Here it must be done to stop pens and both players use the "T" letters, and thus take over the car. I think that there is need to develop a new system.
Quote from sinanju :Use the RegisterScheduleAction and make up a couple of sub-routine to go with it that show the text you want as clear buttons.

Something like


<?php 
RegisterScheduleAction
"0 0 1 * * * *"RSA_hi );
RegisterScheduleAction"0 1 1 * * * *"RSA_hello );

Sub RSA_hi()
    
globalRcm"Hi" );
EndSub

Sub RSA_hello
()
    
globalRcm"Hello" );
EndSub
?>


If I've got it right (long time since I used this method) that should probably put "Hi" on screen every hour, followed by "Hello" a minute later, but from experience, it'll get annoying.

The first number in the sequence is seconds, then next is minutes, then hours, .....etc. Nothing to stop you changing from every 1 hour to every 2, 3, 4 or more hours.

Would not it be possible to apply this principle in traffic lights?
Very easily.

Something like....


<?php 
RegisterScheduleAction
"0 1 * * * * *"RSA_green );
RegisterScheduleAction"20 1 * * * * *"RSA_amber );
RegisterScheduleAction"40 0 * * * * *"RSA_red );

Sub RSA_green()
    
closeGlobalButton"tlight_bg&tlight_bga&tlight_colour");
    
openGlobalButton"tlight_bg",91,6,18,9,1,6,32," ");
    
openGlobalButton"tlight_bga",91,6,18,9,1,6,32," ");
    
openGlobalButton"tlight_colour",84,0,20,20,1,6,0,"^2•" );
EndSub

Sub RSA_amber
()
    
closeGlobalButton"tlight_bg&tlight_bga&tlight_colour");
    
openGlobalButton"tlight_bg",91,6,18,9,1,6,32," ");
    
openGlobalButton"tlight_bga",91,6,18,9,1,6,32," ");
    
openGlobalButton"tlight_colour",84,0,20,20,1,6,0,"^3•" );
EndSub

Sub RSA_red
()
    
closeGlobalButton"tlight_bg&tlight_bga&tlight_colour");
     
openGlobalButton"tlight_bg",91,6,18,9,1,6,32," ");
     
openGlobalButton"tlight_bga",91,6,18,9,1,6,32," ");
     
openGlobalButton"tlight_colour",84,0,20,20,1,6,0,"^1•" );
 
EndSub
?>


However!

Everyone will see the lights wherever they are on track.

I did make a set of traffic lights before - I'll see if I still have the code somewhere - but I think they worked on Zone system.
Quote from sinanju :Very easily.

Something like....


<?php 
RegisterScheduleAction
"0 1 * * * * *"RSA_green );
RegisterScheduleAction"20 1 * * * * *"RSA_amber );
RegisterScheduleAction"40 0 * * * * *"RSA_red );

Sub RSA_green()
    
closeGlobalButton"tlight_bg&tlight_bga&tlight_colour");
    
openGlobalButton"tlight_bg",91,6,18,9,1,6,32," ");
    
openGlobalButton"tlight_bga",91,6,18,9,1,6,32," ");
    
openGlobalButton"tlight_colour",84,0,20,20,1,6,0,"^2•" );
EndSub

Sub RSA_amber
()
    
closeGlobalButton"tlight_bg&tlight_bga&tlight_colour");
    
openGlobalButton"tlight_bg",91,6,18,9,1,6,32," ");
    
openGlobalButton"tlight_bga",91,6,18,9,1,6,32," ");
    
openGlobalButton"tlight_colour",84,0,20,20,1,6,0,"^3•" );
EndSub

Sub RSA_red
()
    
closeGlobalButton"tlight_bg&tlight_bga&tlight_colour");
     
openGlobalButton"tlight_bg",91,6,18,9,1,6,32," ");
     
openGlobalButton"tlight_bga",91,6,18,9,1,6,32," ");
     
openGlobalButton"tlight_colour",84,0,20,20,1,6,0,"^1•" );
 
EndSub
?>


However!

Everyone will see the lights wherever they are on track.

I did make a set of traffic lights before - I'll see if I still have the code somewhere - but I think they worked on Zone system.

I think that should be used openPrivButton and how it needs to be done on the track?
It must be that if in one side of the red and green in another fired as vice versa, and it requires self-timer.
One question. Do this script work like traffic?
RegisterZoneAction( "Traffic" , "BL1", 36,402, 5 , RSA_green,"" );
RegisterZoneAction( "Traffic" , "BL1", 36,402, 5 , RSA_amber,"" );
RegisterZoneAction( "Traffic" , "BL1", 36,402, 5 , RSA_red,"" );

RegisterScheduleAction( "0 1 * * * * *", RSA_green );
RegisterScheduleAction( "20 1 * * * * *", RSA_amber );
RegisterScheduleAction( "40 0 * * * * *", RSA_red );

Sub RSA_green()
closeGlobalButton( "tlight_bg&tlight_bga&tlight_colour");
openGlobalButton( "tlight_bg",91,6,18,9,1,6,32," ");
openGlobalButton( "tlight_bga",91,6,18,9,1,6,32," ");
openGlobalButton( "tlight_colour",84,0,20,20,1,6,0,"^2•" );
EndSub

Sub RSA_amber()
closeGlobalButton( "tlight_bg&tlight_bga&tlight_colour");
openGlobalButton( "tlight_bg",91,6,18,9,1,6,32," ");
openGlobalButton( "tlight_bga",91,6,18,9,1,6,32," ");
openGlobalButton( "tlight_colour",84,0,20,20,1,6,0,"^3•" );
EndSub

Sub RSA_red()
closeGlobalButton( "tlight_bg&tlight_bga&tlight_colour");
openGlobalButton( "tlight_bg",91,6,18,9,1,6,32," ");
openGlobalButton( "tlight_bga",91,6,18,9,1,6,32," ");
openGlobalButton( "tlight_colour",84,0,20,20,1,6,0,"^1•" );
EndSub

Is it possible to do as a player votes for the race start or end of the race kicked him?
Sorry, you're jumping from one thing to another, and I can't keep up.
Hello,
How can I make a street's names and speed zone?
Quote from bananas111 :Hello,
How can I make a street's names and speed zone?

Street Names
Find a node on a track you want the name to appear.

Then you need to make up a RegisterNodeAction with short track name, node number, and a sub-routine, e.g.


<?php 
    RegisterNodeAction
"SO2R" 84 SN_Odeon,"" );
?>

Then make up sub-routine that will show name, e.g.


<?php 
Sub SN_Odeon
$userName )
    
openPrivButton"location",2,20,24,6,2,4,96,"^7ODEON TURN -->");
EndSub
?>


This is what I use on my server to show the turn at the Odeon Cinema at South City, and shows for up to 4 seconds.

If you give another location the same button name, it will overwrite your original button, which can be good in this case as faster cars may be at next corner before name changes.

Speed Zone
Same as above, but add another button with a number and/or description in it, e.g.


<?php 
Sub SN_Odeon
$userName )
    
openPrivButton"location",2,20,24,6,2,4,96,"^7ODEON TURN -->");
    
openPrivButton"speed",2,30,24,6,2,4,96,"^140MPH");
EndSub
?>


To get the node number, drive to the bit of the track you want sign to appear, and type !node.

Assuming you're the admin, you will be shown the node number.
How to do that as a player votes for the race start or end of the race that he then kicked out?
Quote from sinanju :Street Names
Find a node on a track you want the name to appear.

Then you need to make up a RegisterNodeAction with short track name, node number, and a sub-routine, e.g.


<?php 
    RegisterNodeAction
"SO2R" 84 SN_Odeon,"" );
?>

Then make up sub-routine that will show name, e.g.


<?php 
Sub SN_Odeon
$userName )
    
openPrivButton"location",2,20,24,6,2,4,96,"^7ODEON TURN -->");
EndSub
?>


This is what I use on my server to show the turn at the Odeon Cinema at South City, and shows for up to 4 seconds.

If you give another location the same button name, it will overwrite your original button, which can be good in this case as faster cars may be at next corner before name changes.

Speed Zone
Same as above, but add another button with a number and/or description in it, e.g.


<?php 
Sub SN_Odeon
$userName )
    
openPrivButton"location",2,20,24,6,2,4,96,"^7ODEON TURN -->");
    
openPrivButton"speed",2,30,24,6,2,4,96,"^140MPH");
EndSub
?>


To get the node number, drive to the bit of the track you want sign to appear, and type !node.

Assuming you're the admin, you will be shown the node number.

I'm sorry for the impatience but how to do that work on AS5Y?
Quote from sinanju :Street Names
Find a node on a track you want the name to appear.

Then you need to make up a RegisterNodeAction with short track name, node number, and a sub-routine, e.g.


<?php 
    RegisterNodeAction
"SO2R" 84 SN_Odeon,"" );
?>

Then make up sub-routine that will show name, e.g.


<?php 
Sub SN_Odeon
$userName )
    
openPrivButton"location",2,20,24,6,2,4,96,"^7ODEON TURN -->");
EndSub
?>


This is what I use on my server to show the turn at the Odeon Cinema at South City, and shows for up to 4 seconds.

If you give another location the same button name, it will overwrite your original button, which can be good in this case as faster cars may be at next corner before name changes.

Speed Zone
Same as above, but add another button with a number and/or description in it, e.g.


<?php 
Sub SN_Odeon
$userName )
    
openPrivButton"location",2,20,24,6,2,4,96,"^7ODEON TURN -->");
    
openPrivButton"speed",2,30,24,6,2,4,96,"^140MPH");
EndSub
?>


To get the node number, drive to the bit of the track you want sign to appear, and type !node.

Assuming you're the admin, you will be shown the node number.

I don't understand node numbers can you help?
Quote from LFSCruise :I'm sorry for the impatience but how to do that work on AS5Y?

Are Demo'ers allowed on Aston?

I don't think you get nodes on any of the X or Y configs.

Try typing !node at various points going round Blackwood - you should get different numbers showing as you move on. This "node" goes from one side of track to other.
Yes, I have another account. I write !node AS5Y across the track shows the 0th.
Just checked and !node will not work in open track configuration mode.

But !zone will.

Instead of using !node try using !zone on the racing line.

Then code might be something like

<?php 
    RegisterZoneAction
"AS5Y" , -619,-439SN_Odeon,"" );
?>


then exactly same sub-routine I showed earlier

<?php 
Sub SN_Odeon
$userName )
    
openPrivButton"location",2,20,24,6,2,4,96,"^7ODEON TURN -->");
EndSub
?>



If you find that you're not 'catching' people in your zone and they go past it, then nothing to stop you having a zone at either side, but all having the same sub-routine, like

<?php 
    RegisterZoneAction
"AS5Y" , -619,-429,SN_Odeon,"" );
    
RegisterZoneAction"AS5Y" , -619,-439,SN_Odeon,"" );
    
RegisterZoneAction"AS5Y" , -619,-449,SN_Odeon,"" );
?>


I use this system quite a bit, but usually only take the zone details for the racing line as it's not important if they miss it.

Edit
----

If you're doing something for cruise use, of course you will not be interested in the racing line, so you may have to do multiple zones, or put barriers up so that you have to go through the specified zone.
Quote from sinanju :Just checked and !node will not work in open track configuration mode.

But !zone will.

Instead of using !node try using !zone on the racing line.

Then code might be something like


<?php 
    RegisterZoneAction
"AS5Y" , -619,-439SN_Odeon,"" );
?>


then exactly same sub-routine I showed earlier


<?php 
Sub SN_Odeon
$userName )
    
openPrivButton"location",2,20,24,6,2,4,96,"^7ODEON TURN -->");
EndSub
?>




If you find that you're not 'catching' people in your zone and they go past it, then nothing to stop you having a zone at either side, but all having the same sub-routine, like


<?php 
    RegisterZoneAction
"AS5Y" , -619,-429,SN_Odeon,"" );
    
RegisterZoneAction"AS5Y" , -619,-439,SN_Odeon,"" );
    
RegisterZoneAction"AS5Y" , -619,-449,SN_Odeon,"" );
?>



I use this system quite a bit, but usually only take the zone details for the racing line as it's not important if they miss it.

I think that would be better RegisterNodeAction.

How to do that as a player votes for the race start or end of the race that he then kicked out?
Quote from LFSCruise :How to do that as a player votes for the race start or end of the race that he then kicked out?

Not sure that can be done unless the standard lapper code


<?php 
Event OnVoteRestartChange
($PlayerOnTrack$Vote $Need# Lapper Event
    
openGlobalButton"bargr1",40,1,10,6,6,30,96,langEngine"%{main_vote_restart1}%"));
    
openGlobalButton"bargr2",50,1,20,6,6,30,96,langEngine"%{main_vote_restart2}%",$Vote,$PlayerOnTrack,$Need ) );
EndEvent
?>


can be changed to something like


<?php 
Event OnVoteRestartChange
($PlayerOnTrack$Vote $Need# Lapper Event
        
cmdLFS"/kick " $PlayerOnTrack );
EndEvent
?>


Streets and speed zones work! thanks you
Quote from sinanju :Not sure that can be done unless the standard lapper code


<?php 
Event OnVoteRestartChange
($PlayerOnTrack$Vote $Need# Lapper Event
    
openGlobalButton"bargr1",40,1,10,6,6,30,96,langEngine"%{main_vote_restart1}%"));
    
openGlobalButton"bargr2",50,1,20,6,6,30,96,langEngine"%{main_vote_restart2}%",$Vote,$PlayerOnTrack,$Need ) );
EndEvent
?>


can be changed to something like


<?php 
Event OnVoteRestartChange
($PlayerOnTrack$Vote $Need# Lapper Event
        
cmdLFS"/kick " $PlayerOnTrack );
EndEvent
?>



It does not work.
Do you know how to do that openPrivButton show a direct and variable speed?
If you look in the /docs folder, you'll see a file called playerVars.txt.

In that file, you'll see there's a number of player variables you can use to get speed, such as

UnitSpeed...........// km/h or mph relative to the player choice
AvgSpeed...........// Avg Speed on last Lap Time
InstantSpeed......// Instant speed for the player
BestSpeed..........// Best Speed done on this combo by player

If you want to see how to use these type of variables, look at Event OnAcceleration.

I'm not going to show you how to use it, because this is probably the fifth easiest button to make.

You should teach yourself the following;

How to make a..

..button with no text (as used in a background)
..button with text built directly into the button code
..button with text via Lang(uage) file
..button with sub-routine appended (like the ones for the street names)
..button with player variable (look for {} brackets in the language files to give you ideas on how they're used).

Until you can do these easy buttons, I don't think you should be going much further.

Sorry for being bit negative, but I feel I'm spoon feeding you here, and making up a whole server script line by line. And you won't be learning much if you can't see how one piece of code, with slight changes, can be used for so many different situations.

Read the playerVars.txt, changes.txt, and lfslapper.lpr files as they've all got coding help comments that are useful for doing fairly easy coding.
Hi,
Do lfs lapper have a jobs? Like a pizza bringer, hamburger bringer, pizza boy
Quote from sinanju :If you look in the /docs folder, you'll see a file called playerVars.txt.

In that file, you'll see there's a number of player variables you can use to get speed, such as

UnitSpeed...........// km/h or mph relative to the player choice
AvgSpeed...........// Avg Speed on last Lap Time
InstantSpeed......// Instant speed for the player
BestSpeed..........// Best Speed done on this combo by player

If you want to see how to use these type of variables, look at Event OnAcceleration.

I'm not going to show you how to use it, because this is probably the fifth easiest button to make.

You should teach yourself the following;

How to make a..

..button with no text (as used in a background)
..button with text built directly into the button code
..button with text via Lang(uage) file
..button with sub-routine appended (like the ones for the street names)
..button with player variable (look for {} brackets in the language files to give you ideas on how they're used).

Until you can do these easy buttons, I don't think you should be going much further.

Sorry for being bit negative, but I feel I'm spoon feeding you here, and making up a whole server script line by line. And you won't be learning much if you can't see how one piece of code, with slight changes, can be used for so many different situations.

Read the playerVars.txt, changes.txt, and lfslapper.lpr files as they've all got coding help comments that are useful for doing fairly easy coding.

Can you help? Man does not go do the button to show the speed.

FGED GREDG RDFGDR GSFDG