The online racing simulator
wow thx mate
didnt know that u could remove the scheduleactions, ill go test it

RemoveScheduleAction doesnt work
1/18/2010 10:00:35 PM -> Syntax error in cfg file "LFSLapper.lpr" at line #862
'removescheduleaction' is not a Lapper function
Function 'autotrackchangeoff' script aborted

need to find something else.
Quote from Bass-Driver :wow thx mate
didnt know that u could remove the scheduleactions, ill go test it

RemoveScheduleAction doesnt work
1/18/2010 10:00:35 PM -> Syntax error in cfg file "LFSLapper.lpr" at line #862
'removescheduleaction' is not a Lapper function
Function 'autotrackchangeoff' script aborted

need to find something else.

thats because it was not added in845... thats why i told u to upgrade to 924 it would solve all ur problems
k i'm busy now to move my code from 5.845 to the new one
and most of the things works now

hmm cant get the code below:
#Connect messages when a player joins the server#
Not Working

edit: FIXED, had changed SaveGroupToFile to UserGroupToFile

everything runs fine so far
Quote from nesrulz :btw, DEMO 1 > LFSLapper/bin/synchro/DEMO2 folder have syc files, but, DEMO 2 > LFSLapper/bin/synchro/DEMO1 is empty.

Now is OK, both servers have syc files.
How synchro work anyway?
What is it?
hi
i have change my lapper version to 5.924 and my !report command doesnt make new files


CASE "!report":
IF( $argv != "" ) THEN
$idxOfFirtsSpace = indexOf( $argv, " ");
IF( $idxOfFirtsSpace != -1 ) THEN
$user = subStr( $argv,0,$idxOfFirtsSpace );
$argv = trim( subStr( $argv,$idxOfFirtsSpace ) );
IF( UserInGroup( "Report" . $user , $user ) == 1 )
THEN
privMsg( "^7»Thanks for reporting" );
privMsg ( "^7»U Have Report This User ^3(" . $User .")" );
UserGroupToFile( "Report" . $user, "User/Report/" . $user . ".txt" );
MoveUserToGroup( "Report" . $user, "Report by: " . GetCurrentPlayerVar("UserName") . " (" . GetLapperVar("ShortDate") . " - " . GetLapperVar("LongTime") . ")" . $argv );
ELSE
privMsg( "^7»Thanks for reporting" );
privMsg ( "^7»U Have Report This User ^3(" . $user .")" );
privMsg ( "^7»^6" . $argv );
UserGroupToFile( "Report" . $user, "User/Report/" . $user . ".txt" );
MoveUserToGroup( "Report" . $user, "Report by: " . GetCurrentPlayerVar("UserName") . " (" . GetLapperVar("ShortDate") . " - " . GetLapperVar("LongTime") . ")" . $argv );
IF( UserInGroup( "UserAdmin",$userName ) == 1 )
THEN
privMsg ( $userName , "^1»!!! ^7" . GetCurrentPlayerVar("NickName") ." Has Report ^3(" . $user .")");
privMsg ( $userName , "^7»^6" . $argv );
ENDIF
ENDIF
ENDIF
ENDIF
BREAK;

Quote from Bass-Driver :
hi
i have change my lapper version to 5.924 and my !report command doesnt make new files


CASE "!report":
IF( $argv != "" ) THEN
$idxOfFirtsSpace = indexOf( $argv, " ");
IF( $idxOfFirtsSpace != -1 ) THEN
$user = subStr( $argv,0,$idxOfFirtsSpace );
$argv = trim( subStr( $argv,$idxOfFirtsSpace ) );
IF( UserInGroup( "Report" . $user , $user ) == 1 )
THEN
privMsg( "^7»Thanks for reporting" );
privMsg ( "^7»U Have Report This User ^3(" . $User .")" );
[COLOR=Red] MoveUserToGroup( "Report" . $user, "Report by: " . GetCurrentPlayerVar("UserName") . " (" . GetLapperVar("ShortDate") . " - " . GetLapperVar("LongTime") . ")" . $argv );
UserGroupToFile( "Report" . $user, "User/Report/" . $user . ".txt" );[/COLOR]
ELSE
privMsg( "^7»Thanks for reporting" );
privMsg ( "^7»U Have Report This User ^3(" . $user .")" );
privMsg ( "^7»^6" . $argv );
[COLOR=Red] MoveUserToGroup( "Report" . $user, "Report by: " . GetCurrentPlayerVar("UserName") . " (" . GetLapperVar("ShortDate") . " - " . GetLapperVar("LongTime") . ")" . $argv );
UserGroupToFile( "Report" . $user, "User/Report/" . $user . ".txt" );[/COLOR]
$test = GetListOfPlayers( );
FOREACH( $maVar IN $test )
IF( UserInGroup( "UserAdmin",$maVar["value"] ) == 1 )
THEN
privMsg ( $maVar["value"] , "^1»!!! ^7" . GetCurrentPlayerVar("NickName") ." Has Report ^3(" . $user .")");
privMsg ( $maVar["value"] , "^7»^6" . $argv );
ENDIF
ENDFOREACH
ENDIF
ENDIF
ENDIF
BREAK;



try this
is there a way to get the var for $distToDo? like GetVar( "distToDo")
getConfigVar( "distToDo" );
Quote from Gai-Luron :getConfigVar( "distToDo" );

ye tried that a few days ago... didnt work tried it today it works :P
-
(Fire_optikz001) DELETED by Fire_optikz001
i have a lil problem

CASE "!distance":
CASE "!dt":
privmsg( "Current Distance: " . Round(ToNum( GetCurrentPlayerVar("TotDistMeter") / 1000),1));
privmsg( "Total Distance: " . Round(ToNum( ToNum( GetCurrentPlayerVar( "KM" ) + GetCurrentPlayerVar("TotDistMeter") ) / 1000 ),1));
BREAK;


SetCurrentPlayerVar( "Dist", ToNum( ToNum( GetCurrentPlayerVar( "KM" ) + GetCurrentPlayerVar("TotDistMeter") ) / 1000 ));
setUserStoredValue( "Dist", GetCurrentPlayerVar( "KM" ) );

It doenst save the driven distance
Quote from Bass-Driver :i have a lil problem

CASE "!distance":
CASE "!dt":
privmsg( "Current Distance: " . Round(ToNum( GetCurrentPlayerVar("TotDistMeter") / 1000),1));
privmsg( "Total Distance: " . Round(ToNum( ToNum( GetCurrentPlayerVar( "KM" ) + GetCurrentPlayerVar("TotDistMeter") ) / 1000 ),1));
BREAK;


SetCurrentPlayerVar( "Dist", ToNum( ToNum( GetCurrentPlayerVar( "KM" ) + GetCurrentPlayerVar("TotDistMeter") ) / 1000 ));
setUserStoredValue( "Dist", GetCurrentPlayerVar( "KM" ) );

It doenst save the driven distance

lol i see ur using my cruise script ... or it looks like my cruise script

but anyways u cant have set current playervar and stored value outside of the case :P
Quote from Fire_optikz001 :lol i see ur using my cruise script ... or it looks like my cruise script

but anyways u cant have set current playervar and stored value outside of the case :P

ok can u show me with a code how to use Setcurrentplayervar and Stored value
take the code above as example
Having another problem... I have been trying, testing and changing my butt off to get this working, but it doesn't seem to be willing to listen to me..

The following is the case:
I define an array in the OnLapperStart:
GlobalVar $a_user_array;

In the OnRaceStart I initialize this array:
FOR ($l=1;l<=4;$l=$l+1)
$a_user_array[$l, "username")="X";
$a_user_array[$l, "finishedpos")=0;
ENDFOR

(The "X" is chosen to show things)

So far so good. I have been entering some 'cmdLFS("/msg ")'s at various spots (OnLap, OnFinish etc.) to show what's in the array, and I actually see those "X"s and zeroes in those messages.
Even at the start of the OnResult, where I actually start to use the array.

Anyway, here's were the happening of strange things starts. What do I want to do? Well, in the OnResult I'd like to add the player in question to the array. So I lookup the first available spot in the array and put in the user-data. For testing purposes I entered a "Y" in the first spot, so the lookup should be forced to determine the second spot as the first one available. For the outcome of the array-filling this one doesn't really matter, things also go wrong without this action.
Here's the code I'm using:

$x = 0;
$a_user_array[1,"username"] = "Y";
cmdLFS("/msg A " . $a_user_array[1, "username"]);
cmdLFS("/msg A " . $a_user_array[1, "finishedpos"]);
cmdLFS("/msg A " . $a_user_array[2, "username"]);
cmdLFS("/msg A " . $a_user_array[2, "finishedpos"]);
cmdLFS("/msg A " . $a_user_array[3, "username"]);
cmdLFS("/msg A " . $a_user_array[3, "finishedpos"]);
$for_ready = 0;
FOR ($l=1;$l<=4;$l=$l+1)
IF ($for_ready == 0)
THEN
IF ($a_user_array[$l, "username"] == "X")
THEN
cmdLFS("/msg Forloop " . $a_user_array[$l, "username"]);
cmdLFS("/msg Forloop " . $a_user_array[$l, "finishedpos"]);
cmdLFS("/msg Forindex " . $l);
$x = $l;
$for_ready = 1;
ENDIF
ENDIF
ENDFOR
$a_user_array[$x, "username"] = $userName;
$a_user_array[$x, "finishedpos"] = GetCurrentPlayerVar("FinishedPos");
cmdLFS("/msg B " . $a_user_array[1, "username"]);
cmdLFS("/msg B " . $a_user_array[1, "finishedpos"]);
cmdLFS("/msg B " . $a_user_array[2, "username"]);
cmdLFS("/msg B " . $a_user_array[2, "finishedpos"]);
cmdLFS("/msg B " . $a_user_array[3, "username"]);
cmdLFS("/msg B " . $a_user_array[3, "finishedpos"]);

