The online racing simulator
Searching in All forums
(931 results)
Fire_optikz001
S2 licensed
5.8.4.5
EX i have

<?php 
 
Event OnConnect
()
    
$userName GetCurrentPlayerVar("UserName");
    
UserGroupFromFile"whole_ban""../user/whole_ban.txt" );
    
UserGroupFromFile"super_ban""../user/super_ban.txt" );
...

            IF( 
UserInGroup"whole_ban",$userName ) == )
            
THEN
                  privMsg
"^1You Have A Current Ban From This Server");
                  
privMsg"^1To See When Your Ban Is Over Visit");
                  
privMsg"^2http://supercr3w.ning.com/page/user-report-sys" );
                  
cmdLFS("/kick " .  . $userName );
                ELSE            
            IF( 
UserInGroup"super_ban",$userName ) == )
            
THEN
                  privMsg
"^1You Have A Current Ban From This Server");
                  
privMsg"^1To See When Your Ban Is Over Visit");
                  
privMsg"^2http://supercr3w.ning.com/page/user-report-sys" );
                  
cmdLFS("/ban "  $userName " 30");
            ENDIF
            ENDIF
EndEvent

Event OnNewPlayerJoin
()
    
$userName GetCurrentPlayerVar("UserName");
    
UserGroupFromFile"drive_ban""../user/drive_ban.txt" );
            IF( 
UserInGroup"drive_ban",$userName ) == )
            
THEN
                  privMsg
"^1You Have A Current Ban From Driving");
                  
privMsg"^1To See When Your Ban Is Over Visit");
                  
privMsg"^2http://supercr3w.ning.com/page/user-report-sys" );
                  
cmdLFS("/spec " $userName );
            ENDIF
EndEvent


?>


Last edited by Fire_optikz001, .
Fire_optikz001
S2 licensed
Quote from Krayy :Just remember that you will need to adjust all of the LFSLapper.lpr files for all lapper instances to point to ../admin.txt

BTW, I'll put up some code soon to allow you to add/remove admins while inside LFS.

yay just what i need hmm would that code work with my ban files too?
Fire_optikz001
S2 licensed
well thats what i have i was just asking and by mass i ment multi servers but thats alli needed to know whatnks guys
mass admin file?
Fire_optikz001
S2 licensed
ok i was thinking of a mass admin file
it seems to be working but in my logs i have

Can't open group file : ./default_1/../user/admin.txt

i only get that every once in a while i was thinking is there a way to go up a directory in lapper? like from default_1 into user

or did i do it right?
Fire_optikz001
S2 licensed
Quote from sinanju :
many thanks to fire_optikz001 for spotting my silly bug.


Fire_optikz001
S2 licensed
Quote from Krayy :The problem that you are experiencing looks to me like its due to latency in the lapper code itself. The doCountDown function subtracts the current time in seconds from the predicted button visible time in seconds then updates the text. The problem is that when doing time subtractions in seconds, there is some rounding going on that may cause the function to skip a second. So if you open the button the first time at 3.9 second past the minute, the text wont update till at least 1 second has passed. If the code gets executed 1.2 seconds later, then you are now at 5.1 seconds past the minute. Second 4 has effectively disappeared. This time slip will be cumulative, so I would suspec that if you have a button counting down from 20 or 30, you would see 3 or 4 numbers missed. Give it a test if you can and see what the outcome is.

So the problem could occur at any time, not just for the second number. It also depends on several other factors, like how many buttons are visible, how many of them are countdowns, and if lapper is doing some other things as well.

One possible fix may be to do the time subtractions in milliseconds rather than seconds to make it more accurate. Other things we could is to go through the code and do some tuning to see if the number of system calls, functions and other bits around the countdown stuff can be made faster.

hmm that makes me wonder why can we do that kind of thing with drift? update every millisecond rather then after drift?
Fire_optikz001
S2 licensed
Quote from Krayy :Screenshots? and is there anything in the error logs?

AND do you have pitboard.lpr in the include list in lfslapper.lpr?

i have pitbored on false

i just tried true and it still dont work
Fire_optikz001
S2 licensed
Fire_optikz001
S2 licensed
thw who and !hc commandsarnt they sapposed to show usernames or something? mine is blank :S
Fire_optikz001
S2 licensed
here u go buddy

Event OnResult( $flagConfirm )

# writeline ( langEngine( "%{main_on_result}%" ,GetCurrentPlayerVar("FinishedPos")));

$WinnerName = GetCurrentPlayerVar("NickName");

IF( GetCurrentPlayerVar("FinishedPos") == "1" )

THEN

openGlobalButton( "winner_backing",66,136,74,34,3,10,32," ");
openGlobalButton( "number_1",67,137,10,32,3,10,16,"^01");
openGlobalButton( "winner_title",78,137,62,19,4,10,96,langEngine( "%{main_winnertitle}%" ));
openGlobalButton( "winner_name",78,158,58,10,3,10,64,langEngine( "%{main_winnername}%" ,$WinnerName ));

...

ENDIF

EndEvent

main_winnertitle = "^7Winner";
main_winnername = "^7{0}";

ur error was te red part the blue part is where is hould have gone

...,langEngine( "%{main_winnername}%" [COLOR="Red"])[/COLOR],$WinnerName [COLOR="Blue"])[/COLOR]);

Last edited by Fire_optikz001, .
Fire_optikz001
S2 licensed
ye i was looking at that too thats why i said i may change mobo
Fire_optikz001
S2 licensed
idk about this comp atm the prices are jumping around the cpu was 195 last night now its 250 or so and yet its 239 for the 3.4
Fire_optikz001
S2 licensed
Quote from Jakg :oh wow, thats a beast - a 965 and a 4350? woah!

what?
Fire_optikz001
S2 licensed
oh ye i got that i just reliased i forgot about it i think im gonna get a diff mobo the that too idk yet
my new gaming rig
Fire_optikz001
S2 licensed
my new gaming rig is :
http://secure.newegg.com/WishL ... x?WishListNumber=11243392
+ light scribe dvd drive
+320 gb hdd
+win7 also coming soon
Fire_optikz001
S2 licensed
yep

EDIT: not any more

EDIT 2: oh now it does again seems that the first time it skips after that it dont idk
Last edited by Fire_optikz001, .
Fire_optikz001
S2 licensed
try this ?


$NickName = GetCurrentPlayerVar("NickName");
$Position = GetCurrentPlayerVar("Pos");
$Laps = GetCurrentPlayerVar("LapsDone");
$nickNameFront = GetCurrentPlayerVar( "UNameBefore");
$nickNameBack = GetCurrentPlayerVar( "UNameBehind");
$DriftScore = GetCurrentPlayerVar( "DriftScore" );
$GapBefore = GetCurrentPlayerVar( "GapBefore");
$GapBehind = GetCurrentPlayerVar( "GapBehind");
$LapTime = NumToMSH(GetCurrentPlayerVar("LapTime"));

IF ( $enable_pitboard != "true" )
THEN
$diffLapTimeToPB = NumToMSH( GetCurrentPlayerVar("diffLapTimeToPB"));


openPrivButton( "leaderboardback",1,70,30,34,12,7,16,langEngine("%{main_linespace}%" ));
openPrivButton( "leaderboardname",2,71,28,5,4,7,32,langEngine("%{main_leaderboard}%" )); # This says : LEADERBOARD :

openPrivButton( "leaderboardhandle1",3,77,2,9,12,7,32," "); # This is to make board look like it has slots/handles
openPrivButton( "leaderboardhandle1a",3,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle1b",3,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle2",3,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle2a",3,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle2b",3,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle3",27,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle3a",27,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle3b",27,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle4",27,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle4a",27,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle4b",27,87,2,9,12,7,32," ");

openPrivButton( "playernameback",2,76,28,6,5,7,32," ");
openPrivButton( "playername",6,77,20,5,5,7,16, $NickName); # player who will see board

openPrivButton( "leaderboardtimeback",2,81,28,6,5,7,32," ");
openPrivButton( "leaderboardtimes",5,81,22,5,5,7,0,langEngine("%{main_leaderboardtimes}%",$LapTime, $diffLapTimeToPB)); # laptime + diff to pb

openPrivButton( "pos_lap_backing",2,86,28,6,5,7,32," ");
openPrivButton( "position",7,86,4,6,5,7,0,"P");
openPrivButton( "lap",16,86,4,6,5,7,0,"L");
openPrivButton( "whatposition",10,86,5,6,5,7,32,langEngine("%{main_position}%",$Position)); # P1, P2, P3, etc
openPrivButton( "whatlap",19,86,5,6,5,7,32,langEngine("%{main_lapnumber}%",$Laps)); # L1, L2, L3, etc

openPrivButton( "who_front_backing",2,91,28,6,5,7,32," ");
openPrivButton( "who_front",5,91,24,5,5,7,64,langEngine("%{main_whofrontofme}%",$nickNameFront, $GapBefore)); # Name of driver in front along with gap

openPrivButton( "who_back_backing",2,96,28,6,5,7,32," ");
openPrivButton( "who_back",5,96,24,5,5,7,64,langEngine("%{main_whobackofme}%",$nickNameBack, $GapBehind)); # Name of driver behind along with gap
ENDIF

Fire_optikz001
S2 licensed
Quote from sinanju :I've noticed if I've got my drift meter on, Yisc[NL]'s pitboard, and a few other things at same time, I don't get all of Tim[NL]'s !gui loading - it's usually missing track choices and cars.

Once I close something else down (eg pitboard), then buttons appear ok.

ye im working on a thing where u do lets say gui it whips the screen and when u close it reopens
sounds like fun to code

sinanju wanna help me test come to [SC] Cruise server
Last edited by Fire_optikz001, .
Fire_optikz001
S2 licensed
i have had way more then 239 lol
Fire_optikz001
S2 licensed
i also remade this into a bunch of cool features

CASE "!count":
IF( UserInGroup( "admin",$userName ) == 1 )
THEN
openGlobalButton( "lone_counter",50,63,100,40,100,$argv,0,"^3> %cpt% <", endcounter );
ENDIF
BREAK;
CASE "!countdown":
IF( UserInGroup( "admin",$userName ) == 1 )
THEN
openGlobalButton( "lone_counter",50,63,100,40,100,$argv,0,"^3> %cpt% <", countdown );
ENDIF
BREAK;
CASE "!term":
IF( UserInGroup( "admin",$userName ) == 1 )
THEN
openGlobalButton( "lone_counter",50,63,100,40,100,$argv,0,"^3> %cpt% <", term );
IF( . $argv . == 1)
THEN

cmdLFS("/msg ^1INSIM SHUTAGE IN " . $argv . " SECOND " );
cmdLFS("/msg ^2INSIM SHUTAGE IN " . $argv . " SECOND " );
cmdLFS("/msg ^3INSIM SHUTAGE IN " . $argv . " SECOND " );
cmdLFS("/msg ^4INSIM SHUTAGE IN " . $argv . " SECOND " );
cmdLFS("/msg ^5INSIM SHUTAGE IN " . $argv . " SECOND " );
cmdLFS("/msg ^6INSIM SHUTAGE IN " . $argv . " SECOND " );
cmdLFS("/msg ^7INSIM SHUTAGE IN " . $argv . " SECOND " );

ELSE

cmdLFS("/msg ^1INSIM SHUTAGE IN " . $argv . " SECONDS " );
cmdLFS("/msg ^2INSIM SHUTAGE IN " . $argv . " SECONDS " );
cmdLFS("/msg ^3INSIM SHUTAGE IN " . $argv . " SECONDS " );
cmdLFS("/msg ^4INSIM SHUTAGE IN " . $argv . " SECONDS " );
cmdLFS("/msg ^5INSIM SHUTAGE IN " . $argv . " SECONDS " );
cmdLFS("/msg ^6INSIM SHUTAGE IN " . $argv . " SECONDS " );
cmdLFS("/msg ^7INSIM SHUTAGE IN " . $argv . " SECONDS " );

ENDIF
ENDIF
BREAK;
CASE "!reinit":

IF( UserInGroup( "admin",$userName ) == 1 )
THEN
openGlobalButton( "lone_counter",50,63,100,40,100,$argv,0,"^3> %cpt% <", reinit );
IF( . $argv . == 1)
THEN

cmdLFS("/msg ^1SERVER REBOOT IN " . $argv . " SECOND " );
cmdLFS("/msg ^2SERVER REBOOT IN " . $argv . " SECOND " );
cmdLFS("/msg ^3SERVER REBOOT IN " . $argv . " SECOND " );
cmdLFS("/msg ^4SERVER REBOOT IN " . $argv . " SECOND " );
cmdLFS("/msg ^5SERVER REBOOT IN " . $argv . " SECOND " );
cmdLFS("/msg ^6SERVER REBOOT IN " . $argv . " SECOND " );
cmdLFS("/msg ^7SERVER REBOOT IN " . $argv . " SECOND " );

ELSE

cmdLFS("/msg ^1SERVER REBOOT IN " . $argv . " SECONDS " );
cmdLFS("/msg ^2SERVER REBOOT IN " . $argv . " SECONDS " );
cmdLFS("/msg ^3SERVER REBOOT IN " . $argv . " SECONDS " );
cmdLFS("/msg ^4SERVER REBOOT IN " . $argv . " SECONDS " );
cmdLFS("/msg ^5SERVER REBOOT IN " . $argv . " SECONDS " );
cmdLFS("/msg ^6SERVER REBOOT IN " . $argv . " SECONDS " );
cmdLFS("/msg ^7SERVER REBOOT IN " . $argv . " SECONDS " );
ENDIF
ENDIF
BREAK;

Sub endcounter($KeyFlags,$id)
closePrivButton("lone_counter");
openGlobalButton( "circle_GO",,50,63,100,40,100,3,0,"^2! GO !");
EndSub

Sub countdown($KeyFlags,$id)
closePrivButton("lone_counter");
EndSub

Sub term($KeyFlags,$id)
termLapper();
EndSub


Sub reinit($KeyFlags,$id)
cmdLFS("/reinit" );
EndSub

Quote from sinanju :At someone's request;

Different looking timer (this will be my last!) for newer version of lapper....

Part 1 of code should be added in the same section as other CASE: coding - make sure fitted after a BREAK; line.

Part 2 of code should be added at very end of section where CASE: - BREAK; is, and after End Switch / End Event lines.


V5.844 - Part 1 of code


CASE "!count":
CASE "!Count":
CASE "!COUNT":
IF( UserInGroup( "admin",$userName ) == 1 )
THEN
openGlobalButton( "counter_text1",60,85,20,20,1,3,0,"^7( ^1READY ^7)", onfinishopenstart);
ENDIF
BREAK;

V5.844 - Part 2 of code

Sub onfinishopenstart($KeyFlags,$id)
closePrivButton("counter_text1");
openGlobalButton( "lone_counter",60,85,20,20,1,5,0,"^3> %cpt% <", endcounter );
EndSub
Sub endcounter($KeyFlags,$id)
closePrivButton("counter_text1&lone_counter");
openGlobalButton( "circle_GO",50,75,40,40,1,6,0,"^2! GO !");
EndSub

To make it work, you need to be Admin, and you need to type !count.

If may be you need to play around with text colours, placement and size to get it to work to your personal requirements.

Plenty of posts elsewhere on lapper forum on how to do this.

Colours of this one ok for me, but I've skewed it slightly left as I'm testing something in middle of screen.

Fire_optikz001
S2 licensed
no what it does is reopens the button with the new info such as a schedule action it will reload text again and again except with the updated text.
1 and 2 = how many seconds to delay

its sorta like this :

RegisterScheduleAction( "10 * * * * * * : 30 * * * * * * : 50 * * * * * *", SA_site );
RegisterScheduleAction( "00 * * * * * * : 20 * * * * * * : 40 * * * * * *", SA_time );

Sub SA_time() # Lapper Event
openGlobalButton( "time",69,194,51,6,5,-1,32,"^7Time and Date: ^1" . GetLapperVar("LongTime") ." ^7" . GetLapperVar("LongDate") );
openGlobalButton( "SORT",120,194,20,6,10,-1,32,"^1All times are ^7GMT" );
EndSub

Sub SA_site() # Lapper Event
openGlobalButton( "time",69,194,51,6,5,-1,32,"^7Time and Date: ^1" . GetLapperVar("LongTime") ." ^7" . GetLapperVar("LongDate") );
openGlobalButton( "SORT",120,194,20,6,10,-1,32,"^7SuperCr3w.co.uk" );
EndSub

Quote from sinanju :My code's a lot more condensed, but basically because it's mainly a number count.

Your code is much better if you want something like

ON YOUR MARKS
READY
STEADY
WAIT FOR IT
WAIT FOR IT!
.....
GO!

I haven't got my head round the delay command yet.

On yours you have 2
DelayedCommand( 1, SC1 );
DelayedCommand( 2, SC2 );

I understand the variable SC1/SC2/SC3... for the sub commands, but what do the 1 and 2 signify?

Also. Didn't realise you could re-use the same unique button ("Count") name again and again. I assume that must only be in DelayedCommand?

Last edited by Fire_optikz001, .
Fire_optikz001
S2 licensed
nothing

Quote from Silox :That would be 255 (256?) because (in LFS_External) the ButtonID's get sent through a Byte, which can't be larger then 255 (256?).

But anyway, great!

I wonder what happens if you move while the countdown is counting?

Fire_optikz001
S2 licensed
Quote from sinanju :At someone's request;

Different looking timer (this will be my last!) for newer version of lapper....

Part 1 of code should be added in the same section as other CASE: coding - make sure fitted after a BREAK; line.

Part 2 of code should be added at very end of section where CASE: - BREAK; is, and after End Switch / End Event lines.


V5.844 - Part 1 of code


CASE "!count":
CASE "!Count":
CASE "!COUNT":
IF( UserInGroup( "admin",$userName ) == 1 )
THEN
openGlobalButton( "counter_text1",60,85,20,20,1,3,0,"^7( ^1READY ^7)", onfinishopenstart);
ENDIF
BREAK;

V5.844 - Part 2 of code

Sub onfinishopenstart($KeyFlags,$id)
closePrivButton("counter_text1");
openGlobalButton( "lone_counter",60,85,20,20,1,5,0,"^3> %cpt% <", endcounter );
EndSub
Sub endcounter($KeyFlags,$id)
closePrivButton("counter_text1&lone_counter");
openGlobalButton( "circle_GO",50,75,40,40,1,6,0,"^2! GO !");
EndSub

To make it work, you need to be Admin, and you need to type !count.

If may be you need to play around with text colours, placement and size to get it to work to your personal requirements.

Plenty of posts elsewhere on lapper forum on how to do this.

Colours of this one ok for me, but I've skewed it slightly left as I'm testing something in middle of screen.

thats sweet
Fire_optikz001
S2 licensed
THIS WORKS 2

CASE "!count":
CASE "!Count":
CASE "!COUNT":

IF( UserInGroup( "admin",$userName ) == 1 )
THEN
DelayedCommand( 1, SC1 );
ENDIF
BREAK;

Sub SC1()
openGlobalButton( "Count",92,78,20,40,5,-1,0,"^3R E A D Y");
DelayedCommand( 2, SC2 );
EndSub
Sub SC2()
openGlobalButton( "Count",92,78,20,40,5,-1,0,"^13");
DelayedCommand( 2, SC3 );
EndSub
Sub SC3()
openGlobalButton( "Count",92,78,20,40,5,-1,0,"^12");
DelayedCommand( 2, SC4 );
EndSub
Sub SC4()
openGlobalButton( "Count",92,78,20,40,5,-1,0,"^11");
DelayedCommand( 2, SC5 );
EndSub
Sub SC5()
openGlobalButton( "Count",92,78,20,40,5,3,0,"^2Go");
EndSub

Last edited by Fire_optikz001, .
Fire_optikz001
S2 licensed
the very end
FGED GREDG RDFGDR GSFDG