BolonZX Posted March 22, 2014 Posted March 22, 2014 Hello everyone I have a question, well I notice that in alot of servers that have mods a black screen appears with the download bar below and I does not spawn the player until the download is finished I wanted to know what are the functions to do this kind of script I been looking for it for about 3 days now. I will appreciate if someone can tell me the functions
JR10 Posted March 22, 2014 Posted March 22, 2014 You don't need anything for that. It's hard-coded into MTA. You just need to add the files that should be downloaded in the meta.xml, and when the player joins your server they will download it and then the client-side scripts will be started for them.
cheez3d Posted March 22, 2014 Posted March 22, 2014 addEventHandler("onClientResourceStart",resourceRoot,function() fadeCamera(true) end)
cheez3d Posted March 22, 2014 Posted March 22, 2014 If a resource is running before a player joins, the onClientResourceStart event will be triggered after they join and have downloaded that resource.If a resource is started after a player has joined, the player will be made to download the required files, and then the onClientResourceStart event will be triggered.
JR10 Posted March 22, 2014 Posted March 22, 2014 What he was asking about was the download progress bar that appears when you're downloading server files, he wanted to know how to do it.
BolonZX Posted March 22, 2014 Author Posted March 22, 2014 no no its not the progress bar (sorry if I didn't explain myself correctly)what I want is when a player joins, the server would show a black background and won't spawn the player until he/she downloads all the resources.
cheez3d Posted March 22, 2014 Posted March 22, 2014 (edited) SERVER SIDE addEventHandler("onPlayerJoin",root,function() fadeCamera(source,false,0) end) addEvent("onPlayerFilesDownloaded",true) addEventHandler("onPlayerFilesDownloaded",root,function() spawnPlayer(source,0,0,0) end) CLIENT SIDE addEventHandler("onClientResourceStart",resourceRoot,function() fadeCamera(true) triggerServerEvent("onPlayerFilesDownloaded",localPlayer) end) Edited March 22, 2014 by Guest
Arnold-1 Posted March 22, 2014 Posted March 22, 2014 He already wont spawn until the download finish.....! except if a server side thing spawned him, so by default, he wont spawn.
BolonZX Posted March 22, 2014 Author Posted March 22, 2014 SERVER SIDE addEventHandler("onPlayerJoin",root,function() fadeCamera(source,false,0) end) addEvent("onPlayerFilesDownloaded",true) addEventHandler("onPlayerFilesDownloaded",root,function() spawnPlayer(source,0,0,0) end) CLIENT SIDE addEventHandler("onClientResourceStart",resourceRoot,function() fadeCamera(true) triggerServerEvent("onPlayerFilesDownloaded",localPlayer) end) I will try that
BolonZX Posted March 22, 2014 Author Posted March 22, 2014 He already wont spawn until the download finish.....! except if a server side thing spawned him, so by default, he wont spawn. no, the player does spawn when the resources are downloading
BolonZX Posted March 22, 2014 Author Posted March 22, 2014 SERVER SIDE addEventHandler("onPlayerJoin",root,function() fadeCamera(source,false,0) end) addEvent("onPlayerFilesDownloaded",true) addEventHandler("onPlayerFilesDownloaded",root,function() spawnPlayer(source,0,0,0) end) CLIENT SIDE addEventHandler("onClientResourceStart",resourceRoot,function() fadeCamera(true) triggerServerEvent("onPlayerFilesDownloaded",localPlayer) end) nop still spawns the player even if he/she is downloading the resources
cheez3d Posted March 22, 2014 Posted March 22, 2014 Stop any other resource that might handle the spawning (like freeroam) and in meta.xml use the value "gamemode" for the attribute type of the info node. <info author="Someone" name="Something" description="" type="gamemode" version="1"/>
BolonZX Posted March 22, 2014 Author Posted March 22, 2014 Stop any other resource that might handle the spawning (like freeroam) and in meta.xml use the value "gamemode" for the attribute type of the info node. <info author="Someone" name="Something" description="" type="gamemode" version="1"/> okay so use something like this? stopResource(freeroam)
cheez3d Posted March 22, 2014 Posted March 22, 2014 Remove the "spawnmanager" and "play" form mtaserver.conf and restart your server. Also make sure to start your resource before you join. These 2 lines: <resource src="spawnmanager" startup="1" protected="0" /> <resource src="play" startup="1" protected="0" />
BolonZX Posted March 22, 2014 Author Posted March 22, 2014 Remove the "spawnmanager" and "play" form mtaserver.conf and restart your server. Also make sure to start your resource before you join.These 2 lines: <resource src="spawnmanager" startup="1" protected="0" /> <resource src="play" startup="1" protected="0" /> did everything you said but still same thing happens
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