Error virtual world
#1

I have a problem with the virtual world "OnPlayerFinishedDownloading". When he entered a minigame, be it, / derby, / minigun, / rocket. This sends me the message that is in "OnPlayerFinishedDownloading" (I guess it is every time it changed virtual world), it also happens when I put the command / exit.

PHP код:
public OnPlayerRequestDownload(playeridtypecrc)
{
    
SendClientMessageToAll(-1"started");
    return 
1;
}
public 
OnPlayerFinishedDownloading(playeridvirtualworld)
{
    
SendClientMessageToAll(-1"finished"); //When I go to a minigame, send me this message
    
return 1;

Edit: when I put the "useartwork 0", this does not happen.
Reply
#2

Make a variable to keep track of whether or not they have already downloaded stuff.
SA-MP calls OnPlayerFinishedDownloading every VW change.
Reply
#3

Something like this is fine?

PHP код:
public OnPlayerRequestDownload(playeridtypecrc)
{
    
Player[playerid][Ok] = 0;
    
SendClientMessageToAll(-1"started");
    return 
1;
}
public 
OnPlayerFinishedDownloading(playeridvirtualworld)
{
    
Player[playerid][Ok] = 1;
    if(
Player[playerid][Ok] == 1) return 1;
    
SendClientMessageToAll(-1"finished");
    return 
1;

Reply
#4

I guess you can use a timer in the derby system.

Example:

PHP код:
new TIMERS[MAX_PLAYERS][1];
//after CreateVehicle
TIMERS[playerid][0] = SetTimerEx("PutPlayerVehicleDerby"200false"i"playerid);
//Somewhere in your script
forward PutPlayerVehicleDerby(playerid);
public 
PutPlayerVehicleDerby(playerid)
{
    
PutPlayerInVehicle(playeridDERBYVEHICLEID0);
    return 
1;

Reply
#5

Quote:
Originally Posted by SapMan
Посмотреть сообщение
Something like this is fine?

PHP код:
public OnPlayerRequestDownload(playeridtypecrc)
{
    
Player[playerid][Ok] = 0;
    
SendClientMessageToAll(-1"started");
    return 
1;
}
public 
OnPlayerFinishedDownloading(playeridvirtualworld)
{
    
Player[playerid][Ok] = 1;
    if(
Player[playerid][Ok] == 1) return 1;
    
SendClientMessageToAll(-1"finished");
    return 
1;

No. I'm a bit confused. You make it sound like seeing the message "started" and "finished" is the problem. I'm guessing you don't like seeing it every time you change virtual worlds; so why not just remove the messages all together?...

PHP код:
public OnPlayerRequestDownload(playeridtypecrc)
{
    return 
1;
}
public 
OnPlayerFinishedDownloading(playeridvirtualworld)
{
    return 
1;

Otherwise, if you use the code you posted; that message will be shown to every player online each time a single individual starts/finishes downloading models. But you sound like you don't want those messages at all, so. OnPlayerFinishedDownloading getting called each time someone changes virtual worlds is not a bug, it's meant to be like that because custom models can be specific to virtual worlds. So don't worry that it constantly gets called.
Reply
#6

Quote:
Originally Posted by CantBeJohn
Посмотреть сообщение
No. I'm a bit confused. You make it sound like seeing the message "started" and "finished" is the problem. I'm guessing you don't like seeing it every time you change virtual worlds; so why not just remove the messages all together?...

PHP код:
public OnPlayerRequestDownload(playeridtypecrc)
{
    return 
1;
}
public 
OnPlayerFinishedDownloading(playeridvirtualworld)
{
    return 
1;

Otherwise, if you use the code you posted; that message will be shown to every player online each time a single individual starts/finishes downloading models. But you sound like you don't want those messages at all, so. OnPlayerFinishedDownloading getting called each time someone changes virtual worlds is not a bug, it's meant to be like that because custom models can be specific to virtual worlds. So don't worry that it constantly gets called.
I do not mean that brother. I put that message to test, the problem is that every time you change the virtual world, it does not take me to the position of the desired vehicle, for example: as the vehicle of the derby.

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
I guess you can use a timer in the derby system.

Example:

PHP код:
new TIMERS[MAX_PLAYERS][1];
//after CreateVehicle
TIMERS[playerid][0] = SetTimerEx("PutPlayerVehicleDerby"200false"i"playerid);
//Somewhere in your script
forward PutPlayerVehicleDerby(playerid);
public 
PutPlayerVehicleDerby(playerid)
{
    
PutPlayerInVehicle(playeridDERBYVEHICLEID0);
    return 
1;

Thanks, this worked for me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)