Virtual world Desync/world problem
#1

I have a script which saves the coordinates of where the player was standing when the player entered a house.
This is done because after a player changed his character or logged out. He became stuck in the interior because the exit was made with createdynamicpickup. So when the player switches to this specific character again. He gets teleported outside of the house.

The problem here is that it looks like the virtual world hasn't changed but the coords are correct.
However when i type /whereami (a command i created to check position and coords.) it shows me the right coords + virtual world 0.

But instead it looks like this as if the virtual world is still the same as the house int:

Click here for screenshot

Now i wonder if this is a desync problem or a virtual world bug? Anyone familiar with this problem? Any help would be appreciated.

Code:
PHP код:
if(HasEnteredHouse[playerid] == 1)
    {
        
SetPlayerPos(playerid,HasEnteredHouseX[playerid],HasEnteredHouseY[playerid],HasEnteredHouseZ[playerid]);
         
SetPlayerVirtualWorld(playerid0);
        new 
DBResult:CLEAR_HENTER_RESULT;
        new 
szQuery3[128];
        
format(szQuery3sizeof(szQuery3), "delete from `ENTEREDHOUSE` where `CHARID` = '%d'"CHARID[playerid]);
        
CLEAR_HENTER_RESULT db_query(LARP_DATABASEszQuery3);
        
db_free_result(CLEAR_HENTER_RESULT);
        
    } else {
         
SetPlayerPos(playerid,pX[playerid],pY[playerid],pZ[playerid]);
         
SetPlayerVirtualWorld(playerid0);
     } 
Note: This problem only occurs when the players virtual world is NOT 0.
Reply
#2

What about interior? On your screen, there is some vehicles spawned already so you might be on the correct virtual world with the wrong interiorid. https://sampwiki.blast.hk/wiki/SetPlayerInterior
Reply
#3

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
What about interior? On your screen, there is some vehicles spawned already so you might be on the correct virtual world with the wrong interiorid. https://sampwiki.blast.hk/wiki/SetPlayerInterior
Thank you very much this fixed the problem. I haven't considered about that one yet. I've been trying to fix this for 3 days now and the playerinteriors hadn't slipped my mind yet.
Reply
#4

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Thank you very much this fixed the problem. I haven't considered about that one yet. I've been trying to fix this for 3 days now and the playerinteriors hadn't slipped my mind yet.
You are welcome. Have a good day.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)