Posts: 415
Threads: 145
Joined: Oct 2013
Reputation:
0
Hello, I'm not sure about one thing, I'm making house system, and if I'll have for example two houses with same interiorids (and X, Y, Z coords) how to prevent these two players to see each other? Is this done by setting virtualworlds?
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
Yes it is done via SetPlayerVirtualWorld.
My method on doing it:
SetPlayerVirtualWorld(playerid, house_id + 6000);// Adds 6000 on the houseID <= only players on that virtual world can see each other if they are on the same house.
Posts: 415
Threads: 145
Joined: Oct 2013
Reputation:
0
Okay, so I can do it too like this? When I'm loading the ID from the database to variable (which is unique /Auto Increment/) and I'll use this for VW too?
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
You can use the houseID, using it for Virtual Worlds as well. If your houseID is 1, their virtual world will be 1 too though i prefer using the method i have shown you earlier.
DON'T FORGET TO RESET THE VIRTUAL WORLD BACK TO ZERO IF THEY EXITED THE HOUSE.