Posts: 1,042
Threads: 46
Joined: Jun 2013
https://sampwiki.blast.hk/wiki/OnPlayerFinishedDownloading
Have you read the documentation for this function? It should be so!
Posts: 1,046
Threads: 29
Joined: Mar 2010
This is a bad name for an event where it gets invoked at virtual world change.
Posts: 200
Threads: 39
Joined: Feb 2013
Reputation:
0
Well, if there are no models, it is kinda true that the player has loaded all of them. There could be some additional parameter, for example the count of those models.
Posts: 1,042
Threads: 46
Joined: Jun 2013
Quote:
Originally Posted by sprtik
Well, if there are no models, it is kinda true that the player has loaded all of them. There could be some additional parameter, for example the count of those models.
|
The function really needs to be improved. Most likely, she will receive minor changes in RC2
Posts: 506
Threads: 15
Joined: Mar 2009
Reputation:
0
I added that warning, because that's what I found counterintuitive when testing that callback.
Posts: 542
Threads: 14
Joined: Aug 2016
Reputation:
0
Well, Shouldn't it just be once and it goes for all virtual worlds?
That would be so much better.
Posts: 506
Threads: 15
Joined: Mar 2009
Reputation:
0
The callback has 'downloading' in its name. I first thought it referred to the actual downloading at the beginning of the player connecting to the server, now I don't really get what it's supposed to refer to.
Posts: 331
Threads: 1
Joined: Mar 2016
Reputation:
0
It's probably a bug since you just download a new model if you're in its virtual world (-1 download it at connection). It's totally fine calling this callback more than one time, see the following scenario:
- You AddSimpleModel speficying a virtual world (suppose 10);
- A player connects and start downloading custom models without VW (-1);
- The player wanna join an event at VW 10 which uses the model you previously added, so the download is started and the callback is called again when it's finished.
Posts: 217
Threads: 1
Joined: Jul 2017
Reputation:
0
This can be useful when a server uses a lot of custom objects, if the callback gets called only when theu change virtual world it will decrease downloading time.
Anyway I prefer to download models all in once and play without problems.
Posts: 192
Threads: 2
Joined: Sep 2010
Quote:
Originally Posted by Kyle
This should be altered so it's only actually called when downloads have taken place.
|
This isn't ideal for servers that set up cinematic cameras while prompting a user to register or login. It should absolutely be called during the initial server connection because that makes it easier to set up proper login/register scripts. During initial testing, I had concerns about the download box appearing over login dialogs during a player's first connection. This callback was added to make transitioning from these stages more fluid. I do agree that a virtual world change shouldn't call it unless a download actually happens, but I'm sure everyone is capable of throwing together code to prevent unwanted execution. For my server I did this:
Code:
public OnPlayerFinishedDownloading(playerid, virtualworld)
{
if(!Logged{playerid})
{
//etc
}
}
Posts: 200
Threads: 39
Joined: Feb 2013
Reputation:
0
Well, I think we can settle on that this callback should really be called OnPlayerWorldLoaded.
Posts: 1,042
Threads: 46
Joined: Jun 2013
Quote:
Originally Posted by sprtik
Well, I think we can settle on that this callback should really be called OnPlayerWorldLoaded.
|
You can do it yourself, there is no need for it.
Posts: 1,180
Threads: 55
Joined: Apr 2005
Reputation:
0
When the server has useartwork enabled, the player enters a download state when they first connect to the server, and for every virtualworld change. It doesn't matter if there are no files needing to download, the player will still enter the download state and check for needed files.
Posts: 98
Threads: 8
Joined: Mar 2013
Quote:
Originally Posted by Kalcor
When the server has useartwork enabled, the player enters a download state when they first connect to the server, and for every virtualworld change. It doesn't matter if there are no files needing to download, the player will still enter the download state and check for needed files.
|
Okay but why is it needed at every virtual world change tho? Didn't understand it yet.
Posts: 1,180
Threads: 55
Joined: Apr 2005
Reputation:
0
Because from the script level you need to know that the player has all the models for the vworld and you can start creating custom objects.
Posts: 98
Threads: 8
Joined: Mar 2013
Quote:
Originally Posted by Kalcor
Because from the script level you need to know that the player has all the models for the vworld and you can start creating custom objects.
|
Oh okay, I'm sorry, I thought the custom models were downloaded and loaded globally only once and used for all vworlds.