~Air Posted December 17, 2014 Share Posted December 17, 2014 Hey guys, how is it able to show a place while the player is downloading? I got this already: setCameraMatrix( -1360, 1618, 100, -1450, 1200, 100) setSkyGradient( 60, 100, 196, 60, 100, 196 ) setTime(21,00) setWeather(3) showChat(false) Link to comment
Skuleris Posted December 17, 2014 Share Posted December 17, 2014 Use event "onPlayerJoin". Remember, that you can use only server-sided function while he didn't download the client files. Link to comment
~Air Posted December 17, 2014 Author Share Posted December 17, 2014 And how does that work? Link to comment
Skuleris Posted December 17, 2014 Share Posted December 17, 2014 (edited) That works, because instead of client doing action, the server does. Client can't, because the clientside files aren't downloaded yet.(I'm not sure if onPlayerJoin is the right one, maybe onPlayerConnect) function update() setCameraMatrix(source, -1360, 1618, 100, -1450, 1200, 100) showChat(source, false) end --updated as gSub told to. addEventHandler("onPlayerJoin", getRootElement(), update) Because the clientside isn't ready, you cant use client functions like setSkyGradient, setTime and setWeather, only server functions. Well you can, but that would set effect for every player. Edited December 17, 2014 by Guest Link to comment
AJXB Posted December 17, 2014 Share Posted December 17, 2014 Wait.. did you just add onPlayerJoin as an event? it's already added, just use addEventHandler Also, you may want to use onClientResourceStart if you get any bugs. Link to comment
~Air Posted December 17, 2014 Author Share Posted December 17, 2014 I haven't tried it yet, but I think this will stay for ever how can I cancel that, that the CameraMatrix will get removed after downloading? Link to comment
Dzsozi (h03) Posted December 18, 2014 Share Posted December 18, 2014 You might have to edit this a little bit, but I think you got it. local camID = 0 local viewPosition = {} viewPosition[1] = {369.0364074707, -2058.7250976563, 33.059700012207, 369.44738769531, -2057.8530273438, 32.79430770874} -- just an example, you can add more by copying this and change the number to a bigger one, for example -- viewPosition[2] = {369.0364074707, -2058.7250976563, 33.059700012207, 369.44738769531, -2057.8530273438, 32.79430770874} local stageTime = 6500 local fadeTime = 1000 local fadeDelay = 0 function showViews() fadeCamera ( false, fadeTime/1000 ,0,0,0) setTimer(function() local camID = math.random(1,#viewPosition) local camX = viewPosition[camID][1] local camY = viewPosition[camID][2] local camZ = viewPosition[camID][3] local lookX = viewPosition[camID][4] local lookY = viewPosition[camID][5] local lookZ = viewPosition[camID][6] setCameraMatrix(camX, camY, camZ, lookX, lookY, lookZ) newView = setTimer(function() showFerrisViews() end, stageTime, 1) fadeCamera( true, fadeTime/1000) end, fadeTime+fadeDelay , 1) end function endViews() if isTimer(newView) then killTimer(newView) newView = nil end end EDIT: Use onPlayerJoin to start the camera matrix views and use onPlayerSpawn to remove it. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now