Virtual world Desync/world problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Virtual world Desync/world problem (
/showthread.php?tid=653058)
Virtual world Desync/world problem -
jasperschellekens - 25.04.2018
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(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);
}
Note: This problem only occurs when the players virtual world is NOT 0.
Re: Virtual world Desync/world problem -
Dayrion - 25.04.2018
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
Re: Virtual world Desync/world problem -
jasperschellekens - 25.04.2018
Quote:
Originally Posted by Dayrion
|
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.
Re: Virtual world Desync/world problem -
Dayrion - 25.04.2018
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.