<?php
###################################
#Event triggered when lapper start#
###################################
Event OnLapperStart()
#Create Global variables
Globalvar $Loop_On; $Loop_On = 0;
EndEvent
#################
#Command actions#
#################
Event OnMSO( $userName, $text ) # Player event
$idxOfFirtsSpace = indexOf( $text, " ");
IF( $idxOfFirtsSpace == -1 ) THEN
$command = $text;
$argv = "";
ELSE
$command = subStr( $text,0,$idxOfFirtsSpace );
$argv = trim( subStr( $text,$idxOfFirtsSpace ) );
ENDIF
SWITCH( $command )
#Stop loop & close button for all players
CASE "!loopoff":
$Loop_On = 0;
#Get list of players sorted by Username
$Racers = GetListOfPlayers("U");
#FOREACH Loop
FOREACH( $Var IN $Racers )
closeButton( $Var["value"], "speed");
ENDFOREACH
BREAK;
#Start loop
CASE "!loopon":
$Loop_On = 1;
globalmsg("execute sub Set_Loop()");
Set_Loop(); #Goto Set_Loop Sub-routine
BREAK;
ENDSWITCH
EndEvent
Sub Set_Loop()
IF ($Loop_On == 1) THEN
#Get list of players sorted by Username
$Racers = GetListOfPlayers("U");
FOREACH( $Var IN $Racers ) #For each player in the server
#$Var["value"] = Username
openButton( $Var["value"], "speed",175,124,25,5,5,2,96,"^7" . GetPlayerVar( $Var["value"], "InstantSpeed") . " " . GetPlayerVar( $Var["value"], "UnitSpeed")."^8 (".GetPlayerVar( $Var["value"], "Car").")");
DelayedCommand( 1, Set_Loop); #1 second delay
ENDFOREACH
ENDIF
EndSub
?>
<?php
Sub semaforo1( $userName,$ZoneID)
#privmsg("Sub semaforo1"); #Debug message
startlightcontrol(5,149,22,1);
HostDelayedCommand( 5, semaforo3 );
EndSub
Sub semaforo3($keyflags) #This is not a priv sub-routine anymore
#globalmsg("Sub semaforo3"); #Debug message
startlightcontrol(5,149,22,8);
EndSub
?>
<?php
Sub semaforo1( $userName,$ZoneID)
startlightcontrol(5,149,22,1);
HostDelayedCommand( 5, semaforo3 );
EndSub
Sub semaforo3()
startlightcontrol(5,149,22,8);
EndSub
?>
#closeprivbutton("DAM_YLoc_X_Axis&DAM_YLoc_Y_Axis");
#closeprivbutton("DAM_Bgddark&DAM_BgdLight&DAM_Title&DAM_YLoc_Title&DAM_YLoc_X_Title&DAM_YLoc_Y_Title&DAM_YLoc_XY");
#closeprivbutton("DAM_Cfg_Title&DAM_Cfg_FileName&DAM_Cfg_ButtonID&DAM_Cfg_WoA&DAM_Cfg_SubEnter&DAM_Cfg_SubLeave&DAM_Cfg_X-Axis&DAM_Cfg_Y-Axis");
#closeprivbutton("DAM_Cfg_FileName_01&DAM_Cfg_ButtonID_01&DAM_Cfg_WoA_01&DAM_Cfg_SubEnter_01&DAM_Cfg_SubLeave_01&DAM_Cfg_X-Axis_01&DAM_Cfg_Y-Axis_01");
#closeprivbutton("DAM_Test&DAM_Edit&DAM_Save&DAM_Close&DAM_Expand&DAM_GoTo&DAM_Spare1");
closeButtonRegex (GetCurrentPlayerVar("UserName"), "DAM_*");
<?php
Sub SetLanguage( $KeyFlags,$ButtonID )
#Cut the first 5 chars of the buttonID , result = 'en'
$language = trim( subStr( $ButtonID,5 ) );
#When the value/string of $language is equal to 'en'
IF ($language == "en") THEN
#Set player language to English
SetCurrentPlayerVar("IdLang","en");
#DEBUG MESSAGE
privmsg("Language selected");
#Display Text
openPrivButton( "example",75,111,50,10,5,-1,ISB_DARK, langEngine("%{example}%"));
ENDIF
EndSub
Lang "EN"
example = "This text is an exampletext";
EndLang
?>
SMALL_LCS, // 9 - instruction : set local car switches (lights, horn, siren)
// CAR SWITCHES
// ============
// To operate the local car's lights, horn or siren you can send this IS_SMALL :
// ReqI : 0
// SubT : SMALL_LCS (Local Car Switches)
// UVal : Switches (see below)
// Switches bits
// Bits 0 to 7 are a set of flags specifying which values to set. You can set as many
// as you like at a time. This is to allow you to set only the values you want to set
// while leaving the others to be controlled by the user.
#define LCS_SET_SIGNALS 1 // bit 0
#define LCS_SET_FLASH 2 // bit 1
#define LCS_SET_HEADLIGHTS 4 // bit 2
#define LCS_SET_HORN 8 // bit 3
#define LCS_SET_SIREN 0x10 // bit 4
// Depending on the above values, InSim will read some of the following values and try
// to set them as required, if a real player is found on the local computer.
// bits 8-9 (Switches & 0x0300) - Signal (0 off / 1 left / 2 right / 3 hazard)
// bit 10 (Switches & 0x0400) - Flash
// bit 11 (Switches & 0x0800) - Headlights
// bits 16-18 (Switches & 0x070000) - Horn (0 off / 1 to 5 horn type)
// bits 20-21 (Switches & 0x300000) - Siren (0 off / 1 fast / 2 slow)
SetStoredValue("varname", $value) - sets a variable
GetStoredValue("varname") - returns variable as a string
GetStoredNum("varname") - returns variable as a numeric (or as -1 if it's not a number), so you don't need to do a ToNum($var) conversion if you're doing numeric comparisons
SetUserStoredValue($username, "varname", $value) - Sets a variable
GetUserStoredValue($username, "varname") - returns variable as a string
GetUserStoredNum($username, "varname") - returns variable as a numeric
Event OnDistDone( $userName ) # Player event
EndEvent
SetUserStoredValue($username,"TotalDistance",GetUserStoredValue($username,TotalDistance)+100);
string user = StrMsg[1];
// Split string on spaces.
// ... This will separate all the words.
string[] username = user.Split(' ');
string UName = username[0] + " " + username[1];
if (C.Username == StrMsg[1])
{
blah
}
else if (C.Username == UName)
{
blahblah
}
else
{
InSim.Send_MTC_MessageToConnection("^4|^7 Username not found.", MSO.UCID, 0);
}
V1.08 (02-07-2017)
New: PlayerHud: Contains Racetimer/Messages/Penalty's etc
New: Classes/Air restriction system
Update: Penaltysystem: Add Scenery objects to Penaltylist
Update: Helpmenu: Add new Tab :Serverinfo ( for now Penalty's and Car restiction)