<?php
IF ( ButtonExists(GetCurrentPlayerVar("UserName"), $DialogPrefix . ".*bg") == FALSE)
THEN
DialogCreate ( GetCurrentPlayerVar("UserName"), $DialogPrefix, $origL-1, $origT, $Width, $Height, $DialogTitle, $ShowClose, $secondsDisplayed);
ENDIF
?>
<?php
$GripDatabase = "./GripPB"
$DriftDatabase = "./DriftPB";
?>
<?php
closePrivButtonRegex ("dowho.*");
?>
<?php
# Race type
const RACEINPROG_NONE 0; # Race not in progress
const RACEINPROG_RACE 1; # Race
const RACEINPROG_QUALIFY 2; # Qualify
?>
<?php
CatchEvent OnLap( $userName ) # Player event
# Update event lap count
SetCurrentPlayerVar ( "Sector", 1 );
$RaceLaps = GetCurrentPlayerVar ("RaceLaps");
$RaceLaps = $RaceLaps + 1;
SetCurrentPlayerVar ( "RaceLaps", $RaceLaps );
SetUserStoredValue ( "RaceLaps", $RaceLaps);
# Update the PB if the current lap is faster than the PB
$RacePB = GetCurrentPlayerVar("RacePB");
$CurrLapTime = GetCurrentPlayerVar ("LapTime");
IF ( ToNum($RacePB) < 1 || ToNum($CurrLapTime) < ToNum($RacePB) )
THEN
SetCurrentPlayerVar ( "RacePB", $CurrLapTime );
SetUserStoredValue ( "RacePB", $CurrLapTime);
ENDIF
RaceTickerUpdate();
EndCatchEvent
CatchEvent OnSplit1( $userName ) # Player event
SetCurrentPlayerVar ( "Sector", 2 );
EndCatchEvent
CatchEvent OnSplit2( $userName ) # Player event
SetCurrentPlayerVar ( "Sector", 3 );
EndCatchEvent
CatchEvent OnSplit3( $userName ) # Player event
SetCurrentPlayerVar ( "Sector", 4 );
EndCatchEvent
?>
<?php
newCfg.CurrApp.registerCallBackFunction("adminmsg", adminmsg);
...
public void adminmsg(GLScript.unionVal val, ArrayList args)
{
infoPlayer currInfoPlayer;
string ident = val.nameFunction;
testArgs(ident, "S", args);
string text = args[0].ToString();
string newText = "";
uGroup.clear( "admin");
uGroup.addUserFromFile("admin",newCfg.varsLapper.WorkingDir + "/" + newCfg.varsLapper.AdminFile );
foreach (DictionaryEntry de in listOfPlayers.playersUCID)
{
currInfoPlayer = (infoPlayer)de.Value;
if (uGroup.userExist("admin", currInfoPlayer.userName) || currInfoPlayer.UCID == 0)
{
if (text == "[[TranslateEngine]]")
newText = lfsLang.replaceParmsLangStr(currInfoPlayer.idLang);
else
newText = text;
SendMsgToConnection(currInfoPlayer.UCID, newText);
}
}
}
?>
<?php
Sub DEBUG ($msg)
IF ( $DebugOn > 0 )
THEN
adminMsg( "^5DEBUG: ^8" . $msg );
ENDIF
EndSub
Sub ADMIN ($msg)
IF ( $DebugOn > 0 )
THEN
adminMsg( "^7ADMIN: ^8" . $msg );
ENDIF
EndSub
Event OnRaceStart( $NumP ) # Lapper event
ADMIN ("Race starting: " . $NumP);
DEBUG ("Race type is: " . getLapperVar( "RaceInProg" ));
EndEvent
?>
<?php
$a_user_array[$x, "username"] = $userName;
$a_user_array[$x, "finishedpos"] = GetCurrentPlayerVar("FinishedPos");
?>
<?php
$a_user_array[$x, "username"] = ToString($userName);
$a_user_array[$x, "finishedpos"] = ToNum(GetCurrentPlayerVar("FinishedPos"));
?>
<?php
public void deleteButtonRegex(string pattern, int UCID)
{
ArrayList al = new ArrayList();
foreach (DictionaryEntry de in hashMsgBox)
{
box currBox = (box)de.Value;
if (Regex.IsMatch(currBox.id, pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
{
al.Add((string) currBox.id);
}
}
string[] butToClose = (string[]) al.ToArray(typeof(string));
for (int i = 0; i < butToClose.Length; i++)
{
this.delete(butToClose[i], UCID);
}
}
?>
<?php
public void privateButtonCloseRegex(string argString)
{
this.playerBox.deleteButtonRegex(argString, this.UCID);
}
?>
<?php
newCfg.CurrApp.registerCallBackFunction("closebuttonregex", closebuttonregex);
newCfg.CurrApp.registerCallBackFunction("closeprivbuttonregex", closeprivbuttonregex);
...
public void closebuttonregex(GLScript.unionVal val, ArrayList args)
{
infoPlayer currPly;
string ident = val.nameFunction;
currPly = listOfPlayers.getPlayerByUserName((string)args[0]);
if (currPly == null)
{
throw new GLScript.GLApp.GLScriptException("Player name " + (string)args[0] + " in function " + ident + " not a player");
}
args.RemoveAt(0);
testArgs(ident, "S", args);
currPly.privateButtonCloseRegex(args[0].ToString());
}
public void closeprivbuttonregex(GLScript.unionVal val, ArrayList args)
{
infoPlayer currInfoPlayer = newCfg.getCurrInfoPlayer();
string ident = val.nameFunction;
if (currInfoPlayer == null)
throw new GLScript.GLApp.GLScriptException("You can't use " + ident + " in this context, not a player event");
testArgs(ident, "S", args);
currInfoPlayer.privateButtonCloseRegex(args[0].ToString());
}
?>
<?php
Sub kGUIclose ( $KeyFlags, $id )
$GUIprefix = split( $id,"_",0 );
closePrivButtonRegex ($GUIprefix . ".*");
EndSub
?>
<?php
Sub kGUICreate ( $userName, $GUIprefix, $origL, $origT, $GUIwidth, $GUIHeight, $GUItitle, $showClose, $secondsDisplayed)
# Draw window titles with Prev, Next and Close buttons
openButton ( $userName, $GUIprefix . "_bg",$origL-1,$origT-10,$GUIwidth+2,$GUIHeight+18,1,-1,16,"");
openButton ( $userName, $GUIprefix . "_title",$origL,$origT-10,$GUIwidth,10,5,-1,0,"^0" . $GUItitle );
IF ($showClose == true)
THEN
openButton ( $userName, $GUIprefix . "_close",81,$origT+$GUIHeight+1,38,6,8,-1,16,"^0[ Close This Dialog ]",kGUIclose );
ENDIF
# Draw the main contents window on top of the titles
openButton ( $userName, $GUIprefix . "_contents_bg",$origL,$origT,$GUIwidth,$GUIHeight,1,-1,32,"");
EndSub
Sub kGUIclose ( $KeyFlags, $id )
$GUIprefix = split( $id,"_",0 );
closePrivButtonRegex ($GUIprefix);
EndSub
?>
<?php
Sub AutoTrackChangeOff($KeyFlags,$id)
IF($AutoTrackChange == "off")
THEN
privMsg( "^7>ATC ALREADY TURNED ^1OFF!!!");
ELSE
$AutoTrackChange = "off";
RemoveScheduleAction( SA_RotateTrack0 );
RemoveScheduleAction( SA_RotateTrack3 );
RemoveScheduleAction( SA_RotateTrack6 );
RemoveScheduleAction( SA_RotateTrack9 );
RemoveScheduleAction( SA_RotateTrack12 );
RemoveScheduleAction( SA_RotateTrack15 );
RemoveScheduleAction( SA_RotateTrack18 );
RemoveScheduleAction( SA_RotateTrack21 );
cmdLFS("/msg ^7>" . GetCurrentPlayerVar("Nickname") . "^7 Turned ATC ^1OFF!!!" );
ENDIF
ClosePrivButton("ATCONOFF&ATCON&ATCOFF");
EndSub
?>
<?php
CatchEvent OnLapperStart()
DelayedCommand( 120, ShowAnnouncement );
EndCatchEvent
Sub ShowAnnouncement ()
globalMsg( "Visit our website at http://isntthisannoying.com");
DelayedCommand( 120, ShowAnnouncement );
EndSub
?>