Sign in to follow this  
Machine

what am i doing wrong here?

Recommended Posts

so i am having problem with this code


marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153) 
  
function camera(player) 
    if (source == marker and getElementType(player) == "player") then 
	     fadeCamera(player, true, 0.5)
	     setCameraMatrix(player, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)
   end
end 
addEventHandler("onMarkerHit", root, camera) 

it does work and show the camera but it doesnt give any fading effects 

i wanna fade in  so screen becomes black for like 2 second then fade out so it show where set camera matrix is pointing

Share this post


Link to post
marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153) 
  
function camera(player) 
    if (getElementType(player) == "player") then 
	     fadeCamera(player, true, 0.5)
	     setCameraMatrix(player, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)
   end
end 
addEventHandler("onMarkerHit", marker, camera) 

 

Share this post


Link to post
marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153) 
  
function camera(hitElement) 
    if getElementType(hitElement) == "player" then 
        fadeCamera(hitElement, false, 0.5)
        setTimer(function()
            setCameraMatrix(hitElement, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)
            fadeCamera(hitElement, true, 0.5)
        end, 500, 1)
    end
end 
addEventHandler("onMarkerHit", marker, camera) 

 

Edited by stPatrick

Share this post


Link to post
11 minutes ago, Dimos7 said:

marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153) 
  
function camera(player) 
    if (getElementType(player) == "player") then 
	     fadeCamera(player, true, 0.5)
	     setCameraMatrix(player, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)
   end
end 
addEventHandler("onMarkerHit", marker, camera) 

 

didnt work still same thing even if you increase  0.5

6 minutes ago, stPatrick said:

marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153) 
  
function camera(hitElement) 
    if getElementType(hitElement) == "player" then 
        fadeCamera(hitElement, false, 0.5)
        setTimer(setCameraMatrix, 500, 1, hitElement, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)
    end
end 
addEventHandler("onMarkerHit", marker, camera) 

 

also error

https://imgur.com/D76s3Rm

Share this post


Link to post
5 minutes ago, Machine said:

didnt work still same thing even if you increase  0.5

also error

https://imgur.com/D76s3Rm

 

marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153)

function camera(hitElement)
    if getElementType(hitElement) == "player" then
        fadeCamera(hitElement, false, 0.5)
        setTimer(function()
            setCameraMatrix(hitElement, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)
            fadeCamera(hitElement, true, 0.5)
        end, 500, 1)
    end
end
addEventHandler("onMarkerHit", marker, camera)

 

Share this post


Link to post

It's sometimes happens when u copy code from forum, just write this line by yourself.

  • Like 1

Share this post


Link to post
34 minutes ago, SaNoR said:

It's sometimes happens when u copy code from forum, just write this line by yourself.

first of all i was using the wiki guide to learn not the forum 

second of all if your not gonna help in this section dont give a stupid opinion this section was made for programming help 

 

Share this post


Link to post
On 05/05/2019 at 23:48, Machine said:

first of all i was using the wiki guide to learn not the forum 

second of all if your not gonna help in this section dont give a stupid opinion this section was made for programming help 

 

Don't be toxic, retard. I was talking about https://imgur.com/D76s3Rm

  • Haha 1

Share this post


Link to post
  1. marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153)
  2.  
  3. function camera(hitElement)
  4. if getElementType(hitElement) == "player" then
  5. setCameraMatrix(hitElement, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)
  6. setTimer(function()
  7. fadeCamera(hitElement, true, 0.5)
  8. end, 500, 1)
  9. end
  10. end
  11. addEventHandler("onMarkerHit", marker, camera)

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.