Vic_RattleHead Posted June 3, 2016 Posted June 3, 2016 Hi, i have a problem the "setCameraPosition" appears only after downloading, I want to happen in the download addEventHandler("onPlayerJoin", root, function() outputChatBox("**Please wait, download in progress**", source, 255, 0, 0) fadeCamera(source, true) setCameraMatrix(source, 2003, -881, 130, 1832, -1249, 64) end ) --ADMINISTRADOR, CREADOR Y DESARROLLADOR: GRUPO EN FACEBOOK: https://www.facebook.com/groups/778807552207175/?fref=ts [OVERKILL]PROJECT Multi[G]amemode --GANGWAR/ZOMBIEWAR/TACTICS/CIVILWAR/RACE/DEATHRACE¡¡TODO EN UNO!!-- PROXIMAMENTE http://overkillprojectserver.creatuforo.com/foro/
MTA Team botder Posted June 3, 2016 MTA Team Posted June 3, 2016 You can add this option to your meta.xml if you want to start a script earlier than the others: <download_priority_group>1</download_priority_group> Here is the explanation from the wiki: If not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources. In the early starting script you can change the environment prior to the download of the other resources. 1 GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
Bean666 Posted June 3, 2016 Posted June 3, 2016 the Problem is ,it will still trigger even tho the player has all the files done because the function is onPlayerJoin it triggers everytime when a player joins your server even tho they have the download done. Aftermath
MTA Team botder Posted June 3, 2016 MTA Team Posted June 3, 2016 He can make a clientside script, which will fade the camera in and change the camera matrix on resource start. I never implied he is forced to use onPlayerJoin. GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
Vic_RattleHead Posted June 3, 2016 Author Posted June 3, 2016 I try what you said , but does not work --ADMINISTRADOR, CREADOR Y DESARROLLADOR: GRUPO EN FACEBOOK: https://www.facebook.com/groups/778807552207175/?fref=ts [OVERKILL]PROJECT Multi[G]amemode --GANGWAR/ZOMBIEWAR/TACTICS/CIVILWAR/RACE/DEATHRACE¡¡TODO EN UNO!!-- PROXIMAMENTE http://overkillprojectserver.creatuforo.com/foro/
Captain Cody Posted June 4, 2016 Posted June 4, 2016 Client Side :: outputChatBox("**Please wait, download in progress**", 255, 0, 0) fadeCamera(true) setCameraMatrix(2003, -881, 130, 1832, -1249, 64) Then use the download group thing at 1 That's all you need.
KariiiM Posted June 4, 2016 Posted June 4, 2016 Just do what, Necktrox said, then put the code client sided and replace the onPlayerJoin event name to onClientResourceStart. ADD this line on your meta.xml <download_priority_group>99</download_priority_group> Then add this code: client side: addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) outputChatBox ( "**Please wait, download in progress**", 255, 0, 0 ) fadeCamera ( true ) setCameraMatrix ( 2003, -881, 130, 1832, -1249, 64 ) end )
Captain Cody Posted June 4, 2016 Posted June 4, 2016 You don't need the onClientResourceStart, all you have to do is just leave it by itself in the code.
KariiiM Posted June 4, 2016 Posted June 4, 2016 True ,but just to ensure that the client is started and yeah both of them do the same job
Vic_RattleHead Posted June 4, 2016 Author Posted June 4, 2016 Not work, the "setCameraPosition" appears only after downloading, i dont know what the problem --ADMINISTRADOR, CREADOR Y DESARROLLADOR: GRUPO EN FACEBOOK: https://www.facebook.com/groups/778807552207175/?fref=ts [OVERKILL]PROJECT Multi[G]amemode --GANGWAR/ZOMBIEWAR/TACTICS/CIVILWAR/RACE/DEATHRACE¡¡TODO EN UNO!!-- PROXIMAMENTE http://overkillprojectserver.creatuforo.com/foro/
Moderators IIYAMA Posted June 4, 2016 Moderators Posted June 4, 2016 Keep it serverside, because (most of) the client scripts are starting after the download. You could try to use a delay: addEventHandler("onPlayerJoin", root, function() setTimer(function (player) if isElement(player) then outputChatBox("**Please wait, download in progress**", player, 255, 0, 0) fadeCamera(player, true) setCameraMatrix(player, 2003, -881, 130, 1832, -1249, 64) end end, 3000, 1, source) end) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Vic_RattleHead Posted June 7, 2016 Author Posted June 7, 2016 Is the same, is visible after downloading --ADMINISTRADOR, CREADOR Y DESARROLLADOR: GRUPO EN FACEBOOK: https://www.facebook.com/groups/778807552207175/?fref=ts [OVERKILL]PROJECT Multi[G]amemode --GANGWAR/ZOMBIEWAR/TACTICS/CIVILWAR/RACE/DEATHRACE¡¡TODO EN UNO!!-- PROXIMAMENTE http://overkillprojectserver.creatuforo.com/foro/
Overkillz Posted June 7, 2016 Posted June 7, 2016 In my case, I run a race DM Server, When someone joins he has 2 downloads. Might this could sound weard but I will expalin it. The first one create the folders ...etc, I suposse that it loads server side scripts. When this is downloaded, the camera matrix should be started. Then the 2nd download started. Well, now are downloading the client files. I dont know if u get me, but it could help u. Regards.
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