Vic_RattleHead Posted June 3, 2016 Share 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 ) Link to comment
MTA Team botder Posted June 3, 2016 MTA Team Share 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 Link to comment
Bean666 Posted June 3, 2016 Share 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. Link to comment
MTA Team botder Posted June 3, 2016 MTA Team Share 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. Link to comment
Vic_RattleHead Posted June 3, 2016 Author Share Posted June 3, 2016 I try what you said , but does not work Link to comment
Captain Cody Posted June 4, 2016 Share 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. Link to comment
KariiiM Posted June 4, 2016 Share 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 ) Link to comment
Captain Cody Posted June 4, 2016 Share Posted June 4, 2016 You don't need the onClientResourceStart, all you have to do is just leave it by itself in the code. Link to comment
KariiiM Posted June 4, 2016 Share Posted June 4, 2016 True ,but just to ensure that the client is started and yeah both of them do the same job Link to comment
Vic_RattleHead Posted June 4, 2016 Author Share Posted June 4, 2016 Not work, the "setCameraPosition" appears only after downloading, i dont know what the problem Link to comment
Moderators IIYAMA Posted June 4, 2016 Moderators Share 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) Link to comment
Vic_RattleHead Posted June 7, 2016 Author Share Posted June 7, 2016 Is the same, is visible after downloading Link to comment
Overkillz Posted June 7, 2016 Share 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. 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