When I execute this code, I get the following results on screen:

A Y
A 0
A X
A 0
A X
A 0
Forloop X
Forloop 0
Forindex 2

Nothing wrong there yet, but then the mayhem starts:


B
B
B yamasuba.nl
B 1
B
B

To cut things short, the adding to the array of the player at hand seems to have caused the rest of the array being blanked out. And that I don't understand... Might I have come across some mystical bug, or am I doing something terribly wrong myself??
I know absolutely nothing about arrays, but on Krayy's reply to my query on my acceleration code his code has a few breaks in it, to break the FOR loops.

For instance
Quote :
FOR ($j=0; $j<=$maxCars;$j=$j+1)
IF ( ....
THEN
$aData = SplitToArray...
dumpVar($aData);
# Do the following FOR loop in reverse (counting down), so that the buttons only get created once
FOR ( $i=$maxAccelerationTimes; $i >= 1; $i=$i-1)
IF( ToNum.....
THEN
openPrivButton( "adjec.....
openPrivButton( "accele....
BREAK; # Break the FOR loop
ENDIF
ENDFOR
BREAK; # Break the FOREACH loop
ENDIF
ENDFOR
EndEvent

Maybe?
Quote from YamaSuba.NL :To cut things short, the adding to the array of the player at hand seems to have caused the rest of the array being blanked out. And that I don't understand... Might I have come across some mystical bug, or am I doing something terribly wrong myself??

It's not mystical, just annoying

I have found in my mucking about that Lapper handles arrays in an unpredicatble fashion when trying to assign values to elements that have already been defined, particularly if you got that value out of an existing array. Doing a type conversion (cast) solves the problem (are we getting technical yet?).

I think the problem in your code is when you are trying to reassign the array values here:


<?php 
    $a_user_array
[$x"username"] = $userName;
    
$a_user_array[$x"finishedpos"] = GetCurrentPlayerVar("FinishedPos");
?>

Try changing it to:

<?php 
    $a_user_array
[$x"username"] = ToString($userName);
    
$a_user_array[$x"finishedpos"] = ToNum(GetCurrentPlayerVar("FinishedPos"));
?>

and see how you got. The ToString and ToNum functions essentially do a type cast on those values.
Thanks! This seems to have done the tric!
Have to test this with more racers on track, but the messages show the already present values are preserved now.
is there a way to make lapper count how many times a string is split like

Fire_optikz001,Cop2,Cop3 = 3 Fire_optikz001 = 1 ect
Use splitToArray and then use arrayCount to count how many elem are in array
hi
is there a way to reset the UserStoredValue?? for all players of just for one player??
the code below is an idea

CASE "!cp":
CASE "!clearpoints":
IF( UserInGroup( "UserAdmin",$userName ) == 1 )
THEN
IF( getUserStoredValue( "ps_points_total" ) > "1" )
THEN
SetCurrentPlayerVar( "ps_points_total","0" );
ELSE
privMsg("^1You are not allowed to use this command!!!");
ENDIF
ENDIF
BREAK;

Quote from bass-driver :hi
is there a way to reset the userstoredvalue?? For all players of just for one player??
The code below is an idea

case "!cp":
Case "!clearpoints":
If( useringroup( "useradmin",$username ) == 1 )
then
if( tonum( getuserstoredvalue( $argv, "ps_points_total" ) ) > 1 )
then
setplayervar( $argv, "ps_points_total","0" );
else
privmsg("^1you are not allowed to use this command!!!");
endif
endif
break;


fixed
how do i do special chars Like •?
Quote from emit-nl :I found something for you: http://www.net-book.nl/bron/cms_image/ascii_tabel.jpg
Use ALT+code to get the special characters.
So, ALT+0149 = •

Good luck!

Tim

i know that but how do u do it in the cfg file... it gives me a ? :P

ALSO how do i get insim to tel weither it isa Demo Server or an S2 server
You can try to write this special char in chat LFS. Then type /t, up and then use Ctrl+C to cut and copy in pspad

I do this for previous winner flag

Gai-luron
Quote from Gai-Luron :You can try to write this special char in chat LFS. Then type /t, up and then use Ctrl+C to cut and copy in pspad

I do this for previous winner flag

Gai-luron

that is what i used i still get the ?

do i need to have any thing specail like ^L^H or something like that?
This thread is closed

Config help
(1112 posts, closed, started )
FGED GREDG RDFGDR GSFDG