Jump to content

FadeCamera teleport doesnt work


Recommended Posts

Hey, my script isn't fully working. It teleports you into the city hall, but there is no fadeCamera visible. You get immediately teleported into the interior. Also is there a difference between source, playerSource and thePlayer? I get confused, which one to use, because I can't seem to find a full list of this words.

EDIT:// It's all server sided

  
local markerOut = createMarker( -2766.11597, 375.50665, 6.33468, "corona", 2, 255, 0, 0, 255 ) 
local markerIn = createMarker( 389.69968, 173.86449, 1008.38281, "corona", 2, 255, 0, 0, 255) 
setElementInterior( markerIn, 3 ) 
function markerHitOut( playerSource ) 
    fadeCamera( playerSource, false, 2.0, 255, 0, 0 ) 
    setElementInterior( playerSource, 3, 387.18585, 173.86874, 1008.38281 ) 
    fadeCamera( playerSource, true, 1.0 ) 
end 
addEventHandler( "onMarkerHit", markerOut, markerHitOut ) 
  
function markerHitIn( playerSource ) 
    fadeCamera( playerSource, false, 2.0 ) 
    setElementInterior( playerSource, 0, -2762.59839, 375.23846, 5.69544 ) 
    fadeCamera( playerSource, true, 1.0 ) 
end 
addEventHandler( "onMarkerHit", markerIn, markerHitIn ) 
  

Link to comment

I suspect the setElementInterior function interupts the camera fading. Try

fadeCamera( playerSource, false, 2.0, 255, 0, 0 ) 
setTimer(function() 
    setElementInterior( playerSource, 3, 387.18585, 173.86874, 1008.38281 ) 
    fadeCamera( playerSource, true, 1.0 ) 
end,2000,1) 

There's no difference in your case, you can name the player anything you want.

However in some cases you're required to use 'source' for the player. Not playerSource or thePlayer, these are just names, but source. Source is only used when you want to get the the root element of an event.

Link to comment
I suspect the setElementInterior function interupts the camera fading. Try
fadeCamera( playerSource, false, 2.0, 255, 0, 0 ) 
setTimer(function() 
    setElementInterior( playerSource, 3, 387.18585, 173.86874, 1008.38281 ) 
    fadeCamera( playerSource, true, 1.0 ) 
end,2000,1) 

There's no difference in your case, you can name the player anything you want.

However in some cases you're required to use 'source' for the player. Not playerSource or thePlayer, these are just names, but source. Source is only used when you want to get the the root element of an event.

Okay thanks, ill take a closer look at the timer. never heard about that before. :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...