Preventing players to see each other in same interior?
#1

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?
Reply
#2

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.
Reply
#3

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
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.
and when the player is out of house, setting it back to default.
Reply
#4

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?
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)