25.04.2018, 10:07
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:
Note: This problem only occurs when the players virtual world is NOT 0.
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(playerid, 0);
new DBResult:CLEAR_HENTER_RESULT;
new szQuery3[128];
format(szQuery3, sizeof(szQuery3), "delete from `ENTEREDHOUSE` where `CHARID` = '%d'", CHARID[playerid]);
CLEAR_HENTER_RESULT = db_query(LARP_DATABASE, szQuery3);
db_free_result(CLEAR_HENTER_RESULT);
} else {
SetPlayerPos(playerid,pX[playerid],pY[playerid],pZ[playerid]);
SetPlayerVirtualWorld(playerid, 0);
}