The online racing simulator
Issue with setting allowed mods
(3 posts, started , go to first unread)
Issue with setting allowed mods
When I use this command: SetListAllowedMods( "BC858B,C9F8FE" );
I get this error:


4/20/2022 3:00:32 PM -> Error on Task System.NullReferenceException: Object reference not set to an instance of an object.
at LFSLapper.LFSClient.setlistallowedmods(unionVal val, ArrayList args)
at GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
at GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
at GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
at GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
at GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
at GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
at GLScript.GLApp.executeFunction(String funcName, String[] argsVals)
at Configurator.lexConfigurator.executeFunction(String funcName, infoPlayer pcurrInfoPlayer, String[] par)
at LFSLapper.LFSClient.loopTask()

When I use this command: SetAllowedMods( "BC858B,C9F8FE" );
I get this error:

4/20/2022 2:56:24 PM -> Syntax error: in file ".\AB-configs\.\..\includes\.\schedule.lpr" at line #394
The function: SetAllowedMods does not exist
Function 'set_server_settings' script aborted

In file 'Changes.txt' both commands ('SetListAllowedMods' and 'SetAllowedMods') are mentioned, but I cannot get either of them to work.
The last error is obvious, the command does not exist, so that seems to be a typo in file 'Changes.txt', but I have no clue why the other command isn't working.
Any help is appreciated.
First of all: I'm deeply sorry that i totally missed this topic. Schwitz
Also haven't been on the forum for a period of time.

2nd: to set allowed mods i use the function SetListAllowedMods();
I use this in function in some code to get the list of cars from a textfile.

3rd: Does the mod (skinid) still exist. You can verify that with : https://www.lfs.net/files/vehmods/<skinid>

Here's an codeexample i use in one of my scripts.


<?php 
### GET LIST OF MODDED CARS ###            
            
FOR($CarMod 0$CarMod <= ToNum($GetNrOfVars);$CarMod=$CarMod+1)
                
### GET LIST OF MODDED CARS ###
                
$FileDataLine $DataOfCarModsFile[ToNum($CarMod), "Line"];
                        
                IF(
$FileDataLine != ""THEN
                    $WhiteList_ModdedCars
[$CarMod] = $FileDataLine."";
                    
$WhiteList_CurrModCars $WhiteList_CurrModCars+1;
                    
                    
#CREATE STRING WITH MODS FOR SetListAllowedMods() function.
                    
IF($WhiteList_ModdedCars[$CarMod] != ""THEN
                        
IF($StringwithCarMods == ""THEN
                            $StringwithCarMods 
$WhiteList_ModdedCars[$CarMod];
                        ELSE
                            
$StringwithCarMods $StringwithCarMods "," $WhiteList_ModdedCars[$CarMod];
                        ENDIF    
                    ENDIF
                ENDIF
            ENDFOR

IF(
$Option == "unset")THEN
                SetListAllowedMods
("");
                
cmdLFS("/msg ^3[MODSYSTEM] ^3Warning: ^7All Mods are allowed!");
            ENDIF
            
            IF(
$Option == "set")THEN
                SetListAllowedMods
("".$StringwithCarMods."");
                
cmdLFS("/msg ^7[MODSYSTEM] ^3Loading: ^7".$WhiteList_CurrModCars." Modded cars from whitelist.");
            ENDIF

?>

I saw a typo in the changelog on 7.0.9.0. About Get/Set allowed mods. So i've changed that in the release topic.
After a while I gave up 'waiting' Big grin Wink and used the LFS command to get it working as Lapper kept crashing and I couldn't figure out what was wrong.
For those interested, I used this in Lapper: cmdLFS("/mods " [more code, not relevant here] );

The allowed mods on my server aren't coming from a textfile.
They come from the Lapper database as I update my Set Schedule script, to allow mods in there as well.
Maybe that is the issue and then it would be great to solve this crash.

Yes, the mod still existed at the time of testing, so that wasn't the cause.

*edit* I've have just uploaded the new versions of the script to this forum, so you can grab them if you want to search for the issue

Issue with setting allowed mods
(3 posts, started )
FGED GREDG RDFGDR GSFDG