The online racing simulator
Quote from sinanju :
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.

Well said and to be honest, I was thinking the same seeing question after question answered by you. The best way to learn this (but it goes for everything) is by doing it yourself, making mistakes, crying over it, start again and then slowly you'll get the hang of it, only to discover what a great environment Gai-Luron created for us (and Kravy too with his patches).
I think that it is impossible to do openPrivButton to show the speed does not directly.

openPrivButton( "speed",1,118,27,4,4,-1,32,"{0}" , ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );
openPrivButton( "speed",1,118,27,4,4,-1,32,"{0:1}" , ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );
Does not work. Why?
And as a follow up - if you were to show us some code to show what you were doing but couldn't get to work, people would be willing to show you where you're going wrong.

If you think we're being a bit hard on you, then look at other parts of the forum. For most of your questions you would have got 1 of the following 3 answers.

No / Yes /
Quote :Originally Posted by Dygear
Help != Programming for you.

Give a man a fish he eats for a day, teach a man to fish he eats for a life time.


Assuming they were polite of course!
Quote from LFSCruise :I think that it is impossible to do openPrivButton to show the speed does not directly.

openPrivButton( "speed",1,118,27,4,4,-1,32,"{0}" , ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );
openPrivButton( "speed",1,118,27,4,4,-1,32,"{0:1}" , ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );
Does not work. Why?

Because you have got {0} in one line, and {0:1} in the other.

Where you have these should start with
langEngine( ... etc.

The {0} should be in the language file, and means the first player variable asked for (in this case, InstantSpeed) goes where the 0 is.

Look at the Event OnAcceleration part of the code again, and you'll see that it'll have as part of it's line

<?php 
langEngine
"%{main_accel}%" ,GetCurrentPlayerVar("AccelerationTime"),GetCurrentPlayerVar("AccelerationEndSpeed"),GetCurrentPlayerVar("UnitSpeed")  ) );
?>

If you look for main_accel in the language file, it will have

<?php 
    main_accel 
"^8Accelerated in ^3{0}^8 seconds to {1} {2}!";
?>

{0} is the first of the player variables in the coding line, {2} is 2nd variable, and {3} is 3rd variable.
main_speed = "{0} {1}";

openPrivButton( langEngine( "speed",1,118,27,4,4,-1,32,"%{main_speed}%" , ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );

Tell what's wrong?
Quote from LFSCruise :main_speed = "{0} {1}";

openPrivButton( langEngine( "speed",1,118,27,4,4,-1,32,"%{main_speed}%" , ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );

Tell what's wrong?


<?php 
openPrivButton
langEngine"speed",1,118,27,4,4,-1,32,"%{main_speed}%" ,  ToPlayerUnitGetCurrentPlayerVar"InstantSpeed" )  ),GetCurrentPlayerVar("UnitSpeed") ) );
?>

should be laid out like


<?php 
openPrivButton
"speed",1,118,27,4,4,-1,32,langEngine"%{main_speed}%" ToPlayerUnitGetCurrentPlayerVar"InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );  
?>

I was successful. However, speed does not change, no change, why?
How to make a motion that he would change and it would appear directly?
Maybe because in your button with numbers as follows

1,118,27,4,4,-1,32

the -1 is where time is put, and -1 means leave button up until lapper told to close it or it gets overwritten by same button if there's a change.

Or to put it another way (as detailed in the default lfslapper.lpr file)

"Duration in seconds for the button to be displayed (use -1 if you don't want an automatic close)".

Try changing -1 to something like 4.

Can I remind you to look HERE.
If exchanging -2 disappear and only if the Appears -3 or -4 is the same.
+4 If it moves immediately disappears.
If you are replacing Their 10 to the Same effect as with -1.

Maybe instead of langEngine should be used strFormat?
Kaip jau sakiau anksčiau, jums tikrai reikia sužinoti, kaip padaryti paprastas mygtukai pirma prieš pradėdami galvoti apie StrFormat pertvarkos, ypač vis tiek galite naudoti kalbos failus, nepriklausomai nuo formato tipo jūs naudojate.

Translation courtesy of Google Translate.
Quote from LFSCruise :I was successful. However, speed does not change, no change, why?
How to make a motion that he would change and it would appear directly?

Hi,
You can show the current speed for a player when he/she passing a point on the track. (start/finish line or sp1/sp2/sp3 or a point like a speed trap)

You cant show the current speed all the time in lapper for all the players.
Why should you do that anyway? every car have a speedo meter in lfs.
Quote from Tim NL :Hi,
You can show the current speed for a player when he/she passing a point on the track. (start/finish line or sp1/sp2/sp3 or a point like a speed trap)

You cant show the current speed all the time in lapper for all the players.
Why should you do that anyway? every car have a speedo meter in lfs.

So that on the C# indicates the speed directly.
Why is it that the LFS Lapper impossible?

