Jump to content

[help] have some questions


BolonZX

Recommended Posts

Posted

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 :D

Posted

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.

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

Posted

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.

Posted

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.

Posted (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 by Guest
Posted
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

Posted
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

Posted
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

Posted

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"/> 

Posted
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) 

Posted

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" /> 
  

Posted
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

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