The online racing simulator
Release : LFSLapper V7.0.4.5
Hello Lapperusers.

I present to you a new version of LFSLapper.

LFSLapper version : 7.0.4.5

This version contains new Lapperfunctions and 1 new event that need to be tested.

+-------------------------------+
|Changes from 7.0.4.4 to 7.0.4.5|
+-------------------------------+
=================================================
New:
=================================================


01 - New Function: Add/Remove Objects

It is possible to add/remove objects up to 30 objects at once

Check the Objectslist.txt in the attachments for the objectslist
Type = Type of object

$Object_One = "19:-654:3:208:175:64"; #X:Y:Z:Flag:Type:Heading
$Object_Two = "20:-654:3:208:175:64"; #X:Y:Z:Flag:Type:Heading

addobject($Object_One,$Object_Two);
removeobject($Object_One,$Object_Two);

If one of the parameters of the object is incorrect, function will abort its action.
In the errorfiles you can see which object is incorrect.



02 - New Function: Distance Measurement between Player <> Player / Player <> Object / Object <> Object

trackuserdistance();

With this function you can display the distance between 2 players or between a other location and a player.
See some examples below.
$TheLocation = "-150:26"; #Var must be a string > "", and X and Y axis must be seperated by a ':'
trackuserdistance($userName,$userName);
trackuserdistance($TheLocation,$userName);
trackuserdistance($userName,$TheLocation);
trackuserdistance($TheLocation,$TheLocation);
trackuserdistance("-150:26","-150:26"); #(X:Y,x:y)

03 - New Event : Get info about the objects you add/removed by autocross editor


$DisplayObjectInfo = -1; #Set -1 to disable this event
Event OnObjectInfo($userName,$NumO,$Action,$X,$Y,$Z,$Flags,$Type,$InDex,$Heading) # Player event
privmsg("^7LayoutAction: ^8".$Action);
privmsg("^7Number of Objects: ^8".$NumO);
privmsg("^7X/Y/Z: ^8".$X."/".$Y."/".$Z);
privmsg("^7Index & Type of Object ^8".$InDex."/".$Type);
privmsg("^7ObjectFlag ^8".$Flags);
privmsg("^7Heading of Object ^8".$Heading);
EndEvent

Feedback whould be nice


NOTE: Since Version 7.0.4.4 contains changes for the RegisterNodeAction() & RegisterNodeAction() Sub Callbacks
==========================================================

<?php 
RegisterNodeAction
TESTIDgetLapperVar"ShortTrackName" ) , getCurrentPlayerVar("CurrNode") , test,"" );

Sub test($UserName,$ZoneID)
    
privmsg("ID=".$ZoneID); #output is TESTID
EndSub 
?>


==========================================================


Have fun.
Attached files
ObjectsList.txt - 6.8 KB - 315 views
LFSLapper V7.0.4.5.rar - 2.2 MB - 451 views
$Y = X-Axis position of object

I think that should be Y-axis position of object Wink
Well you are right.
Copy-Paste error LOL
Update : New Lapperfunction (still work in progress)

Track distance between users or objects.

Example of function:

<?php 
==================================================
#Track distance between players.
TrackUserDistance($userName,$userName);

#Track distance between objects or object<>player

$CarShop "-465:234" #(X | Y)
TrackUserDistance($CarShop,$userName);

#Lets say the distance between the player and the carshop is 10 meters

privmsg("Distance between you and the carshop:" .TrackUserDistance($CarShop,$userName). " meters");

outputDistance between you and the carshop10 meters
==================================================
?>

Todo list:
  • -Detection between object/username
  • -Args detection , Function must contain 2 values otherwise return error message
  • -Object X & Y value detection, when 1 value is missing, return error message
New Testversion:

-This version contains a new Lapperfunction: trackuserdistance();
-This version contains everything from the first testversion


With this function you can display the distance between 2 players or between a other location and a player.
See some examples below.

trackuserdistance($userName,$userName);
trackuserdistance($TheLocation,$userName);
trackuserdistance($userName,$TheLocation);
trackuserdistance($TheLocation,$TheLocation);
trackuserdistance("-150:26","-150:26"); #(X:Y,x:y)

There is a testcommand in LFSLapper.LPR you can test.
This command will look like this.


<?php 
CASE "!tud":
    
$TheLocation "-150:26"# X : Y (BL1 at the parking behind the pitlane)
    
privmsg("^8Distance between ^3The location^8 & ^3" .$userName."^8 = ^2"trackuserdistance($TheLocation,$userName). " ^8meters");
BREAK;
?>

EDIT:
===========================================================
===========================================================
i'm thinking to change the Values of the addobject() and removeobject() functions

To add 2 objects the current function looks like this:


<?php 
addobject
($X,$Y,$Z,$Flag,$Type,$Heading#object 01
          
$X,$Y,$Z,$Flag,$Type,$Heading#object 02
?>

I might gonna change it to:

<?php 
$Cone
=       $X.":".$Y.":".$Z.":".$Flag.":".$Type.":".$Heading;
$Cone_two=   $X.":".$Y.":".$Z.":".$Flag.":".$Type.":".$Heading;
$Cone_three$X.":".$Y.":".$Z.":".$Flag.":".$Type.":".$Heading;

addobject($Cone,$Cone_two,$Cone_three);
?>

Let me know , what you think about this idea

Any feedback whould be nice
Attached images
TheLocation.png
my LFSLapper.lpr v 7.0.4.3 will work in new version?
yes it will work after adding the new event into your LFSLapper.LPR
Otherwise Lapper wont start.



#######################################################################################
#Get info about objects when adding/removing objects in AutoX editor
#######################################################################################
$DisplayObjectInfo = -1; #Set -1 to disable this event
Event OnObjectInfo($userName,$NumO,$Action,$X,$Y,$Z,$Flags,$Type,$InDex,$Heading) # Player event

EndEvent


FGED GREDG RDFGDR GSFDG