Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mapscript = {}
- function SetUpBomb() --Step 1
- print( "Function SetUpBomb called" )
- bombkeypad:SetNWString("NZText", "")
- uraniumkeypad:SetNWString("NZText", "Press E to re-route all extra power to the back-up system." )
- print( debug.traceback() )
- end
- function SetUpUranium() --Step 2
- print( "Function SetUpUranium called" )
- uraniumkeypad:SetNWString("NZText", "")
- transportkeypad:SetNWString("NZText", "Press E to stop transportation of fuel to generator.")
- end
- function SetUpTransport() --Step 3
- print( "Function SetUpTransport called" )
- transportkeypad:SetNWString("NZText", "")
- serverkeypad:SetNWString("NZText", "Press E to restart the generator server.")
- --DELETE ALL FUEL CELLS HERE
- end
- function SetUpServer() --Step 4
- print( "Function SetUpServer called" )
- serverkeypad:SetNWString("NZText", "")
- keyboard:SetNWString("NZText", "Press E to restart the system.")
- end
- function SetUpKeyboard() --Step 5
- print( "Function SetUpKeyboard called" )
- keyboard:SetNWString("NZText", "The system has been restarted. It is safe to enter the generator room.")
- ents.FindByClass( "invis_damage_wall" )[1]:Remove()
- end
- function mapscript.OnGameBegin()
- nzEE.Major:Cleanup()
- nzEE.Major:SetCurrentStep(1)
- print( "Game has begun, cleaning up steps" )
- --//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--
- print( "Setting up bombkeypad" )
- bombkeypad = ents.GetMapCreatedEntity( 1932 ) --Map placed keypad
- bombkeypad:SetNWString("NZText", "You must turn on the power first.")
- bombkeypad.OnUsed = function(self, ply)
- if !nzElec.Active then return end
- print( "bombkeypad has been pressed, step ", nzEE.Major.CurrentStep )
- nzEE.Major:CompleteStep( 1 )
- end
- --//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--
- print( "Setting up uraniumkeypad" )
- uraniumkeypad = ents.Create( "nz_script_prop" ) --At player spawn
- uraniumkeypad:SetModel( "models/props_lab/keypad.mdl" )
- uraniumkeypad:SetPos( Vector(2664.217773, -804.056030, -67.161697) )
- uraniumkeypad:SetAngles( Angle(0.000, 0.000, 0.000) )
- uraniumkeypad:Activate()
- uraniumkeypad:SetNWString("NZText", "You must turn on the power first.")
- uraniumkeypad.OnUsed = function(self, ply)
- print( "uraniumkeypad has been pressed" )
- nzEE.Major:CompleteStep( 2 )
- end
- --//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--
- print( "Setting up transportkeypad" )
- transportkeypad = ents.Create( "nz_script_prop" ) --By the transport lines
- transportkeypad:SetModel( "models/props_lab/keypad.mdl" )
- transportkeypad:SetPos( Vector(2040.146973, 755.274475, -135.572998) )
- transportkeypad:SetAngles( Angle(-0.000, -135.000, -0.000) )
- transportkeypad:Activate()
- transportkeypad:SetNWString("NZText", "You must turn on the power first.")
- transportkeypad.OnUsed = function(self, ply)
- print( "transportkeypad has been pressed" )
- nzEE.Major:CompleteStep( 3 )
- end
- --//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--
- print( "Setting up serverkeypad" )
- serverkeypad = ents.Create( "nz_script_prop" ) --By the server machine
- serverkeypad:SetModel( "models/props_lab/keypad.mdl" )
- serverkeypad:SetPos( Vector(896.641296, -2195.425781, 50.405800) )
- serverkeypad:SetAngles( Angle(-0.000, 180.000, 0.000) )
- serverkeypad:Activate()
- serverkeypad:SetNWString("NZText", "You must turn on the power first.")
- serverkeypad.OnUsed = function(self, ply)
- print( "serverkeypad has been pressed" )
- nzEE.Major:CompleteStep( 4 )
- end
- --//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--
- print( "Setting up keyboard" )
- keyboard = ents.Create( "nz_script_prop" ) --Keyboard used as final step
- keyboard:SetModel( "models/props_c17/computer01_keyboard.mdl" )
- keyboard:SetPos( Vector(861.911011, -784.504089, -22.218945) )
- keyboard:SetAngles( Angle(-11.044, 104.943, 0.009) )
- keyboard:Activate()
- keyboard:SetNWString("NZText", "You must turn on the power first.")
- keyboard.OnUsed = function(self, ply)
- print( "keyboard has been pressed" )
- nzEE.Major:CompleteStep( 5 )
- end
- print( "Checking button validity..." )
- print( "'Uranium' keypad...", IsValid(uraniumkeypad) )
- print( "'Transport' keypad...", IsValid(transportkeypad) )
- print( "'Server' keypad...", IsValid(serverkeypad) )
- print( "'Keyboard' keypad...", IsValid(keyboard) )
- print( "Testing OnUse functionality...")
- print( "'Uranium' keypad...", uraniumkeypad.OnUse )
- print( "'Transport' keypad...", transportkeypad.OnUse )
- print( "'Server' keypad...", serverkeypad.OnUse )
- print( "'Keyboard' keypad...", keyboard.OnUse )
- print( "Caching steps 1-5 into gamemode" )
- nzEE.Major:AddStep(SetUpBomb, 1)
- nzEE.Major:AddStep(SetUpUranium, 2)
- nzEE.Major:AddStep(SetUpTransport, 3)
- nzEE.Major:AddStep(SetUpServer, 4)
- nzEE.Major:AddStep(SetUpKeyboard, 5)
- end
- --//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--
- -- Any function added to this table will automatically get hooked to the hook with the same name
- function mapscript.RoundInit()
- --[[uraniumkeypad:Spawn()
- transportkeypad:Spawn()
- serverkeypad:Spawn()
- keyboard:Spawn()]]
- end
- function mapscript.ElectricityOn()
- print( "Electricity has been turned on! Setting keypad strings..." )
- bombkeypad:SetNWString("NZText", "Press E to de-activate the self-destruct systems.")
- uraniumkeypad:SetNWString("NZText", "You must de-activate the self-destruct sytems before attempting to re-route the power.")
- transportkeypad:SetNWString("NZText", "You must re-route extra power to the back-up system before stopping the fuel line.")
- serverkeypad:SetNWString("NZText", "You must stop the transportation of fuel before restarting the generator server.")
- keyboard:SetNWString("NZText", "The server must be restarted before any operations continue.")
- end
- -- This one will be called at the start of each round
- function mapscript.RoundStart()
- end
- -- Will be called every second if a round is in progress (zombies are alive)
- function mapscript.RoundThink()
- end
- -- Will be called after each round
- function mapscript.RoundEnd()
- end
- -- Only functions will be hooked, meaning you can safely store data as well
- mapscript.TestPrint = "v0.0"
- local testprint2 = "This is cool" -- You can also store the data locally
- -- Always return the mapscript table. This gives it on to the gamemode so it can use it.
- return mapscript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement