Jump to content

Fade Camera


Recommended Posts

Posted

ehh, last question, if SolidSnake can help then please do, i will be releasing it on my server soon. I need it too fade to black on playerlogin. This is similiar to the old post, now its just the fading? why wont it work?

function enableinput() 
triggerClientEvent(source,"afterlogin",getRootElement()) 
fadeCamera ( source, true, 1.0, 0, 0, 0 )       
end 
addEventHandler("onPlayerLogin",getRootElement(),enableinput) 
  
function camerafade() 
fadeCamera ( source, false, 1.0, 0, 0, 0 )        
end 
addEventHandler("onResourceStart",getRootElement(),camerafade) 

Posted
function enableinput() 
triggerClientEvent(source,"afterlogin",getRootElement()) 
fadeCamera ( source, true, 1.0, 0, 0, 0 )       
end 
addEventHandler("onPlayerLogin",getRootElement(),enableinput) 
  
function camerafade() 
--fadeCamera ( source, false, 1.0, 0, 0, 0 )  -- WTF is this? you think you can just copy one line and paste it and it'll work? 
for index, player in pairs(getElementsByType("player")) do 
           fadeCamera ( player, false, 1.0, 0, 0, 0 ) 
      end 
end 
addEventHandler("onResourceStart",resourceRoot,camerafade) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
function enableinput() 
triggerClientEvent(source,"afterlogin",getRootElement()) 
fadeCamera ( source, true, 1.0, 0, 0, 0 )       
end 
addEventHandler("onPlayerLogin",getRootElement(),enableinput) 
  
function camerafade() 
--fadeCamera ( source, false, 1.0, 0, 0, 0 )  -- WTF is this? you think you can just copy one line and paste it and it'll work? 
for index, player in pairs(getElementsByType("player")) do 
           fadeCamera ( player, false, 1.0, 0, 0, 0 ) 
      end 
end 
addEventHandler("onResourceStart",resourceRoot,camerafade) 

Thank you :| Now one last tincy question, i sware, its the last :| i promise...

I am trying to make the guest button work, it hides the gui alright ofc... but its the way ive done it... I sware, its gonna be awhile before i post again D:

Client:

function playasguest() 
triggerServerEvent(source,"hidefade",getRootElement()) 
guiSetInputEnabled(false) 
guiSetVisible ( loginwindow, false ) 
showCursor (false) 
end 
addEventHandler ( "onClientGUIClick", guestbutton, playasguest, false ) 

server:

addEvent("hidefade",true) 
function camerafade() 
for index, player in pairs(getElementsByType("player")) do 
           fadeCamera ( player, false, 1.0, 0, 0, 0 ) 
      end 
end 
addEventHandler("onResourceStart",resourceRoot,camerafade) 
addEventHandler("hidefade",resourceRoot,camerafade) 

Posted

See? you did it again, you copyed and pasted what I written in the other post.. with this script you are fading off the camera of all players.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
See? you did it again, you copyed and pasted what I written in the other post.. with this script you are fading off the camera of all players.

I half understand what you mean :| I guess i wont be getting a fix, i guess its a puzzle, can i have a second hint, like just 1 line, and ill try my best :| I have never made an actual GUI before, and by skipping straight into this login GUI, i am really expanding my limits, and castillo, im sure you know what its like to take a large leap and fail, you feel like you can do it, then all of a sudden it doesnt work? Well im taking a leap and a risk. Could you please help me... I just tried a few things, still failed, like i see your point, source would be hiding all, so i tried and i still cant get it working.... I am lost in my own work, shameful... Please help.

Posted

I'm saying you just copyed my script and expected me to fix it for you, well, this time you'll have to find your bug and repair it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
function playasguest() 
triggerServerEvent("hidefade",localPlayer) 
guiSetInputEnabled(false) 
guiSetVisible ( loginwindow, false ) 
showCursor (false) 
end 
addEventHandler ( "onClientGUIClick", guestbutton, playasguest, false ) 

function camerafade() 
for index, player in pairs(getElementsByType("player")) do 
           fadeCamera ( player, false, 1.0, 0, 0, 0 ) 
      end 
end 
addEventHandler("onResourceStart",resourceRoot,camerafade) 
  
addEvent("hidefade",true) 
function camerafade() 
           fadeCamera ( source, false, 1.0, 0, 0, 0 ) 
end 
addEventHandler("hidefade",root,camerafade) 

CiTLh.png
Posted

TAPL, I wanted him to learn from his errors, that's why I didn't gave him the script, now he'll just take yours and forget about it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • 2 months later...
Posted

For the record. I never forgot it... I have advanced in scripting. When someone tells me a solution it locks in. Cause i like to modify it. I love learning. Its why im going for a diploma in Information Technology. All my teen years i have been trying to ensure my future career is worth living for. I hope you can understand that. Right now all is very boring. I hope things get better.

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...