Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local marker = {
- toout = {X=28.451171875,Y=-2649.3642578125,Z=40.477230072021},
- toin = {X=15.1142578125,Y=-2655.5927734375,Z=40.322879791261}
- }
- local stationblips = {}
- stationblips[0] = createBlip(1437.7900390625,2632.25,12.125619888306,61)
- stationblips[1] = createBlip(2864.75,1304.134765625,12.125619888306,61)
- stationblips[2] = createBlip(1741.080078125,-1953.7666015625,14.875619888306,61)
- stationblips[3] = createBlip(817.5712890625,-1347.6533203125,13.526706695557,61)
- stationblips[4] = createBlip(-1944.310546875,121.2353515625,27.000619888306,61)
- MAINTRAIN = createVehicle ( 538, -1978.4736328125,-865.193359375,27.000619888306, 180)
- setTimer(function()
- createBlipAttachedTo(MAINTRAIN,52)
- setElementData(MAINTRAIN,"bremst",false)
- setTrainDerailable(MAINTRAIN,false)
- setTrainSpeed(MAINTRAIN,0.61)
- setElementData(MAINTRAIN,"fahren",true)
- setTimer(function()
- if getElementData(MAINTRAIN,"fahren") == true then
- setTrainSpeed(MAINTRAIN,1.8)
- end
- end,1*1000,0)
- end,5000,1)
- local stations = {}
- stations[0] = {
- Name = "San Fierro",
- x = -1952.7197265625,
- y= 71.970703125,
- w = 17,
- h = 120
- }
- addCommandHandler("cm",function(p)
- setCameraTarget(p,p)
- end)
- addCommandHandler("ctr",function(p)
- warpPedIntoVehicle(p,MAINTRAIN,1)
- end)
- function triggerTrain(dingsbums)
- if dingsbums and dingsbums == MAINTRAIN then
- if getElementType(dingsbums) == "vehicle" and not getElementData(dingsbums,"bremst") then
- setElementData(MAINTRAIN,"fahren",false)
- setElementData(dingsbums,"bremst",true)
- setTimer(function()
- setTimer(function()
- setTrainSpeed(MAINTRAIN,getTrainSpeed(MAINTRAIN)/2)
- setTimer(function()
- setTrainSpeed(MAINTRAIN,getTrainSpeed(MAINTRAIN)/2)
- setTimer(function()
- setTrainSpeed(MAINTRAIN,getTrainSpeed(MAINTRAIN)/2)
- setTimer(function()
- setTrainSpeed(MAINTRAIN,0)
- end,250,1)
- end,250,1)
- end,250,1)
- end,250,1)
- end,50,20)
- setTimer(function()
- setElementFrozen(dingsbums,true)
- setTrainSpeed(dingsbums,0)
- setTimer(function()
- setElementFrozen(dingsbums,false)
- setTrainSpeed(MAINTRAIN,0.1)
- setTimer(function()
- setTrainSpeed(MAINTRAIN,0.2)
- setTimer(function()
- setTrainSpeed(MAINTRAIN,0.4)
- setTimer(function()
- setTrainSpeed(MAINTRAIN,0.6)
- setTimer(function()
- setTrainSpeed(MAINTRAIN,0.8)
- setTimer(function()
- setTrainSpeed(MAINTRAIN,1.6)
- setElementData(dingsbums,"bremst",false)
- setElementData(dingsbums,"fahren",true)
- end,650,1)
- end,650,1)
- end,650,1)
- end,650,1)
- end,650,1)
- setTimer(function()
- setElementFrozen(dingsbums,false)
- setElementData(dingsbums,"fahren",false)
- setElementData(dingsbums,"bremst",true)
- end,180*200,1)
- end,7000,1)
- end,1000,1)
- end
- end
- end
- for i,k in pairs(stations) do
- local x,y,w,h = k.x,k.y,k.w,k.h
- local kubus = createColRectangle(x,y,w,h)
- addEventHandler ( "onColShapeHit", kubus,triggerTrain)
- outputDebugString("created station "..k.Name)
- end
- function GoIN(hitElement, matchingDimension)
- if hitElement then
- if getElementType(hitElement) == "player" then
- setElementInterior(hitElement,1)
- setElementPosition(hitElement,2.384830,33.103397,1199.849976)
- end
- end
- end
- function GoOUT(hitElement, matchingDimension)
- outputChatBox("GOOUT")
- if hitElement then
- if getElementType(hitElement) == "player" then
- setElementInterior(hitElement,1)
- setElementPosition(hitElement,2.384830,33.103397,1199.849976)
- end
- end
- end
- --[[
- local m2 = createMarker(3.5126953125,23.1826171875,1198.6011962891, "cylinder", 1.0, 255,0,0)
- addEventHandler( "onMarkerHit", m2, GoOUT )
- local m1 = createMarker(-1945.810546875,123.2353515625,25.000619888306, "cylinder", 1.0, 255,0,0)
- setElementParent(m1,MAINTRAIN)
- addEventHandler( "onMarkerHit", m1, GoIN )
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement