The online racing simulator
Searching in All forums
(112 results)
$text $username for MSO ...BUT
SEV7N
S3 licensed
I am trying to learn lapper a bit more so I can use it's full potential. I found a program called "InsimSniffer" which told me what ISI packet meant what.

It told me
MSO is someones chat input.
OBH is when a user hit an object -In Insim.txt (LFS Doc Folder) it mentions more OBH, like these.

OBH_LAYOUT an added object
OBH_CAN_MOVE a movable object
OBH_WAS_MOVING was moving before this hit
OBH_ON_SPOT object in original position



Figuring this out i tried this.


<?php 
Event OnMSO
$userName$text )  # Player event
  
openPrivButton"Test_1",10,118,20,7,6,-1,32,"^3TEST 1234");
EndEvent
?>



It worked fine, I typed a msg into LFS chat and the button pops up.

I try this.


<?php 
Event OnOBH
$userName$text )  # Player event
  
openPrivButton"Test_1",10,118,20,7,6,-1,32,"^3TEST 1234");
EndEvent
?>


No Worky.

I think the "$username $text" has something to do with it?
If so is there a list of the $ that lapper uses?

Cheers.
SEV7N
S3 licensed
Quote from sinanju :Have a look at Tim[NL]'s Race Points system (HERE).

Basically you'll need a system for giving and adding points together to give you a total.

It will mean learning a bit about SET/GET variables.

Cool thanks Sinanju, Im going to learn it now I have an idea of var's, (I know how to use getplayervar nickname function in a button or something, so couldn't be too hard.

Cheers for ya help, I uploaded here what you helped me achieve

It's a 99.9% completed addon for Autocross
SEV7N
S3 licensed
Another quick question, what's the ! command to bring up this window?

# These lines will appear as buttons to everyone connecting to the
# server, allowing for communicating some must-read info - string(s)
# Use "ButtnMotd=+text" to define text for individual buttons.
ButtnMotd=

I have done it before using !rsb *I think as I was just testing Airio, but every other time I went to use it it did'nt work.

Cheers.
SEV7N
S3 licensed
I have one more question, I have made zone-events on ClipPoints, so when someone hits a clip-point, it counts the score like on the driftmeter.

I have it to open a window above the driftmeter, but unsure how to make it count. **Its only part of the script**
I have coded zones to all of my clips, but I don't know how to tell lapper to add points on each zone, (If the zone is driven in).


<?php 
CatchEvent OnLapperStart
()
   
RegisterZoneAction"AU1" , -91,-975SR_AwardPoints1,"" );
EndCatchEvent 


$PointsAwardedOnClipHit 
200# Point's to be awarded on cliphit


Sub SR_AwardPoints1($userName)
    
openPrivButton"award_points",5,125,20,12,6,-1,32,"",GetPlayerVar(PointsAwardedOnClipHit));
    
openPrivButton"award_points2",5,125,20,5,6,-1,0,"ClipBonus");
EndSub 
?>


Cheers Heaps!
Last edited by SEV7N, .
SEV7N
S3 licensed
Quote from sinanju :If using newer version of lapper, you may have to do following;

RegisterZoneAction( "AU1" , 23,-614, 2 , SR_LoadClips,"" );

Thanks buddy that done the trick, thanks 1000000!
SEV7N
S3 licensed
Quote from cargame.nl :Yeah.. Well.. If you want to have that many customizations you need to start thinking of writing your own InSim or indeed using lapper (noticed you already been doing that) which is open source.

Yeh I have been Trying to code lapper to fit my needs, soon I won't need Airio
SEV7N
S3 licensed
Quote from sinanju :Did you try something like the following?


<?php 
Sub SR_LoadClips
($userName)
    
openPrivButton"stop_light",53,38,60,15,6,-1,0,"^2test");
EndSub
?>



This is my script, I cant see the problem


<?php 
CatchEvent OnLapperStart
()
    
RegisterZoneAction"AU1" 23,-614SR_LoadClips );
EndCatchEvent 

Sub SR_LoadClips
($userName)
    
openPrivButton"stop_light",53,38,60,15,6,-1,0,"^2test");
EndSub 
?>


Cheers.
SEV7N
S3 licensed
Hey again, after I tried what you said but it didn't bring up the test button.

I have it as an DAclips.lpr and included it in addonsused.

If I remove the daclips ad-don everything is fine.

Here is the code.

(I started a new .lpr file as I am planning to put the # in when I don't want to use the ad-don).

Sorry to be annoying heheh.




<?php 
CatchEvent OnLapperStart
()
    
RegisterZoneAction"AU1" , -32,-615SR_LoadClips );
EndCatchEvent

Sub SR_LoadClips
openPrivButton
"stop_light",53,38,60,15,6,-1,0,"^2test");
EndSub 
?>


EDIT: You forgot the () after Sub SR_LoadClips so it made everyone get (main_ not found) errors
Last edited by SEV7N, .
SEV7N
S3 licensed
Quote from sinanju :


<?php 
Sub SR_LoadClips
#  something happens, like button being drawn
EndSub
?>


You were telling your sub to look at your sub - so would have got stuck in an indefinite loop without anything happening, except possibly lapper crashing.

Oh I see the error now, I tried OnLapperStart and Event as my beggining line, and it logged everyone on the server in as Admin, heheh.

registerzone,"AU1"1,1,1,1,1 "hi","SR_SayHi"

Sub SR_SaHi()
privmsg"hi there";

(I know the syntax probably wrong, just showing I have a fair idea of Sub's now. Thanks1000000

I am going to try these registerzone things again, Thanks for your help!
[Solved] Help With registerzone
SEV7N
S3 licensed
Hi, I have started a new .lpr file to go into the addonsused.lpr.

I am having trouble getting it started.

I can do it fine if I edit the "registerzone" in the main .lpr file, but I don't always want this add-on turned on, hence needing a fresh .lpr file.

I tried my best to do it but it's fair tricky to understand the first part of a script.

I have this sofar.



<?php 
CatchEvent OnMSO
$userName$text # Player event
    
$idxOfFirstSpace indexOf$text" ");
    IF( 
$idxOfFirstSpace == -)
    
THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirstSpace );
      
$argv trimsubStr$text,$idxOfFirstSpace ) );
    ENDIF

    SWITCH ( 
$command)
             CASE 
"!clips"
    
LoadClips(0,0);      
              BREAK;
    ENDSWITCH 
EndCatchEvent


Sub LoadClips
$KeyFlags,$id )
    
RegisterZoneAction"AU1" 41,-823LoadClips );
EndSub
?>


Thanks.Thumbs up
Last edited by Bass-Driver, .
SEV7N
S3 licensed
Quote from cargame.nl :script what feels? I don't understand the English, sorry.


Yeah, its an option in !opt .. People can switch it on or off. And I cannot remember if it was possible to change the defaults... I thought that is possible.

Heheh sorry, Cut&Paste does wonders...and doesn't.

Yep, all I want to change is the default message to something else.
SEV7N
S3 licensed
Quote from cargame.nl :And that just isn't possible because it's


Only thing you can do is try to add ContactWarn=Car contact with

to the language file(s) which I think will work but it only is possible to change that part of the sentence not driver1 driver2 @digit.digit.

Oh OK thanks, would there be any reason for the script only working when it feels?

AIRIO doesn't seem to show the collision info to people, but sometimes it will?

Cheers
SEV7N
S3 licensed
Quote from cargame.nl :You mean automatically use that information inside another var?

No that is not possible. You have to 'manually' repeat that information again if you want to have it in Motd.

Na When someone hits someone its brings a message in chat saying "collision with joe bloe" I just want to change that to something custom.
SEV7N
S3 licensed
Thanks for that, worked "out the box"

Can you help with this please? I tried to implement my knowledge of buttons, but its not as easy as I thought.

How do I show different info on different zones?




I added on to the lapper file, can I make my own add-on
for the addonsincluded.lpr
Thanks 1000000


<?php 
Sub DisplaySpeed
$userName )
    
PrivMsglangEngine"%{main_clip}%" ToPlayerUnitGetCurrentPlayerVar"InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );
EndSub

Sub DisplayLight
$userName )
    
PrivMsglangEngine"%{main_light}%" ToPlayerUnitGetCurrentPlayerVar"InstantSpeed" ) ),GetCurrentPlayerVar("UnitSpeed") ) );
EndSub ##THE LIGHT"S SUB?###



    
RegisterZoneAction"AU1" 43,-774DisplaySpeed,ExitDisplaySpeed);
    
RegisterZoneAction"AU1" 28,-862DisplaySpeed,ExitDisplaySpeed);
    
RegisterZoneAction"AU1" 28,-871DisplayLight); ##LIGHT calling SUB?##
?>

I have in the ENG part,

<?php 
main_light2 
"^1test= {0}
?>


Thanks man.
Last edited by SEV7N, .
SEV7N
S3 licensed
Can someone please point out where the collision info is? (I just want to change the message that pop's up telling you someone hit you, or you hit someone.) Thanks!
Last edited by SEV7N, .
SEV7N
S3 licensed
Hi again, I have made this, but everytime i try the Sub part, it never closes when I click close? I think I need to make a new event but I am un-sure how. Or the

<?php 
Sub Close_all
()
?>

needs something in the ()?


<?php 
CatchEvent OnMSO
$userName$text # Player event
    
$idxOfFirstSpace indexOf$text" ");
    IF( 
$idxOfFirstSpace == -)
    
THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirstSpace );
      
$argv trimsubStr$text,$idxOfFirstSpace ) );
    ENDIF

    SWITCH ( 
$command )


                                                     
##DAscoring Box##
             
CASE "!da"
                                     
openPrivButton"top",3,49,100,75,6,-1,16,"" ); 
                                     
openPrivButton"leftbx",3,49,25,75,6,-1,32,""); 
                                     
openPrivButton"Header",28,50,74,5,6,-1,32,""); 
                                     
openPrivButton"da",15,50,74,5,6,-1,0,"^2DRIFT^3AUSTRALIA"); 
                                     
openPrivButton"Score",32,50,74,5,6,-1,0,"^7Scoring"); 
                                     
openPrivButton"light",42,50,74,5,6,-1,12,"^2•"); 
                                     
openPrivButton"lappa",3,59,25,5,5,-1,16,"^7Lapper"); 
                                     
openPrivButton"box",28,59,74,5,6,-1,16,""); 
                                     
openPrivButton"infos",3,59,125,5,5,-1,0,"^7Lapper ^7Will ^7Give ^7You ^7Point's ^7For ^7Drifting ^7According ^7To ^7Angle:"); 
                                     
openPrivButton"Angle",31,71,15,5,5,-1,0,"^7Min ^7Angle:"); 
                                     
openPrivButton"Anglenum",41,71,15,5,5,-1,0,"^715°"); 
                                     
openPrivButton"speed",31,79,15,5,5,-1,0,"^7Min ^7Speed:"); 
                                     
openPrivButton"speednum",43,79,15,5,5,-1,0,"^710KMP"); 
                                     
openPrivButton"Clips",3,89,25,5,5,-1,16,"^7Clip ^7Point's"); 
                                     
openPrivButton"infos2",28,89,74,5,5,-1,16,"^7LFS ^7Gives ^7Points ^7According ^7To ^7The ^7Amount ^7Of ^7Clip's ^7Hit.:"); 
                                     
openPrivButton"clipp",32,98,20,5,5,-1,0,"^7One ^7Pole/Cone ^7="); 
                                     
openPrivButton"clippn",48,98,15,5,5,-1,0,"^750pts"); 
                                     
openPrivButton"daptscls",51,117,15,5,5,-1,32,"^7CLOSE",Close_all);
                                     
openPrivButton"next",31,117,15,5,5,-1,32,"^7NEXT",Sub_Next);
                                             

              BREAK;                                        
##DAinfo Box##
             
CASE "!info":
                                     
openPrivButton"topinfo",3,49,100,75,6,-1,16,"" );
                                     
openPrivButton"leftbxinfo",3,49,25,75,6,-1,32,""); 
                                     
openPrivButton"Headerinfo",28,50,74,5,6,-1,32,"");
                                               
                                              
             BREAK;      
    ENDSWITCH 
EndCatchEvent###If I move this to the bottom nothing works

    ######CLOSE-ALL Button won't close anything?########

Sub Close_all() 
(
"top&leftbx");
EndSub
?>


Last edited by SEV7N, .
SEV7N
S3 licensed
Quote from sinanju :This bit of code will only open a large blank button that doesn't do anything - which, of course, might be your intention?

If you want things to be in different .lpr files, then you need to have an Event that triggers your code. AND because you want to have a command in a separate .lpr file, you will have to start off with "CatchEvent On".

For instance, any CASE commands, like your !do would have to be like the following;


<?php 
CatchEvent OnMSO
$userName$text # Player event
    
$idxOfFirstSpace indexOf$text" ");
    IF( 
$idxOfFirstSpace == -)
    
THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirstSpace );
      
$argv trimsubStr$text,$idxOfFirstSpace ) );
    ENDIF

    SWITCH ( 
$command )
        CASE 
"!to
            # instructions (sub-routine) for lapper to follow when command typed
        BREAK;     
    ENDSWITCH
EndCatchEvent
?>



Thank's your a Legend in ya own Lunchbox!!
SEV7N
S3 licensed
Quote from sinanju :You need to add a sub-routine to the end of the line, e.g.

<?php 
openPrivButton
"next",31,117,15,5,5,-1,32,"^7NEXT",Sub_Next);
?>


<?php 
Sub Sub_Next
()
# Close and Open Button(s) etc coding here
EndSub
?>


For your "DO" query, do you mean a CASE command such as !do?

If so code same way as your !da - that is;
specify the CASE command
make button(s) with relevant text
if required, add sub-routine to clickable button that will take you to a sub-routine
make up a sub-routine after the BREAK ending (this sub-routine probably needs to close the button you clicked to get to the sub-routine).

Query: Do you need the ENDIF at the end of you CASE commands?

OK cheers for the info,

If i wanted to make a new include( "./DAinfo.lpr");
how would I get it started?
(My !da code is in the lapper.LPR file it's self. I want it in a neat and tidy DAinfo.lpr file?

I have the .LPR file named DAinfo and I have included it in the addonsused.LPR file,

Heres how I guessed heheh. (I know next to nothing about this)


<?php 
SWITCH

CASE 
"!da":
openPrivButton"top",3,49,100,75,6,-1,16,"" );
        
ENDSWITCH
?>

Thanks Again!
"!" functions in a button (!help)
SEV7N
S3 licensed
Here I made 2 windows, one is !da and the other is !info (both have working "close" buttons, and a non working "NEXT" button).

I am trying to put the !da command in the "next button" so when someone presses "NEXT" button in !info it opens the window in !da








<?php 
CASE "!da":
                   
openPrivButton"top",3,49,100,75,6,-1,16,"" );
                                     
                                     
openPrivButton"leftbx",3,49,25,75,6,-1,32,"");
                                     
openPrivButton"Header",28,50,74,5,6,-1,32,"");
                                     
openPrivButton"da",15,50,74,5,6,-1,0,"^2DRIFT^3AUSTRALIA");
                                     
openPrivButton"Score",32,50,74,5,6,-1,0,"^7Scoring");
                                     
openPrivButton"light",42,50,74,5,6,-1,12,"^2•");
                                     
                                     
                                     
openPrivButton"lappa",3,59,25,5,5,-1,16,"^7Lapper");
                                     
openPrivButton"box",28,59,74,5,6,-1,16,"");
                                     
openPrivButton"infos",3,59,125,5,5,-1,0,"^7Lapper ^7Will ^7Give ^7You ^7Point's ^7For ^7Drifting ^7According ^7To ^7Angle:");

                                      
openPrivButton"Angle",31,71,15,5,5,-1,0,"^7Min ^7Angle:");
                                      
openPrivButton"Anglenum",41,71,15,5,5,-1,0,"^715°");
                                      
openPrivButton"speed",31,79,15,5,5,-1,0,"^7Min ^7Speed:");
                                      
openPrivButton"speednum",43,79,15,5,5,-1,0,"^710KMP");
                                      
openPrivButton"Clips",3,89,25,5,5,-1,16,"^7Clip ^7Point's");
                                      
openPrivButton"infos2",28,89,74,5,5,-1,16,"^7LFS ^7Gives ^7Points ^7According ^7To ^7The ^7Amount ^7Of ^7Clip's ^7Hit.:");
                                      
openPrivButton"clipp",32,98,20,5,5,-1,0,"^7One ^7Pole/Cone ^7=");
                                      
openPrivButton"clippn",48,98,15,5,5,-1,0,"^750pts");
                                      
openPrivButton"next",31,117,15,5,5,-1,32,"^7NEXT");
openPrivButton"pstclose",60,110,20,10,5,-1,32langEngine("%{main2_close}%"),ClosePstInfo );
                                 BREAK;
                                        ENDIF
                                        
                                
                              CASE
"!info":
                                      
openPrivButton"top",3,49,100,75,6,-1,16,"" );
                                      
openPrivButton"infos",3,51,25,5,5,-1,0,"^7HELP");
                                      
openPrivButton"lappa",3,59,25,5,5,-1,16,"");
                                      
openPrivButton"leftbx",3,49,25,75,6,-1,32,"");
                                      
openPrivButton"Clips",3,89,25,5,5,-1,0,"");
                                      
openPrivButton"Anglenum",3,59,25,5,5,-1,0,"^7Custom ^7Commands ^7(!da)");
                                      
openPrivButton"Header",28,50,74,5,6,-1,32,"");
                                      
openPrivButton"Score",32,50,74,5,6,-1,0,"^7Info/Help");
                                      
openPrivButton"light",45,50,74,5,6,-1,12,"^2•");
                                      
openPrivButton"da",15,50,74,5,6,-1,0,"^2DRIFT^3AUSTRALIA");

openPrivButton"pstclose",60,110,20,10,5,-1,32langEngine("%{main2_close}%"),ClosePstInfo );
BREAK
ENDIF
?>

And the part that makes the buttons close when close is pressed.

<?php 
Sub ClosePstInfo
$KeyFlags,$id )
    
closePrivButton

"pstclose&Back&Angle&top&top2&leftbx2&Header2&leftbx&Header&da&Score&lappa&light&light2&box&infos&Angle&Anglenum&speed&speednum&Clips&infos2&clipp&clippn&PSNickNa

me&PSDistance&PSFuel&PSLaps&PSWins&PSSecond&PSThird&PSFinished&PSQuals&PSPole&next&prev"
);
Closeclosescore$KeyFlags,$id )
    
closePrivButton("closescore");
EndSub
?>


I was thinking a Do function but I am unsure how to code properly and all attempts failed.
Help would be much appreciated, Cheers!
SEV7N
S3 licensed
Quote from cargame.nl :Hardcoded.

Ah OK cheers.




Quote from DANIEL-CRO :There are some custum command in FULL Airio,
maybe you can do something with it

All good I have disable lappers !help
SEV7N
S3 licensed
Sorry to be annoying LOL.

I managed to create a few custom ! command.

How would i make a <<PREV NEXT>>> button so they are all in one page?

Instead of needing to type ! ! ! all the time?

Cheers.

I managed to copy the close button and made it close my new button I made, I know that this line:

openPrivButton( "pstclose",50,110,20,10,5,-1,32, langEngine("%{main2_close}%"),ClosePstInfo );

And I figured it asks this line for info.
Sub ClosePstInfo( $KeyFlags,$id )
closePrivButton(

"pstclose&Back&Angle&top&leftbx&Header&da&Score&lappa&light&light2&box&infos&Angle&Anglenum&speed&speedn

um&Clips&infos2&clipp&clippn&PSNickName&PSDistance&PSFuel&PSLaps&PSWins&PSSecond&PSThird&PSFinished&PS

Quals&PSPole");
Closeclosescore( $KeyFlags,$id )
closePrivButton("closescore");

This closes my !da window, How can I make a button that goes to !da2 when pressed?

Cheers!
Last edited by SEV7N, .
SEV7N
S3 licensed
Quote from DANIEL-CRO :Don't think so.

What about changing !help to !something-here?
SEV7N
S3 licensed
Is it possible to remove the !help function?
SEV7N
S3 licensed
Quote from DANIEL-CRO :If you are on autocross or some kind of costum layout it will always spectate jumpstarters no matter of Airio config, this is some kind of bug I think

Sweet cheers, Yep was on Autocross. Hopefully there's a way around it
SEV7N
S3 licensed
Can I change the !help to something else? like !info, as airio brings up its help as-well.
Last edited by SEV7N, .
FGED GREDG RDFGDR GSFDG