Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name _v92_/reporting_mark
- @inputs [ReportingMark RunningNumber]:string
- @persist [Str_DefaultReportingMark Str_DefaultRunningNumber]:string
- if( first( ) | dupefinished( ) ){
- B_AutoParent = 0 # Autoparent to whatever you shoot
- Str_DefaultReportingMark = "IDKX" # Default reporting mark to use if "ReportingMark" isn't wired
- Str_DefaultRunningNumber = "1992" # Default running number to use if "RunningNumber" isn't wired
- local E = entity( )
- E:propShadow( 0 ) # Make the E2 not cast shadows
- E:setMaterial( "magtrains/invisible" ) # Make the E2 invisible
- local F_Scale = 0.9 # Scale
- local Vec_Color = vec( 255 ) # Colour
- local Str_Material = "models/proppertextures/acrylic" # Material
- local F_Offset_Y = 0 # Offset in units
- local F_Offset_Z = 0 # Offset in units
- local B_Vertical = 0 # Make text vertical
- if( B_Vertical ){ # If vertical mode is enabled...
- holoCreate( 0 , E:toWorld( F_Scale * vec( -6 , F_Offset_Y , ( F_Offset_Z / F_Scale ) ) ) , F_Scale * vec( 1 ) , E:angles( ) , Vec_Color , "models/magtrains/reportingmark.mdl" )
- holoCreate( 1 , E:toWorld( F_Scale * vec( 6 , F_Offset_Y , ( F_Offset_Z / F_Scale ) ) ) , F_Scale * vec( 1 ) , E:angles( ) , Vec_Color , "models/magtrains/runningnumber.mdl" )
- } else { # Else use horizontal mode...
- holoCreate( 0 , E:toWorld( F_Scale * vec( 0 , ( -30 + F_Offset_Y ) , ( F_Offset_Z / F_Scale ) ) ) , F_Scale * vec( 1 ) , E:angles( ) , Vec_Color , "models/magtrains/reportingmark.mdl" )
- holoCreate( 1 , E:toWorld( F_Scale * vec( 0 , ( 42 + F_Offset_Y ) , ( F_Offset_Z / F_Scale ) ) ) , F_Scale * vec( 1 ) , E:angles( ) , Vec_Color , "models/magtrains/runningnumber.mdl" )
- }
- ####################
- # You probably shouldn't need to edit anything past this break
- # Probably.
- ####################
- holoParent( 0 , E ) # Parent the reporting mark model to the E2
- holoParent( 1 , E ) # Parent the running number model to the E2
- holoMaterial( 0 , Str_Material )
- holoMaterial( 1 , Str_Material )
- if( B_AutoParent ){ # If autoparent is enabled, parent this thing to what you hit
- if( E:isWeldedTo( ):isValid( ) ){
- E:parentTo( E:isWeldedTo( ) )
- #ifdef entity:constraintBreak( entity )
- E:constraintBreak( E:isWeldedTo( ) )
- #endif
- }
- }
- }
- ####################
- # Reporting Mark
- ####################
- if ( ->ReportingMark ){
- Repmark = ReportingMark:lower( )
- }else{
- Repmark = Str_DefaultReportingMark:lower( )
- }
- local ReportingMarkNumberLength = Repmark:length( )
- Repmark = " ":repeat( 4 - ReportingMarkNumberLength ) + Repmark
- for( N = 1 , 4 ) {
- local I = Repmark:index( N )
- if( I == "" | I == " " ){
- holoBodygroup( 0 , N , 26 )
- } else {
- holoBodygroup( 0 , N , toByte( I ) - 97 )
- }
- }
- ####################
- # Running Number
- ####################
- if ( ->RunningNumber ) {
- Number = RunningNumber:lower( )
- }else{
- Number = Str_DefaultRunningNumber:lower( )
- }
- local RunningNumberLength = Number:length( )
- Number = Number + " ":repeat( RunningNumberLength )
- for ( N = 1 , 6 ) {
- local I = Number:index( N )
- if ( I == "" | I == " " ) {
- holoBodygroup( 1 , N , 10 )
- }else{
- holoBodygroup( 1 , N , I:toNumber( ) )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement