The online racing simulator
Searching in All forums
(879 results)
Bass-Driver
S3 licensed
Well i'v fixed it yaay

I did the Short to 2 Bytes conversion wrong.

Was

<?php 
//Convert Short X into 2 bytes
packet[8] = (byte)(>> 8); //Shift by 8 bits
packet[9] = (byte)(255);
//Convert Short Y into 2 bytes
packet[10] = (byte)(>> 8); //Shift by 8 bits
packet[11] = (byte)(255);
?>

is now

<?php 
//Convert Short X into 2 bytes
packet[8] = (byte)((16) & 255);
packet[9] = (byte)((16) >> 8); //Shift by 8 bits
//Convert Short Y into 2 bytes
packet[10] = (byte)((16) & 255); 
packet[11] = (byte)((16) >> 8); //Shift by 8 bits
?>

Infosource: http://stackoverflow.com/quest ... t-between-short-and-bytes

So when i want to X= -95 and Y= 157 , i multiply it with 16 and tada it works.

Now that works, lets play further with this packet.

@Cargame:Thank you for helping
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Sending a 1 for X-axis or Y-Axis = 16 ingame. So 2 is 32 etc.

So i thought to change the code with dividing the sending X/Y axis values by 16, gives me the next result.


<?php 
//Convert Short X into 2 bytes
packet[8] = (byte)((>> 8)/16); //Divide by 16
packet[9] = (byte)((255)/16); //Divide by 16
//Convert Short Y into 2 bytes
packet[10] = (byte)((>> 8)/16); //Divide by 16
packet[11] = (byte)((255)/16); //Divide by 16
?>

Sending 0 to 15 for X/Y axis displays 0 for X/Y ingame. But sending 16 displays 16 ingame ( which is good right), but sending 17 - 31 Displays still 16 ingame.


Input X/Y Axis >> Output

0-15 >> 0
16 >> 16
17-31 >> 16
32 >> 32
33-47 >> 32
48 >> 48
etc

The heading packet (packet[15]) seems to work fine.

I have a question about the ZByte Packet (Packet[12]). When i send ZByte = 4 i should spawn in the air?( i know, i will fall down to the track). Because the Height of the spawnplace is 2. But i get spawned on the track. Does it work this way or is this also wrong?
Bass-Driver
S3 licensed
I know i'm a bit to late with adding the JRR packet.
Its just because the head developers: Gai-Luron and Krayy stop theire development of LFSLapper. So i thought to update the LFSLapper library with adding new insimpacket(as a noob programmer). I've managed to add 4 new insimpackets with succes and now i'm trying to add the JRR packet.

I red those posts yesterday , i'v used the search option on this forum and searched for "JRR". But non of those posts could help me.

So that why to asked for help.
Anyway,Thank you to give me those links. Could be handy for the future.
Bass-Driver
S3 licensed
Update:

It doesnt go well and i might need help from a another programmer.

Let me explain.

It doesnt spawn my car to the right position, after sending the position where i want to get spawned.
I send my position to LFS with the following script:


<?php 
$X_Axis 
1;      #X axis SpawnPoint 
$Y_Axis 1;      #Y axis SpawnPoint
$Z_Axis 0;      #Z axis SpawnPoint
$Flags 128;      #Move car (128) else (0)
$Heading 30;  #Heading of the players car at Spawnpoint
$UCID 0;       #Connection's unique id (0 = host)
$PLID getcurrentplayervar("PLID");  #Player's unique id
$JRRAction 5;  #Type of action. Reset without repair
            
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$Heading $UCID $PLID ,$JRRAction); #Send Data to LFS
?>

This function will be executed in the sourcecode of LFSLapper

<?php 
public void joinrequest(GLScript.unionVal valArrayList args)
{
//short X, short Y, byte Zbyte, byte Flags, byte Heading, byte UCID, byte PLID, byte JRRAction
byte[] jrr myEncoder.JRR(short.Parse(args[0].ToString()), short.Parse(args[1].ToString()), byte.Parse(args[2].ToString()), byte.Parse(args[3].ToString()), byte.Parse(args[4].ToString()), byte.Parse(args[5].ToString()), byte.Parse(args[6].ToString()), byte.Parse(args[7].ToString()));
insimConnection.Send(jrrjrr.Length);
}
?>

This code send the data to the JRR packet:


<?php 
public byte[] JRR(short Xshort Ybyte Zbytebyte Flagsbyte Headingbyte UCIDbyte PLIDbyte JRRAction//Join Request Reply - send one of these back to LFS in response to a join request
        
{
            
byte[] packet = new byte[16];
            
packet[0] = 16;
            
packet[1] = (byte)TypePack.ISP_JRR;
            
packet[2] = 0;                  
            
packet[3] = PLID;               //Player's unique id (if zero, use UCID) // ZERO when this is a reply to a join request - SET to move a car
            
packet[4] = UCID;               //Connection's unique id (0 = host) // set when this is a reply to a join request - ignored when moving a car
            
packet[5] = JRRAction;          //JRR Action
            
packet[6] = 0;                  //Spare
            
packet[7] = 0;                  //Spare

            //Convert Short X into 2 bytes
            
packet[8] = (byte)(>> 8);
            
packet[9] = (byte)(255);
            
//Convert Short Y into 2 bytes
            
packet[10] = (byte)(>> 8);
            
packet[11] = (byte)(255);

            
packet[12] = Zbyte;             //Z Pos
            
packet[13] = Flags;             //Flags
            
packet[14] = 0;                 //Index
            
packet[15] = Heading;           //Heading

            //DebugMessages to see data for each packet (Console)

            
for (int i 016i++)
            {
                
Console.WriteLine("Packet: "" = " +  packet[i]);
            }
            return 
packet// send packet to lfs
        
}
?>

LFSLapper send this packet to LFS

In the console it looks like this:

https://www.lfs.net/attachment/145870

And when i get spawned, i type a command to see my current position

https://www.lfs.net/attachment/145873


Things i did to attempt fixing it:

-X/Y axis divide by 16 ( didnt work)
-Other bit-converters (Short > 2 Bytes) ( Didnt work)

So i hope someone can help me.
LFSLapper Adding ISP_JRR (Join Request Reply) InsimPacket
Bass-Driver
S3 licensed
Hi everyone,

Today i started with implementing a new Insimpacket for LFSLapper.
The Packet i try to implement is the JRR (Join Request Reply) insimpacket.

With this packet you can allow or refuse a join request from a player ( Player is allowed or not allowed tojoin the race). Also with this packet you can Spawn the players car to a differend location or you can reset theire car without repairing the damage.

The following Command/Function that you might use after releasing the first testversion of LFSLapper, should look like this.


<?php 
CASE "!jrr":
            
$X_Axis 0;  #X axis SpawnPoint
$Y_Axis 0;  #Y axis SpawnPoint
$Z_Axis 0;  #Z axis SpawnPoint
$Flags 128;  #Move car (128) else (0)
$Heading 0;  #Heading of the players car at Spawnpoint
$UCID 0;   #Connection's unique id (0 = host)
$PLID getcurrentplayervar("PLID");  #Player's unique id
$JRRAction 5;  #Type of action.
            
joinrequest($X_Axis $Y_Axis $Z_Axis $Flags ,$Heading $UCID $PLID ,$JRRAction); #Send Data to LFS

BREAK;
?>

After alot of struggling with getting data from LFS , i managed to get move my car to differend location.
I hope that the rest of the test goes well without to many errors.

UPDATE: Released testversion: 7.0.4.2 (see post 10 for changelog)




Have a nice day

Bass-Driver([DanTaco])
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Do you mean: moving/adding AutoX (autocross) objects by LFSLapper?

This isnt implemented in LFSLapper yet. This will take alot of time to implement.

I might release a new small version someday. with the following changes:

########################################################
Fixed Typo's & Changing Pitworks in sourcefile Insim4.cs ( Thanks to Iceman121 for reporting the typo's and idea's)

-Mechanicals Damages >> Mechanical Damage
-Body Dammage >> Minor Damage
Major Damage

-Refuel >> Refuelling
-Wheels & Transmissions >> Wheels
########################################################
Characterlenght increased to 120 chars instead of 67 for the following functions:
Privmsg()
GlobalMsg()
########################################################
Sourcecode bugfix: in GLScript.cs ( Thanks to Yisc[NL] for reporting the bug)
Link of report: https://www.lfs.net/forum/post/1906238#post1906238
########################################################
Sourcecode bugfix (CSC) (CarState Packet) implemented in version 7.0.4.1
LFSLapper crashed after getting player without a username (HOST)
########################################################
Minor bugfixes in LFSLapper.lpr ( Thanks to Yisc[NL] for reporting the bug)
Link of report: https://www.lfs.net/forum/post/1906123#post1906123

Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Oke after long searching i finally fixed it:

Stereoscopic 3D option was enabled in the Nvidia control panel.
Weird screencolor+message after starting LFS
Bass-Driver
S3 licensed
Hello,

After starting LFS i get weird color and message. Does anyone of you what this means and how i can get rid of it?

It happends when i restarted my computer today, after a (forced) windows 10 update.
I thought it was caused by Geforce Experience application, but its not.

Specs:

Intel 3930K 3.2 Ghz
Nvidia Geforce GTX680
16MB Ram.

Edit: it looks like it has been set to 3d mode somehow.
I've checked the LFS Settings and they are not set to 3d mode.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
There is not a Quick button coordinator.
You have to code it by yourself.
Here is a link about how to create buttons: How to create buttons in LFSLapper by Sinanju

And this question is not related to this topic.
Bass-Driver
S3 licensed
Quote from developer346 :How do I find the coordinates faster

Is this question related to this topic subject?
If so : Could you explain your question?


Minigame Update:

-Displays Guessed letters.
-Draw hanging squidward peace by peace after every wrong guess.

Things todo:
-Homewindow to set Guessed Word/Hints/category
-Button to guess the word.
-Timer
-Player/Spectator
-Set strings that contains spaces.
-Show several vars like: Wrong Guesses left/Length of word/Category/Hints etc
-Multiplayer option
Last edited by Bass-Driver, .
[LFSLapper] Minigame (Hangman)
Bass-Driver
S3 licensed
Hi everyone,

I got bored in LFS so i deciced to create something in LFSLapper.
My idea was to create a minigame named HangMan.

it is far from complete.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
It is not possible to get Vehicle speed with this event.


You can get your vehicle speed with:

GetCurrentPlayerVar( "InstantSpeed" );

To get your speed with a command.

CASE "!myspeed":
privmsg("My speed: ".GetCurrentPlayerVar( "InstantSpeed" ). " km/h");
BREAK;

Bass-Driver
S3 licensed
oke

but is it possible to change the "User is kicked" to "User is kicked because..........." Or a Joos-Car error
Bass-Driver
S3 licensed
After enabling the message log, and updating the insim logfile system. I've got a few kick reports in the kicklogfile.
By checking the time/date in the lfs message logfile, i have found the following lines.

May 13 15:47:52 HoraDoShowPorra^L connected (105DaLeste)
May 13 15:48:00 HoraDoShowPorra^L left the pits (XRG)
May 13 15:48:30 HoraDoShowPorra^L pitted
May 13 15:48:32 HoraDoShowPorra^L left the pits (XRG)
May 13 15:48:32 Modified car - guest disconnected
May 13 15:48:33 Leave @ 1136527 : HoraDoShowPorra
May 13 15:48:33 HoraDoShowPorra^L was kicked (105DaLeste) <<< This is what other guests/admin sees in the server.

Bass-Driver
S3 licensed
..

Quote from Scawen :If you really want an answer, it would be better to explain exactly what the problem is, what program you are using, what you tried to do, how you tested it, what went wrong, what error messages were displayed.

It's really impossible for anyone to help if you give so little information.

Bass-Driver
S3 licensed
Today it happends again. And there is one thing that is the same before the user get kicked from the server.
What i think it has something todo with tweak.

Because as you can see in my post #78

The user goes to the garage 2 times and get kicked after joining the track.
I have tried find the user and it has joined a tweakserver.

After 5 min i checked again and he's still in that server.

So it might be a sort of tweak/hack protection, if you do not have a modified server.

Is this is true. It whould be nice if LFS sends a message to the server. That this user is kicked for using hacks/tweaks.
Bass-Driver
S3 licensed
I havent set the "message log file" and i do not have any Server logfiles to show.

Currently i'm working on a logfile system that registered every kick/ban etc. But it is not fully functional yet.
Otherwise i could give you the following info: User/date/time.
Bass-Driver
S3 licensed
I'm sure it is not caused by a admin (typed or kickbutton) or by insim.

The strangest thing is , the players always get kicked when they join the race.

But when you say, that they get kicked when joining a another server. it could be possible that they run "LFSLazy" insim.
Serverlist picture
Bass-Driver
S3 licensed
Quote from Scawen :It may be a good time to consider this. Probably due to being busy on a lot of other things recently, I am not really aware of this issue. Can you explain why it is happening? Sorry for missing any previous explanations, but I'm listening now.

Please can you look at these possibilities, and tell me which one you think is more of a concern, and if there is another case I have not thought of?

1) Obviously it happens when a modified guest joins a non-modified host, and I have not regarded this as a big problem. I suppose in this case it would be nice if there was a more useful message to the guest, suggesting they join with an unmodified version of LFS?

2) And there is the other case when an unmodified guest (could be a new player) joins a modified host. In this case, the host should be private so this does not happen. It is of course very bad if modified hosts are publicly visible and I would have to do something about it.

It's not really easy to distinguish between these two cases but I could think a bit about it.

I'm not sure is this has anything todo with the things above.

Some players in my demoserver (not modified) getting kicked from the server when leaving the pitbox. Is this a sort of cheat/hack protection?.

Dedicated Server: Version N.
Insim on Server: (yes) (LFSLapper)
Bass-Driver
S3 licensed
What i think what he means is:

He wants a script: When you change your nickname, and the new Nickname contains a [COP] Tag. That you send a cmdLFS("/cansiren " .$Username. " 1"); command
Bass-Driver
S3 licensed
From what i understand from Google Translator, is that it cannot find a file.


In the attachment contains 3 files.
Copy/Paste those 3 files in the 'Bin' folder. LFSLapper V7.0.4.0\bin

Try this and see if it helps.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Thanks Yisc[NL],
Never thought that something small like this could cause headaches.

Also i learning something new. Using dumpvar();
Bass-Driver
S3 licensed
hi, i have a weird issue with getting data from the array's.
I have convert some Var's with ToNum(). But somehow it doesnt save/get the data from the previous Var from the array i've set.

Has it something todo with the For - EndFor loop?? Because the previous projects with array works flawless.

Here is a example of the code.



<?php 
CatchEvent OnLapperStart
()
    
GlobalVar $Rule#Have Set $Rule[1] - $Rule[16]
    
GlobalVar $CloseServerRulesOne#ButtonRow 1
    
GlobalVar $CloseServerRulesTwo#ButtonRow 2
    
    
$CloseServerRulesOne "&Close";
    
$CloseServerRulesTwo "&Close";
EndCatchEvent

Sub SetServerRules
($keyflags,$id)
    
$AP_HT 52#Local Var
    
closeadminpanelother2(); #A close function
    
openPrivButton"ServerRulesChangeTitle",70,$AP_HT+10,60,4,4,-1,96"^2blablahblah %nl%^2WAAAW new line blablabnla!");
    FOR(
$i=1;$i<17;$i=$i+1)
        
openPrivButton"ServerRule_".$i,70,$AP_HT+18,55,4,5,-1,96"^3".$i.". ".$Rule[ToNum($i)]); #Line of rule
        
openPrivTextButton"ServerRuleSet_".$i,125,$AP_HT+18,5,4,5,16"^3Set ServerRule","^0Set",60,ServerRuleSet); #Set button
        
$AP_HT=$AP_HT+4#Buttonheight + 4

        #closing vars
        
$CloseServerRulesOne $CloseServerRulesOne "&ServerRule_".$i;
        
$CloseServerRulesTwo $CloseServerRulesTwo "&ServerRuleSet_".$i;
        
    ENDFOR
    
openPrivButton"ServerRulesClose",70,$AP_HT+19,60,5,5,-1,16"^3OK",AdminPanelOther2); #This doesnt work if you copy this code hahah
EndSub

Sub ServerRuleSet
$id$argv )
    
$Rule[ToNum(trim(subStr$id,14 )))] = $argv#ToNum(trim(subStr( $id,14 ))) = trim first 14 chars and convert it to ToNum()
    
SetServerRules(0,0);
EndSub
?>


I know it is something easy, but i cannot find it. LOL
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
You could use the next option ( just an example)

Event OnLapperStart()
#Syntax: ss mm hh dayofweek dd MM YYYY
RegisterScheduleAction( "0 * * * * * *", Timer_Sub ); #Timer each minute
EndEvent

Sub Timer_Sub()
$Players = GetListOfPlayers(); #Get list of all players in the server
FOREACH ($User IN $Players) #Check each player one by one.
setUserStoredValue($User["value"], "Cash", GetPlayerVar($User["value"],"Cash")); #Store Cash to database
ENDFOREACH
EndSub

Bass-Driver
S3 licensed
There is a file in post 9. With an example how to use the code.
https://www.lfs.net/forum/post/1904406#post1904406

To use that code, you must use the AutoX startlights. Which you cant because you are a Demoracer.

If you want to add/use those lights you must buy a s1/s2/s3 license.
Last edited by Bass-Driver, . Reason : typo
FGED GREDG RDFGDR GSFDG