The online racing simulator
Searching in All forums
(24 results)
XRG/T - Scorpio Estate Banger Mod
pepino960
S3 licensed
Hello everyone,

i have also started working on ths Scorpio MK2 Estate as a Banger Racing version.

(Originally made for different Banger Games, lets see how this one goes ahead to LFS Omg omg omg )

i will keep you updated with the process!
pepino960
S3 licensed
Had no Errors in the log file
[Solved] Simple Restriction problem
pepino960
S3 licensed
I've just done a simple restriction code but for some reason it does nothing when "Pinto" or "Zetec" is clicked.

Ive spectated every driver when they join aswell as a test and that does not work aswell.


Event OnMSO( $userName, $text ) # Player event
$idxOfFirtsSpace = indexOf( $text, " ");

IF( $idxOfFirtsSpace == -1 ) THEN
$command = $text;
$argv = "";
ELSE
$command = subStr( $text,0,$idxOfFirtsSpace );
$argv = trim( subStr( $text,$idxOfFirtsSpace ) );
ENDIF

SWITCH( $command )

CASE "!node":
IF ( UserIsAdmin( $userName ) == 1 )
THEN

ENDIF
BREAK;
ENDSWITCH
EndEvent

CatchEvent OnConnect ( $userName )
$userName = GetCurrentPlayerVar("UserName");
openPrivButton( "tws_PLAIN",31,50,148,100,5,-1,96," ");
openPrivButton( "tws_Pinto",46,90,54,15,5,-1,16,"^7Pinto Engine",tws_Pinto);
openPrivButton( "tws_Zetec",110,90,54,15,5,-1,16,"^7Zetec Engine",tws_Zetec);
IF (GetUserStoredValue($userName," register") == 1) THEN
privmsg($userName,"^7Welcome Back!");
ELSE
privmsg($userName,"^7Welcome for the first time on our Server!");
SetUserStoredValue($userName," register", 1);
ENDIF
EndCatchEvent

CatchEvent OnNewPlayerJoin ( $userName )
$userName = GetCurrentPlayerVar("UserName");
cmdLFS("/spec ".$userName); #Test
IF(GetPlayerVar($userName,"Car") == XRT) THEN
IF (GetUserStoredValue($userName," XRT_Pinto") == 1) THEN
IF(GetPlayerVar($userName,"P_Tres") == 25) THEN
privmsg($userName,"you successfully entered the Track with Pinto powered XRT!);
ELSE
privmsg($userName,"To Enter the Track please use 25% of Air Restriction for the Pinto Engine!");
cmdLFS("/spec ".$userName);
ENDIF
ELSE
IF (GetUserStoredValue($userName," XRT_Zetec") == 1) THEN
IF(GetPlayerVar($userName,"P_Tres") == 23) THEN
privmsg($userName,"you successfully entered the Track with Zetec powered XRT!);
ELSE
privmsg($userName,"To Enter the Track please use 23% of Air Restriction and 150kg Mass weight for the Zetec Engine!");
cmdLFS("/spec ".$userName);
ENDIF
ENDIF
ENDIF
ELSE
cmdLFS("/spec ".$userName);
ENDIF
EndCatchEvent

Sub Money( $KeyFlags )
$userName = GetCurrentPlayerVar("UserName");
closePrivButton( "MoneyD&MoneyD1");
openPrivButton( "MoneyD",110,10,20,5,5,-1,16,"^3Money Balance :");
openPrivButton( "MoneyD1",132,10,20,5,5,-1,16,"^3£ ".GetUserStoredValue($userName," Money"));
EndSub

Sub tws_Zetec( $KeyFlags )
$userName = GetCurrentPlayerVar("UserName");
closePrivButton( "tws_Pinto&tws_Zetec&tws_PLAIN");
SetUserStoredValue($userName," XRT_Zetec", 1);
SetUserStoredValue($userName," XRT_Pinto", 0);
EndSub

Sub tws_Pinto( $KeyFlags )
$userName = GetCurrentPlayerVar("UserName");
closePrivButton( "tws_Pinto&tws_Zetec&tws_PLAIN");
SetUserStoredValue($userName," XRT_Zetec", 0);
SetUserStoredValue($userName," XRT_Pinto", 1);
EndSub

pepino960
S3 licensed
So its finally working!Smile

To explain:
So basically you can buy up to 5 cars each car (XRT,XFG etc) and have to Select one you want to use.
When you bought a Car (different Horsepower available), the HP will be set to " 1XRT".
The Car will be set to the next available Spot. (One_SXRT to Fifth_SXRT)

" One_SXRT" = One is for the first Spot, the "S" in the "SXRT" is for "Current Selected Car" 1 = True; 0 = False
" 1XRT" = XRT on the first Spot, Set with the Horsepower (depends on what you bought)


This code should work to all Restrictions in Percent for the XRT only!
(247 - 186) / 2.874 =
21,22478
=21 % Restriction for 186HP
. ToNum( Round( ((247 - GetUserStoredValue($userName," 1XRT")) / 2.874 ),0 ) ) );

However heres the code:

CatchEvent OnNewPlayerJoin ( $userName )
IF(GetPlayerVar($userName,"Car") == XRT) THEN
IF (GetUserStoredValue($userName," One_SXRT") == 1) THEN
IF(GetPlayerVar($userName,"P_Tres") == ToNum( Round( ((247 - GetUserStoredValue($userName," 1XRT")) / 2.874 ),0 ) ) ) THEN
privmsg($userName,"you entered the Track with a XRT ".GetUserStoredValue($userName," 1XRT"));
ELSE
privmsg($userName,"To Enter the Track use " . ToNum( Round( ((247 - GetUserStoredValue($userName," 1XRT")) / 2.874 ),0 ) ));
privmsg($userName,"% of Restriction. Current HP of your Car selected: " . GetUserStoredValue($userName," 1XRT"));
cmdLFS("/spec ".$userName);
ENDIF
ENDIF
EndCatchEvent

Last edited by pepino960, .
pepino960
S3 licensed
He was getting the " XRT1" value without problems :/

ive tried it yesterday without the Round function and it showed me perfectlySmile



yet round() gives an error, even on this code:

Privmsg ("^7DEBUG: " . ToNum( Round( (247 - GetUserStoredValue($userName," 1XRT") / 2.86 ),0 ) ) );



EDIT: Nope, my problem typed !Test instead of !test Thumbs up

anyways ill get on coding and see what happensSmile

cheers alot Yisc
pepino960
S3 licensed
nope, thats exactly what ive tried after your posted it Frown
pepino960
S3 licensed
Incorrect args number in function Round

yet the same
pepino960
S3 licensed
so yes ive had a "s" to much in P_Tres.

so heres the 2. Problem i have had.

This Basically works but is not rounded

CatchEvent OnNewPlayerJoin ( $userName )
$userName = GetCurrentPlayerVar("UserName");
IF(GetPlayerVar($userName,"Car") == XRT) THEN
IF(GetPlayerVar($userName,"P_Tres") == 247 - GetUserStoredValue($userName," 1XRT") / 2.86 ) THEN
privmsg($userName,"Good Boy 1");
ELSE
privmsg($userName,"Bad Boy 2");
ENDIF
ENDIF
EndCatchEvent

Ive tried to round it, but got this error:

Incorrect args number in function round

CatchEvent OnNewPlayerJoin ( $userName )
$userName = GetCurrentPlayerVar("UserName");
IF(GetPlayerVar($userName,"Car") == XRT) THEN
IF(GetPlayerVar($userName,"P_Tres") == 247 - round(GetUserStoredValue($userName," 1XRT") / 2.86 )) THEN
privmsg($userName,"Good Boy 1");
ELSE
privmsg($userName,"Bad Boy 2");
ENDIF
ENDIF
EndCatchEvent

to explain:

You can basically buy 5 different XFGS with different HP and Select between them 5 to set as the "Current Car"

and the Value is set with the Horsepower the car has got to weve got to calculate the % in Restriction.
[Solved] Restriction P_Tress Check
pepino960
S3 licensed
Hello, yesterday me and "Dan Taco" have put a code together that calculates the P_Tress in % from your current Horsepower like 104 hp .

P_Tress = (247HP - "Wanted HP") / 2,86

for example
P_Tress = (247HP - 104HP) / 2,86
P_Tress = 50

Anyways my Main Problem is, that P_Tress does not work at all.

On the following code i will get the Message "Bad Boy 2" all the time, no matter what i do.
I have even deleted the whole Restriction code from LFSLapper.lpr while it was disabled with a # infront of every row.
any help would be very appreciated.

CatchEvent OnNewPlayerJoin ( $userName )
IF(GetPlayerVar($userName,"P_Tress") >= 20) THEN
privmsg($userName,"Good Boy 1");
ELSE
privmsg($userName,"Bad Boy 2");
ENDIF
EndCatchEvent

ThanksSmile
pepino960
S3 licensed
sinanju

$Var["value"] is the same as $userName
but the $Var["value"] only gets used at Loops.

well so i have got explained it.
pepino960
S3 licensed
Right found it out myself, getting proud of meBig grin

SetStoredValue( $Var["value"] . " National", GetStoredValue( $Var["value"] . " National" ) + GetPlayerVar( $Var["value"] ,"National1"));

to explain, it is a points system.
it gets the Points from the StoredValue, and adds the Points you gained from the current "Race" to it when its finnished. Will be on StoredValue later tooSmile

but thanksSmile i seem to be a bit drunk yesterday lol
[Solved]Incorrect number of parameter in command
pepino960
S3 licensed
i cannot see what is wrong here Frown there is only username,national1 now why is the number of parameters incorrect?

3/14/2017 11:07:32 PM -> Syntax error in cfg file "./race.lpr" at line #148
Command 'GetCurrentPlayerVar' incorrect number of parameter
Function 'loop2' script aborted

SetStoredValue( $Var["value"] . " National", + GetCurrentPlayerVar( $["value"],"National1" ) );

thanks if anyone could help againSmile
Last edited by Bass-Driver, .
pepino960
S3 licensed
ah yeah sure erm

ive wrote that when you click the button, it opens the Sub br_Fixtures instead of br_Fixture_Left (the left arrow)

example we are on the side Fixtures2 and with the left arrow we are going to Fixtures(1) and with the right arrow we are going to the side Fixtures3 instead of making another Sub, saves space.

openPrivButton( "br_Left2",88,165,13,13,6,-1,0,"^7^l",br_Fixtures);

openPrivButton( "br_Right2",98,165,13,13,6,-1,0,"^7^r",br_Fixtures3);
pepino960
S3 licensed
Its sorted ! thank you guysSmile
pepino960
S3 licensed
openPrivButton( "br_fixture_leftt",60,165,70,13,5,-1,0,"^7^l",br_fixture_leftt);

Sub br_fixture_leftt( $KeyFlags,$id )
closePrivButton( "br_text2&br_fixture_right&br_fixture_left2&br_fixture_Head&br_1fixture&br_fixture_right2&br_1fixture2");
br_Fixtures( $KeyFlags,$id );
EndSub

right a another problem... th openPrivButton above is ona Sub and works, but the Sub br_fixture_leftt does nothing. Why dont it close any buttons or open the br_Fixtures?

and openPricButton("br_fixture_right" etc etc it does!
pepino960
S3 licensed
what a little mistake could do!
wrote yesterday to much, i couldnt find it but i was sure it was on one of the 2 sub's.

Thank you alot sinanju!
[Solved] Help with opening a Sub callback
pepino960
S3 licensed
Hello its me again, PepinoSmile

i am getting stupid atm erm, i cannot open a Sub with "br_Fixtures( $KeyFlags,$id )"?
used it at Sub br_fixture_right( $KeyFlags,$id ) do i wrote it wrong or is it completely incorrect ?
Thanks againSmile

Sub br_Fixtures( $KeyFlags,$id )
closePrivButton( "br_fixture_Head&br_fixture_right&br_1fixture&br_fixture_left2&br_fixture_right2&br_1fixture2");
openPrivButton( "br_fixture_Head",65,46,70,13,5,-1,0,"^0Fixture List - Season 2017");
openPrivButton( "br_fixture_right",70,165,70,13,5,-1,0,"^7^r",br_fixture_right);
openPrivButton( "br_1fixture",58,62,100,5,6,-1,68,"^0Test1%nl%Test2");
EndSub

Sub br_fixture_right( $KeyFlags,$id )
closePrivButton( "br_fixture_Head&br_fixture_right&br_1fixture&br_fixture_left2&br_fixture_right2&br_1fixture2");
openPrivButton( "br_fixture_left2",60,165,70,13,5,-1,0,"^7^l",br_fixture_left2);
openPrivButton( "br_fixture_right2",70,165,70,13,5,-1,0,"^7^r",br_fixture_right2);
openPrivButton( "br_1fixture2",58,62,100,5,6,-1,68,"^0Test3%nl%test4");
br_Fixtures( $KeyFlags,$id )
EndSub
Last edited by Bass-Driver, .
pepino960
S3 licensed
Oh ahhhh
My fault sorrySmile
Thanks again !
pepino960
S3 licensed
cmdLFS("/spec " . GetCurrentPlayerVar("NickName") );

so basically here something went wrong
Overspeed on Rolling Lap
pepino960
S3 licensed
Hello,

ive got a Script with the Help of Bass-Driver Smile and it workes fine, until i have noticed that who ever is going to speed over 30 MPH, i am getting spectated.

basically it should spectate the Player that overspeeds.


Heres the Whole ScriptSmile
CatchEvent OnMSO( $userName, $text ) # Player event

$idxOfFirtsSpace = indexOf( $text, " ");
IF( $idxOfFirtsSpace == -1 ) THEN
$command = $text;
$argv = "";
ELSE
$command = subStr( $text,0,$idxOfFirtsSpace );
$argv = trim( subStr( $text,$idxOfFirtsSpace ) );
ENDIF

SWITCH( $command )

CASE "!run":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
Safetycar_gui( $KeyFlags );

ELSE
privMsg(langEngine( "%{main_notadmin}%" ));
ENDIF
BREAK;
CASE "!race":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
SetCurrentPlayerVar("StartLoop",0);
Loop($KeyFlags);
cmdLFS ("/msg ^2GREEN GREEN GREEN!!!");
cmdLFS ("/msg ^2GREEN GREEN GREEN!!!");
cmdLFS ("/msg ^2GREEN GREEN GREEN!!!");
cmdLFS ("/msg ^2GREEN GREEN GREEN!!!");
ELSE
privMsg(langEngine( "%{main_notadmin}%" ));
ENDIF
BREAK;
ENDSWITCH
EndCatchEvent

Sub Safetycar_gui( $KeyFlags )
IF ($safetycar_status == "lu")
THEN
openPrivButton( "sc_lu",70,1,10,5,5,-1,16,"^1LINE UP",SC_LU);
ELSE
openPrivButton( "sc_lu",70,1,10,5,5,-1,16,"^7LINE UP",SC_LU);
ENDIF

IF ($safetycar_status == "ht")
THEN
openPrivButton( "sc_ht",80,1,10,5,5,-1,16,"^1HEAT",SC_HT);
ELSE
openPrivButton( "sc_ht",80,1,10,5,5,-1,16,"^7HEAT",SC_HT);
ENDIF

IF ($safetycar_status == "fl")
THEN
openPrivButton( "sc_fl",90,1,10,5,5,-1,16,"^1FINAL",SC_FL);
ELSE
openPrivButton( "sc_fl",90,1,10,5,5,-1,16,"^7FINAL",SC_FL);
ENDIF

openPrivButton( "close_sc",100,1,10,5,5,-1,16,"^7Close",Close_SC);
EndSub

Sub SC_LU( $KeyFlags,$id )
$safetycar_status="lu";
cmdLFS ("/zero_all");
cmdLFS ("/rcm ^7PLEASE LINE UP FOLLOWING YOUR GRADES");
cmdLFS ("/rcm_all");
privMsg(langEngine( "^7 Line Up has been started." ));
Safetycar_gui( $KeyFlags );
EndSub

Sub SC_HT( $KeyFlags,$id )
$safetycar_status="ht";
SetCurrentPlayerVar("StartLoop",1);
Loop($KeyFlags);
cmdLFS ("/zero_all");
cmdLFS ("/laps=10");
cmdLFS ("/rcm ^7FRONT ROW ROLL AT 25 MPH PLEASE");
cmdLFS ("/rcm_all");
privMsg(langEngine( "^7 Heat has been setup and started." ));
Safetycar_gui( $KeyFlags );
EndSub

Sub SC_FL( $KeyFlags,$id )
$safetycar_status="fl";
cmdLFS ("/zero_all");
cmdLFS ("/laps=15");
cmdLFS ("/rcm ^7FRONT ROW ROLL AT 25 MPH PLEASE");
cmdLFS ("/rcm_all");
privMsg(langEngine( "^7 Final has been setup and started." ));
Safetycar_gui( $KeyFlags );
EndSub

Sub Close_SC( $KeyFlags,$id )
closePrivButton( "sc_ht&sc_fl&sc_lu&close_sc");
EndSub

Sub Loop($KeyFlags)
IF (GetCurrentPlayerVar("StartLoop") == 1) THEN
$Dr = getListOfPlayers("U"); #get List of drivers
FOREACH( $Var IN $Dr )
$Speed = GetPlayerVar($Var["value"],"InstantSpeed");
IF ($Speed > 52) THEN #Check speed in km/h
cmdLFS("/spec " . GetCurrentPlayerVar("NickName") );
ENDIF
ENDFOREACH
PrivDelayedCommand( 1, Loop ); # 1 Second Loop
ELSE
removeprivdelayedcommand(Loop); #Stop loop
ENDIF
EndSub

i hope anyone can figure it out, thanksSmile
[Solved] Create Textfile messages
pepino960
S3 licensed
Hello i Am new to the scripting so please do not worry:-)

erm my question ist how do i add a texfile and send as a message

Having these both

privMsg(langEngine( "%{main_whitegrades}%" ));

and

$GradesUsers = "&./your_grades.txt";

ive been doing it by the "main_whitegrades" but now i want to do it by a text document because i need to edit it every meeting we do so taht would be easier jsut i do not know how.

btw do i need to define $GradesUsers somewhere?

Thank you:-)
Last edited by Bass-Driver, .
pepino960
S3 licensed
I found the problem now, its because ive had a layout on so it wont work when you put some objects on..

Yeah i will try it, thanks Yisc
Airio 2.5.8 Free Restirction/Intake problems
pepino960
S3 licensed
Hello guys,

Ive just bought a Server and the Airio 2.5.8 Free version for it to run our League
The Insim is very important due to we have XRT's Restricted to 160hp.


# Values for this type of car on all tracks
Car=XRT

# Defines required intake air restriction
IntakeRestriction=30

# Defines required added mass
AddedMass=0

# Defines percents to add to default required time
TimeAdjustment=0

It works fine, everything is okay but then after about 10-20 Minutes is does to react anymore.
You can join in with 0% Restricted and he does nothing.
Sometimes when i reload the Track or choose a different one is works again, but just sometimes..
Often it does not.
What could that be? Is it because of the Free version that it disapears after a limited Time?

I really need it for running the League and we would like to start as soon as possible.
Any help be greatfull

Best regards
(Request/Help) Laps
pepino960
S3 licensed
Hello Guys,


I have got no experience in Scripting LFS,
but i Need a Script that will give a message after every 12 Laps something like "The Race is end, please go to Pits now" so i musnt restart the race.
That means i will set the Laps to about 100 and after every 12 Laps (12 24 36 48 etc) is will say "The Race is end, please go to Pits now" so the cars will still have their Damage (we are doing a Stock Car League..)


Thanks,
Pepino960








(Some Thing like "5 lap to go etc etc)
FGED GREDG RDFGDR GSFDG