The online racing simulator
Quote from Fire_optikz001 :how do u (if possible) remove the fisrt X number of letters from a string so like Chat_tatata would be just tatata

Use a combination of "strlen" and "substr" like this:


<?php 
$oldstr
="Chat_tatata";
$newstr substr($oldstr,5strlen($oldstr));
?>

That would make $newstr the part of $oldstr from character 5 to the end of the string
Quote from Krayy :Use a combination of "strlen" and "substr" like this:


<?php 
$oldstr
="Chat_tatata";
$newstr substr($oldstr,5strlen($oldstr));
?>

That would make $newstr the part of $oldstr from character 5 to the end of the string

eh i just decided to do it diffrent way but i will keep this in mind for next time i may need this
nvm
Quote from Fire_optikz001 :ok now lets say a user did !chat hey whats up dude hows it been....

insim would endup cutting of message i was wondering if there is a way to make it split lines after so many charecters

was wondering it i could do like

$argv2 = substr($argv,30, strlen($argv));

the second paramter of the substr function is the numeric start point, the third is the last, so yes that would show every thing in the string from character 30.

You can also use the indexOf function to find the first occurence of a particular character in a string like this:

<?php 
    $idxOfFirtsSpace 
indexOf$text" ");
$argv2 substr($argv,$idxOfFirtsSpace strlen($argv));
?>

In fact, this is doen all the time in processing the command strings in the OnMSO Event in the .lpr files like this:

<?php 
    
IF( $idxOfFirtsSpace == -THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirtsSpace );
      
$argv trimsubStr$text,$idxOfFirtsSpace ) );
    ENDIF
?>

is there somthing like GetListOfPlayers( ) but for on track?
Quote from Fire_optikz001 :is there somthing like GetListOfPlayers( ) but for on track?


<?php 
 
FOREACH ($Racer in getListOfPlayers())
IF (
GetPlayerVar($Racer"ontrack"))
THEN
   globalmsg
$Racer " is currently in a race");
ENDIF
ENDFOREACH
?>

In other words, the "ontrack" player variable is set when the player is in a race
ok i have a new problem in

SetUserStoredValue( $argv , "HC" , "" );
SetUserStoredValue( $argv , "Cash" , "" );
SetUserStoredValue( $argv , "Bank" , "" );
SetUserStoredValue( $argv , "KM" , "" );
SetUserStoredValue( $argv , "Energy" , "" );

found out it sets string value but not number value which is what the problem is :/
Quote from Fire_optikz001 :ok i have a new problem in

SetUserStoredValue( $argv , "HC" , "" );
SetUserStoredValue( $argv , "Cash" , "" );
SetUserStoredValue( $argv , "Bank" , "" );
SetUserStoredValue( $argv , "KM" , "" );
SetUserStoredValue( $argv , "Energy" , "" );

found out it sets string value but not number value which is what the problem is :/

Store the variable using SetuserStoredValue, but retrieve it using GetUserStoredNum instead of GetUserStoredValue and it will come back as a number
SetUserStoredValue( $argv , "HC" , 0 );
If you don't want 0 and no "". What do you want?
Quote from Fire_optikz001 :cant have 0 i need blank D:

As "" is not a valid number, then it will not stroe anything in the numeric database field. When you try to retrieve it using the GetUserStoredNum, as the stored value is not a valid number, then that function will return -1
Quote from Gai-Luron :If you don't want 0 and no "". What do you want?

i can have "" but it does not do anything

Quote from Krayy :As "" is not a valid number, then it will not stroe anything in the numeric database field. When you try to retrieve it using the GetUserStoredNum, as the stored value is not a valid number, then that function will return -1

hmmm will try
Hi,

I have problem with synchronise my 2 DEMO servers...

##############
#FTP transfer#
##############
# Results files can also be transferred to an FTP server
# Define the following parameters to use this feature
# Remove # before line to activate it
# -------------------------------------------------------------------

$FtpServer = "www.SERT-LFS.net"; # Name/IP-address of your FTP server
$FtpLogin = "myuser"; # Loginname for your FTP server
$FtpPasswd = "mypass"; # Password for your FTP server
$FtpRemotePath = "www/sert-lfs.net/site/lapperscript/txt"; # Directorname

##############################
#Synchronise Lapper databases#
##############################

#$SyncID="frh01"; # Unique ID for this instance of Lapper
#$SyncDir="synchro"; # Name of synchronisation directory. Every Lapper should have this directory name in order to synchronise
#$SyncIDsToSync="frh02|frh03"; # Lapper ID's to synchronise with
# Seperate ID's with |
# You can't use current SyncID here
$SyncID="DEMO1";
$SyncDir="synchro";
$SyncIDsToSync="DEMO2";

##############
#FTP transfer#
##############
# Results files can also be transferred to an FTP server
# Define the following parameters to use this feature
# Remove # before line to activate it
# -------------------------------------------------------------------

$FtpServer = "www.SERT-LFS.net"; # Name/IP-address of your FTP server
$FtpLogin = "myuser"; # Loginname for your FTP server
$FtpPasswd = "mypass"; # Password for your FTP server
$FtpRemotePath = "www/sert-lfs.net/site/lapperscript/txt"; # Directorname

##############################
#Synchronise Lapper databases#
##############################

#$SyncID="frh01"; # Unique ID for this instance of Lapper
#$SyncDir="synchro"; # Name of synchronisation directory. Every Lapper should have this directory name in order to synchronise
#$SyncIDsToSync="frh02|frh03"; # Lapper ID's to synchronise with
# Seperate ID's with |
# You can't use current SyncID here
$SyncID="DEMO2";
$SyncDir="synchro";
$SyncIDsToSync="DEMO1";

Can not set to display results from both DEMO servers in one tables...
Problem is?

Thx,
RGDS
Quote from nesrulz :Can not set to display results from both DEMO servers in one tables...

Forget this one, just have both servers point to the same database-path..
Quote from YamaSuba.NL :Already done, as I see.. Super, many thanks!

Working like a charm now!

@Kravy: also implemented your method of race completion determination. Have yet to test all possibilities, but for now also working AOK.
is there a way to open a privbutton for a diffren user i have


<?php 
openPrivButton
$argv,"test2",160,15,35,5,5,-1,32$var1 );  
?>

but it does not work
Quote from Fire_optikz001 :is there a way to open a privbutton for a diffren user i have


<?php 
openPrivButton
$argv,"test2",160,15,35,5,5,-1,32$var1 );  
?>

but it does not work

Can you give us an example of how it should work?
Quote from Krayy :Can you give us an example of how it should work?

like i was wondering if there was a way to open a privbutton for a diffrent user like lets say $var1 would be "hi" it would pop it up on the other users screen
Only one server must send to FTP.

You have an old version of Lapper but your config seem correct. Where is the problem. it's ftp transfer or synchro database between 2 server?

Gai-Luron
hi
i'm make something that lapper change the track automaticly after 3 hours.
also i have made something that u can turn it off and on , so when u turn it off that the admin can change the track manualy or he need to turn ATC( AutoTrachChange) Off.

My Problem is:
when i turn it off it really doesnt work anymore so thats good.
but when i turn it back on it tried to end the race twice.
so RegisterScheduleAction Fuction still working if u turn it off,only the code doesnt work anymore

So i dont know if u can turn this off
Check attachment for the code

i Use version 5.845
Attached files
AutoTrackChange.txt - 3.9 KB - 300 views
Quote from Gai-Luron :Only one server must send to FTP.

You have an old version of Lapper but your config seem correct. Where is the problem. it's ftp transfer or synchro database between 2 server?

Gai-Luron

All my LFS DEDI servers are on same PC (server). I tried synchro but not working.

DEDI 1:

##############################
#Synchronise Lapper databases#
##############################

#$SyncID="frh01"; # Unique ID for this instance of Lapper
#$SyncDir="synchro"; # Name of synchronisation directory. Every Lapper should have this directory name in order to synchronise
#$SyncIDsToSync="frh02|frh03"; # Lapper ID's to synchronise with
# Seperate ID's with |
# You can't use current SyncID here
$SyncID="DEMO1";
$SyncDir="synchro";
$SyncIDsToSync="DEMO2";

DEDI 2:

##############################
#Synchronise Lapper databases#
##############################

#$SyncID="frh01"; # Unique ID for this instance of Lapper
#$SyncDir="synchro"; # Name of synchronisation directory. Every Lapper should have this directory name in order to synchronise
#$SyncIDsToSync="frh02|frh03"; # Lapper ID's to synchronise with
# Seperate ID's with |
# You can't use current SyncID here
$SyncID="DEMO2";
$SyncDir="synchro";
$SyncIDsToSync="DEMO1";

And only one (DEDI 1) server send PB.txt and DriftPB.txt on my Web server (hosting) is txt folder...

DEDI 1:

##############
#FTP transfer#
##############
# Results files can also be transferred to an FTP server
# Define the following parameters to use this feature
# Remove # before line to activate it
# -------------------------------------------------------------------

$FtpServer = "www.SERT-LFS.net"; # Name/IP-address of your FTP server
$FtpLogin = "my_ftp_user"; # Loginname for your FTP server
$FtpPasswd = "my_ftp_pass"; # Password for your FTP server
$FtpRemotePath = "www/sert-lfs.net/site/lapperscript/txt"; # Directorname

This is properly for synchro PB and DriftPB file on my Web page?

http://www.sert-lfs.net/site/lapperscript/index.php

Thx,
RGDS
btw, DEMO 1 > LFSLapper/bin/synchro/DEMO2 folder have syc files, but, DEMO 2 > LFSLapper/bin/synchro/DEMO1 is empty.
Quote from Bass-Driver :hi
i'm make something that lapper change the track automaticly after 3 hours.
also i have made something that u can turn it off and on , so when u turn it off that the admin can change the track manualy or he need to turn ATC( AutoTrachChange) Off.

My Problem is:
when i turn it off it really doesnt work anymore so thats good.
but when i turn it back on it tried to end the race twice.
so RegisterScheduleAction Fuction still working if u turn it off,only the code doesnt work anymore

So i dont know if u can turn this off
Check attachment for the code

i Use version 5.845

I'll do something with your code tonight, but in the meanwhile, think about using the removescheduleaction function to emove the actions that you have scheduled when you turn autotrackchange off like this:

<?php 
Sub AutoTrackChangeOff
($KeyFlags,$id)
    IF(
$AutoTrackChange == "off")
    
THEN
    privMsg
"^7>ATC ALREADY TURNED ^1OFF!!!");
    ELSE
    
$AutoTrackChange "off";
    
RemoveScheduleActionSA_RotateTrack0 );
    
RemoveScheduleActionSA_RotateTrack3 );
    
RemoveScheduleActionSA_RotateTrack6 );
    
RemoveScheduleActionSA_RotateTrack9 );
    
RemoveScheduleActionSA_RotateTrack12 );
    
RemoveScheduleActionSA_RotateTrack15 );
    
RemoveScheduleActionSA_RotateTrack18 );
    
RemoveScheduleActionSA_RotateTrack21 );
    
cmdLFS("/msg ^7>" GetCurrentPlayerVar("Nickname") . "^7 Turned ATC ^1OFF!!!" );
    ENDIF
    
ClosePrivButton("ATCONOFF&ATCON&ATCOFF");
EndSub
?>


This thread is closed

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