Ich habe mir das Intro Script von der Comiunity runtergeladen aber da steht das man das Intro nur mit dem Command /intro abspielen kann und das ich irgent ein OnPlayerLogin event einsetzen soll damit es beim Login kommt.
Ich habe alles versucht aber es geht nicht
Hier der Code:
Code
--introstuff = {plane = createObject(1681,1480.6881103516,1896.1604003906,46.635292053223,0,0,180),thing = createObject( 3803,1503.2192382813,1730.5847167969,12.067991256714,0,0,316.32998657227), thing = createObject( 3803,1503.2192382813,1730.5847167969,12.067991256714,0,0,316.32998657227),thing2 = createObject( 3803, 1870.99,1434.35,80 )}
--setElementDimension( introstuff.plane, 1 )
--setElementDimension( introstuff.thing, 1 )
--setElementAlpha( introstuff.thing, 0 )
--setElementAlpha( introstuff.thing2, 0 )
local gR = getRootElement()
local gRR = getResourceRootElement( getThisResource() )
local gMe = getLocalPlayer()
local plane = createObject(1681,1480.6881103516,1896.1604003906,46.635292053223,0,0,180)
local thing = createObject( 3803,1503.2192382813,1730.5847167969,12.067991256714,0,0,316.32998657227)
local thing2 = createObject( 3803, 1870.99,1434.35,80 )
setElementDimension( plane, 1 )
setElementDimension( thing, 1 )
setElementAlpha( thing, 0 )
setElementAlpha( thing2, 0 )
function updateCam1()
local cx, cy, cz = getElementPosition( thing )
local tx, ty, tz = getElementPosition( plane )
setCameraMatrix ( cx, cy, cz, tx, ty, tz )
end
function updateCam2()
local cx, cy, cz = getElementPosition( thing2 )
local tx, ty, tz = getElementPosition( thing )
setCameraMatrix ( cx, cy, cz, tx, ty, tz )
end
function updateCam3()
local cx, cy, cz = getElementPosition( thing2 )
local tx, ty, tz = getElementPosition( thing )
setCameraMatrix ( cx, cy, cz, tx, ty, tz )
end
local plane = createObject(1681,1480.6881103516,1896.1604003906,46.635292053223,0,0,180)
local thing = createObject( 3803,1503.2192382813,1730.5847167969,12.067991256714,0,0,316.32998657227)
local thing2 = createObject( 3803, 1870.99,1434.35,80 )
setElementDimension( plane, 1 )
setElementDimension( thing, 1 )
setElementAlpha( thing, 0 )
setElementAlpha( thing2, 0 )
function showintro()
fader = guiCreateStaticImage(0,0,1.9992,1.999,"images/widescreen.png",true)
showPlayerHudComponent( "radar", false )
fadeCamera( false, 0.5, 0, 0, 0 )
setElementDimension( gMe,1 )
setTimer(
function ()
fadeCamera( true, 1.2, 0, 0, 0 )
p1 = guiCreateStaticImage(0.3281,0.8486,0.4172,0.1494,"images/1.png",true)
moveObject( plane, 9000, 1477.4921875,1621.83203125, 12.011219978333)
setTimer(
function ()
fadeCamera( false, 1.0, 0, 0, 0 )
end
, 7500, 1 )
addEventHandler( 'onClientPreRender', gR, updateCam1 )
setTimer(
function ()
moveObject( thing, 8500, 2000,1547,40 )
destroyElement( p1 )
p2 = guiCreateStaticImage(0.3281,0.8486,0.4172,0.1494,"images/2.png",true)
fadeCamera( true, 0.5, 0, 0, 0 )
addEventHandler( 'onClientPreRender', gR, updateCam2 )
setTimer(
function ()
moveObject( thing2, 8000, 2057,1744, 11 )
destroyElement( p2 )
p3 = guiCreateStaticImage(0.3281,0.8486,0.4172,0.1494,"images/3.png",true)
--addEventHandler( 'onClientPreRender', gR, updateCam2 )
setTimer(
function ()
moveObject( thing2, 9000, 2048.20,1477.60,11 )
moveObject( thing, 6000, 2039.08,1430,15 )
destroyElement( p3 )
p4 = guiCreateStaticImage(0.3281,0.8486,0.4172,0.1494,"images/4a.png",true)
setTimer( function () destroyElement(p4) p5 = guiCreateStaticImage(0.3281,0.8486,0.4172,0.1494,"images/5.png",true) fadeCamera( false, 6.5, 0, 0, 0 ) end, 4000, 1 )
addEventHandler( 'onClientPreRender', gR, updateCam3 )
setTimer(
function()
removeEventHandler( 'onClientPreRender', gR, updateCam1 )
removeEventHandler( 'onClientPreRender', gR, updateCam2 )
removeEventHandler( 'onClientPreRender', gR, updateCam3 )
setElementDimension( gMe,0 )
setCameraTarget( gMe, gMe )
showPlayerHudComponent( "radar", true )
destroyElement( fader )
destroyElement( p5 )
fadeCamera( true, 1.5, 0, 0, 0 )
setCameraTarget (gMe,gMe)
end
, 10500, 1 )
end
, 8500, 1 )
end
, 9000, 1 )
end
, 8000, 1 )
end
, 1000, 1 )
end
addEventHandler("onPlayerLogin",
function ()
showintro()
end
)
function updateCam1()
local cx, cy, cz = getElementPosition( thing )
local tx, ty, tz = getElementPosition( plane )
setCameraMatrix ( cx, cy, cz, tx, ty, tz )
end
function updateCam2()
local cx, cy, cz = getElementPosition( thing2 )
local tx, ty, tz = getElementPosition( thing )
setCameraMatrix ( cx, cy, cz, tx, ty, tz )
end
function updateCam3()
local cx, cy, cz = getElementPosition( thing2 )
local tx, ty, tz = getElementPosition( thing )
setCameraMatrix ( cx, cy, cz, tx, ty, tz )
end
addEvent ("onPlayerLogin",true)
addEventHandler ("onPlayerLogin",getRootElement(),
function()
showintro ()
for i,v in pairs (getElementsByType ("gui-window")) do
guiSetVisible (v,false)
end
end)
Alles anzeigen