RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
Witam.
Mam taki kodzik mianowicie on dzia?? lecz jest 1 problem:
Jak wchodze kamera sie wylacza wciskam guzik to wylacza lecz jak spowrotem wchodze to juz nie wlacza wie ktos czemu? jak tak to pomoze ?
Kod: local sm = {}
sm.moov = 0
sm.object1, sm.object2 = nil, nil
local function camRender ()
local x1, y1, z1 = getElementPosition ( sm.object1 )
local x2, y2, z2 = getElementPosition ( sm.object2 )
setCameraMatrix ( x1, y1, z1, x2, y2, z2 )
end
function smoothMoveCameraa ( x1, y1, z1, x1t, y1t, z1t, x2, y2, z2, x2t, y2t, z2t, time )
if(sm.moov == 1) then return false end
sm.object1 = createObject ( 1337, x1, y1, z1 )
sm.object2 = createObject ( 1337, x1t, y1t, z1t )
setElementAlpha ( sm.object1, 0 )
setElementAlpha ( sm.object2, 0 )
setObjectScale(sm.object1, 0.01)
setObjectScale(sm.object2, 0.01)
moveObject ( sm.object1, time, x2, y2, z2, 0, 0, 0, "InOutQuad" )
moveObject ( sm.object2, time, x2t, y2t, z2t, 0, 0, 0, "InOutQuad" )
addEventHandler ( "onClientPreRender", getRootElement(), camRender )
sm.moov = 1
setTimer ( removeCamHandler, time, 1 )
setTimer ( destroyElement, time, 1, sm.object1 )
setTimer ( destroyElement, time, 1, sm.object2 )
return true
end
local function removeCamHandler ()
if(sm.moov == 1) then
sm.moov = 0
removeEventHandler ( "onClientPreRender", getRootElement(), camRender )
end
end
addEventHandler ("onClientMarkerHit", okno,
function (hitElement)
if hitElement == getLocalPlayer() then
smoothMoveCameraa( 2150.2204589844, -1125.6097412109, 32.075695037842, 2131.2121582031, -1151.0263671875, 24.085910797119, 2117.2219238281, -1119.1082763672, 33.198322296143, 2131.2121582031, -1151.0263671875, 24.085910797119, 10000 )
setTimer ( function()
addEventHandler ("onClientRender", root, salongui)
guiSetVisible (B_bkup, true)
guiSetVisible (B_bwyjsice, true)
guiSetVisible (autor, true)
guiSetVisible (G_Auta, true)
showCursor (true)
end, 10000, 1 )
end
end
)
addEventHandler ("onClientGUIClick", B_bwyjsice,
function()
guiSetVisible (B_bkup, false)
guiSetVisible (B_bwyjsice, false)
guiSetVisible (autor, false)
guiSetVisible (G_Auta, false)
showCursor (false)
removeEventHandler ("onClientRender", root, salongui)
setCameraTarget(localPlayer)
end
)
[/code]