############################################################################# # LFS Lapper Multi-Page Help System by Krayy ############################################################################# # This is a more flexible Help system that allows the addition of extra help # descriptions without encroaching on available screen area. ############################################################################# # Ver 1.0.1 - 15 Jan 2010 Initial release # Ver 1.0.2 - 16 Jan 2010 Minor updates to display ############################################################################# CatchEvent OnLapperStart() GlobalVar $maxHelpPages; $maxHelpPages = 4; # maximum number of pages for help...increase when new help pages added EndCatchEvent CatchEvent OnMSO( $userName, $text ) # Player event $idxOfFirstSpace = indexOf( $text, " "); IF( $idxOfFirstSpace == -1 ) THEN $command = $text; $argv = ""; ELSE $command = subStr( $text,0,$idxOfFirstSpace ); $argv = trim( subStr( $text,$idxOfFirstSpace ) ); ENDIF SWITCH( $command ) CASE "!help": DoMultiPageHelp(0, "multihelp_header_1"); BREAK; ENDSWITCH EndCatchEvent ############################ #Replacement Help Functions# ############################ Sub DoMultiPageHelp ( $KeyFlags, $id ) $PageNum = ToNum(split( $id,"_",2 )); # Display the help menu title openPrivButton ( "help_title",44,26,112,10,5,-1,32,langEngine( "%{multihelp_header}%", $PageNum) ); openPrivButton ( "help_bg",44,36,112,107,1,-1,32,""); # Display the help text openPrivButton ( "help_contents",45,36,110,6,5,-1,64,langEngine( "%{multihelp_contents_" . $PageNum . "}%") ); # Display the help menu buttons openPrivButton( "helpbutton_close",44,145,25,10,8,-1,32,"^3Close",helpClose ); FOR ($i=1; $i < $maxHelpPages+1; $i=$i+1) IF ( ToNum($PageNum) == ToNum($i) ) # Print a Prev button if the page is greater than 1 THEN openPrivButton ( "helpbutton_num_" . $i,66 + (7 * $i),145,6,10,8,-1,32,"^3" . $i,DoMultiPageHelp ); ELSE openPrivButton ( "helpbutton_num_" . $i,66 + (7 * $i),145,6,10,8,-1,32,"^8" . $i,DoMultiPageHelp ); ENDIF ENDFOR EndSub Sub helpClose( $KeyFlags,$id ) closePrivButton("help_title&help_contents&helpbutton_close&helpbutton_prev&helpbutton_next&help_bg"); FOR ($i=0; $i < $maxHelpPages+1; $i=$i+1) closePrivButton ("helpbutton_num_".$i); ENDFOR EndSub Lang "EN" # Race Events messages multihelp_header = "^7LFSLapper Help Page {0}"; multihelp_contents_1 = "^2Custom Commands" . "%nl%^3!event ^8- Set up race event" . "%nl%^3!admins ^8- Add or display admins" . "%nl%^3!sc ^8- Deploy or Manage Safety Car"; multihelp_contents_2 = "^2General Player commands" . "%nl%^3!cleanspb ^8- Reset this sessions PBs" . "%nl%^3!groupqual ^8- Show group qualifying pos" . "%nl%^3!hand [name] ^8- Show current handicap" . "%nl%^3!hc ^8- Show all players current handicaps" . "%nl%^3!laps ^8- Total laps done for this car/track + session" . "%nl%^3!license [name] ^8- Display license status" . "%nl%^3!myconfig ^8- Configure split time display" . "%nl%^3!mypb [cars] ^8- Show user PBs for set of cars" . "%nl%^3!pos ^8- Show friendly position" . "%nl%^3!stats [name] ^8- Display user stats" . "%nl%^3!statsqual [name] ^8- Display user stats" . "%nl%^3!who ^8- Display connected user info and stats" . "%nl%" . "%nl%^2Pit Board Setup and Info" . "%nl%^3!pbclose ^8- Close pit board" . "%nl%^3!pbconfig ^8- Configure Pit Board" . "%nl%^3!pit ^8- Pit stop info" . "%nl%^3!pitwindow ^8- Configure pit windows"; multihelp_contents_3 = "^2Track/Race Info" . "%nl%^3!distance ^8- Show track distance" . "%nl%^3!near [name] ^8- Show top 14 drivers near your ranking" . "%nl%^3!nearqual [name] ^8- Show top qualifiers near your time" . "%nl%^3!spb ^8- Show splits" . "%nl%^3!top [car] ^8- Show top drivers with this track/car" . "%nl%^3!topqual [car] ^8- Show top qual times with this car" . "%nl%^3!track ^8- Show current track information" . "%nl%" . "%nl%^2Drifting Info" . "%nl%^3!drf [name] ^8- " . "%nl%^3!drfnear [name] ^8- " . "%nl%^3!drfnearqual [name] ^8- " . "%nl%^3!drfqual [name] ^8- " . "%nl%^3!dstats [name] ^8- " . "%nl%^3!dstatsqual [name] ^8- " . "%nl%" . "%nl%^2LFSLapper Info" . "%nl%^3!time ^8- Show local server time" . "%nl%^3!powered ^8- Show Copyright Notice" . "%nl%^3!ver ^8- Show LFSLapper version"; multihelp_contents_4 = "^2Admin Commands" . "%nl%^3!ban [username] ^8- Ban [username] from server" . "%nl%^3!ctrack ^8- Configure track (GUI)" . "%nl%^3!groupcmdlfs [cmd] ^8- Execute [cmd] on all players" . "%nl%^3!gui ^8- Update race config GUI" . "%nl%^3!hc ^8- Set player handicaps" . "%nl%^3!kick [username] ^8- Kick [username] from server" . "%nl%^3!node ^8- LFS Server Node number" . "%nl%^3!pwgui ^8- GUI to set race pit windows" . "%nl%^3!sc ^8- Deploy Safety Car" . "%nl%^3!term ^8- Terminate LFSLapper" . "%nl%^3!zone ^8- Display current node on track"; EndLang