And it is well done for one reason.
How does the COP to see if the players are above and start capturing.
Because it is very awkward to write !clock and UserName.
Quote from LFSCruise :If exchanging -2 disappear and only if the Appears -3 or -4 is the same.
+4 If it moves immediately disappears.
If you are replacing Their 10 to the Same effect as with -1.

Maybe instead of langEngine should be used strFormat?

I thought about strFormat because I like the car is running it will be a variable value.
Hi,
How make a licenses?
Quote from LFSCruise :
How does the COP to see if the players are above and start capturing?

Bit like real life really.

In real life, a cop might be close to a point where speed zone changes from one value to lower value. In some places, electronic signs measure your cars speed as it goes past camera, and displays it. If someone still stays at same speed (doesn't slow down), cop chases.

In Lapper, choose a node or zone (or number of zones)
when car passes that point, then get lapper via GLOBAL button to show speed of driver at that point
If speed is higher than allowed speed get lapper via global button to advise driver is speeding
If COP is able to see speeding driver, then COP chases driver (or not)
If you make button(s) time sensitive, then if not chased while buttons appeared, then you don't get penalty.
Quote from bananas111 :Hi,
How make a licenses?

I use MS Word (sometimes Visio, sometimes Paint), then print them off. Depending on how intricate I want to make it, I sometimes scan stuff in, or download stuff from the internet.

If I want coloured licence, I copy document onto my pen drive, and use the colour printer at work (and hope I don't get caught!). If it's just b&W, I print it at home.

Last one I made was for my dog. Looks like a British Kennel license, but it's just a fake one. The dog's happy though, as she hasn't seen a real one to compare it to. I'm not intending to show it to anyone to try pass her off a thoroughbred breed, so I think it's ok.
Quote from sinanju :Bit like real life really.

In real life, a cop might be close to a point where speed zone changes from one value to lower value. In some places, electronic signs measure your cars speed as it goes past camera, and displays it. If someone still stays at same speed (doesn't slow down), cop chases.

In Lapper, choose a node or zone (or number of zones)
when car passes that point, then get lapper via GLOBAL button to show speed of driver at that point
If speed is higher than allowed speed get lapper via global button to advise driver is speeding
If COP is able to see speeding driver, then COP chases driver (or not)
If you make button(s) time sensitive, then if not chased while buttons appeared, then you don't get penalty.

Little understand.

It would be better to show all the players are within 200 meters.
And as it exceeds the speed zone in which it is its speed changes to red and then you start to catch and when it stops press caught and said, fine, and if it starts if it does not pay the fine.

The last sentence of the causes of errors.

If he stops and pays the fine to run it.
If you refuse to pay a fine if he take away the money and punish.

And yet I would like to ask why the COP, anyone can wear and activated?
There should be a list that includes a consumer would only be activated.
Quote from sinanju :I use MS Word (sometimes Visio, sometimes Paint), then print them off. Depending on how intricate I want to make it, I sometimes scan stuff in, or download stuff from the internet.

If I want coloured licence, I copy document onto my pen drive, and use the colour printer at work (and hope I don't get caught!). If it's just b&W, I print it at home.

Last one I made was for my dog. Looks like a British Kennel license, but it's just a fake one. The dog's happy though, as she hasn't seen a real one to compare it to. I'm not intending to show it to anyone to try pass her off a thoroughbred breed, so I think it's ok.

No I'm talking about lfs licenses. Like a when I got a 20 license and 10k $ when I can buy xrg or when I got 1000 license and 100k $ when I buy fxr, understand?
Quote from bananas111 :...understand?

No, but I am losing the will to live, so that probably explains it.
-
(LFSCruise) DELETED by LFSCruise
However, it is unable to do that show the speed?
How to connect the player Throws a welcome window.

I would like the button to accept to appear after only 10 seconds.

How do I do?
Quote from LFSCruise :However, it is unable to do that show the speed?

Hi,
Here just a example for a lasergun for the cops.
Its just a small example. I did not tested it but i think its working.

Type !laser username to check the speed of a driver , if the driver is to far you cant see the speed. (in this example)


CASE "!laser":
IF ( UserInGroup( "Police_O",$userName ) == 1 )
THEN
IF GetPlayerVar( $argv,"CurrNode" ) >= GetCurrentPlayerVar( "CurrNode" )-1 && GetPlayerVar( $argv,"CurrNode" ) <= GetCurrentPlayerVar( "CurrNode" )+1
THEN
privMsg( $argv . " driving " . ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") );
ELSE
privMsg( "To far for Laser gun" );
ENDIF
ENDIF
BREAK;

Quote from LFSCruise :How to connect the player Throws a welcome window.

I would like the button to accept to appear after only 10 seconds.

How do I do?


Event OnConnect() # Player event
$NickName = GetCurrentPlayerVar("NickName");
$Posabs = GetCurrentPlayerVar("Posabs");
$Groupqual = GetCurrentPlayerVar("Groupqual");
openPrivButton( "welc",25,50,150,15,12,-1,0, langEngine("%{main_welc1}%", $NickName ) );
openPrivButton( "pos",25,80,150,10,8,-1,0,langEngine("%{main_welc2}%",$Posabs,$Posqual,$Groupqual ) );
http("[URL]http://www.frh-team.net/reglapper/getserver2.php[/URL]" );
[COLOR=red]DelayedCommand( 10, OSB ); #10 sec delay and jump to OSB[/COLOR]
EndEvent

[COLOR=red]Sub OSB () #Show the buttons[/COLOR]
[COLOR=red]openPrivButton( "clos",78,120,20,10,10,-1,32,langEngine("%{main_accept}%"),OnConnectClose );[/COLOR]
[COLOR=red]openPrivButton( "ref",103,120,20,10,10,-1,32,langEngine("%{main_deny}%"),OnConnectCloseKick );[/COLOR]
[COLOR=red]EndSub[/COLOR]

Sub OnConnectClose( $KeyFlags,$id )
closePrivButton("welc&pos&clos&ref");
IF ( $enable_pitboard == "true" )
THEN
OnConnectClose_Pitboard();
ENDIF
EndSub

Sub OnConnectCloseKick( $KeyFlags,$id )
closePrivButton("welc&pos&clos&ref");
cmdLFS("/kick " . GetCurrentPlayerVar("UserName") );
EndSub

Quote from Tim NL :Hi,
Here just a example for a lasergun for the cops.
Its just a small example. I did not tested it but i think its working.

Type !laser username to check the speed of a driver , if the driver is to far you cant see the speed. (in this example)


CASE "!laser":
IF ( UserInGroup( "Police_O",$userName ) == 1 )
THEN
IF GetPlayerVar( $argv,"CurrNode" ) >= GetCurrentPlayerVar( "CurrNode" )-1 && GetPlayerVar( $argv,"CurrNode" ) <= GetCurrentPlayerVar( "CurrNode" )+1
THEN
privMsg( $argv . " driving " . ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") );
ELSE
privMsg( "To far for Laser gun" );
ENDIF
ENDIF
BREAK;


You probably read what was written previously.
I need that speed to be displayed during openPrivButton.
Quote from Tim NL :

Event OnConnect() # Player event
$NickName = GetCurrentPlayerVar("NickName");
$Posabs = GetCurrentPlayerVar("Posabs");
$Groupqual = GetCurrentPlayerVar("Groupqual");
openPrivButton( "welc",25,50,150,15,12,-1,0, langEngine("%{main_welc1}%", $NickName ) );
openPrivButton( "pos",25,80,150,10,8,-1,0,langEngine("%{main_welc2}%",$Posabs,$Posqual,$Groupqual ) );
http("[URL]http://www.frh-team.net/reglapper/getserver2.php[/URL]" );
[COLOR=red]DelayedCommand( 10, OSB ); #10 sec delay and jump to OSB[/COLOR]
EndEvent

[COLOR=red]Sub OSB () #Show the buttons[/COLOR]
[COLOR=red]openPrivButton( "clos",78,120,20,10,10,-1,32,langEngine("%{main_accept}%"),OnConnectClose );[/COLOR]
[COLOR=red]openPrivButton( "ref",103,120,20,10,10,-1,32,langEngine("%{main_deny}%"),OnConnectCloseKick );[/COLOR]
[COLOR=red]EndSub[/COLOR]

Sub OnConnectClose( $KeyFlags,$id )
closePrivButton("welc&pos&clos&ref");
IF ( $enable_pitboard == "true" )
THEN
OnConnectClose_Pitboard();
ENDIF
EndSub

Sub OnConnectCloseKick( $KeyFlags,$id )
closePrivButton("welc&pos&clos&ref");
cmdLFS("/kick " . GetCurrentPlayerVar("UserName") );
EndSub


Somehow, the button does not appear at all.
I Think That The DelayedCommand not work.

My welcome windows are gui_admin_membership.lpr

Event OnConnect( $userName ) # Player event
$NickName = GetCurrentPlayerVar("NickName");
$Posabs = GetCurrentPlayerVar("PosAbs");
$Groupqual = GetCurrentPlayerVar("GroupQual");

IF ( GetUserStoredNum("MemberType") >= $MEMBERTYPE_AFFILIATE )
THEN
LoginMember($userName);
ELSE
openPrivButton( "welc",25,50,150,15,12,-1,ISB_NONE, langEngine("%{main_welc1}%", $NickName ) );
openPrivButton( "pos",25,80,150,10,8,-1,ISB_NONE,langEngine("%{main_welc2}%",$Posabs,$Posqual,$Groupqual ) );
openPrivButton( "clos",78,120,20,10,10,-1,ISB_DARK,langEngine("%{main_accept}%"),OnConnectClose );
openPrivButton( "ref",103,120,20,10,10,-1,ISB_DARK,langEngine("%{main_deny}%"),OnConnectCloseKick );
ENDIF
EndEvent

But thank you.

FGED GREDG RDFGDR GSFDG