Jump to content

[help] have some questions


BolonZX

Recommended Posts

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

Link to comment

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.

Link to comment
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.

Link to comment

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
Link to comment
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

Link to comment
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

Link to comment
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) 

Link to comment

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

Link to comment
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

Link to comment

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