[Release] [Plugin] Server-Sided Virtual Worlds/Dimensions

Virtual-Worlds

This resource provides a unique world/dimensions that can be assigned to players, peds, objects or vehicles in FiveM. This does nothing by itself, it is a tool for developers seeking to place players in separate worlds, for whatever reason they deem necessary. If you have no idea what that means then you probably shouldn’t be reading this further down.

How to Use

Features:
Allows you to assign any entity to a virtual world between 0 and 2,147,483,647.
Entities assigned to world 0 will be visible normally to all players. Making world 0 the default world in the game.
Entities in different worlds cannot physically interact with each other aside from explosions which can move vehicles(but not damage them).
NPC and NPC vehicle spawning is disabled in > 0 worlds. Wanted levels are also disabled.

Functions:

SetEntityVirtualWorld(entity, worldid) --Assigns a virtual world to an entity, be it a ped, vehicle, object or player.

GetEntityVirtualWorld(entity) --Returns an entity's virtual world as an integer.

Download

repo private till fix this trash

9 Likes

Might be useful to un-private your repo :stuck_out_tongue:

Great release! Not sure what it does, and the link is dead, and there are no screenshots, and there are no videos or anything, and. Wait. What about the release is great again?

1 Like

Un-private your github plez?

1 Like

oops :face_with_hand_over_mouth:
gimme a minute
edit: unprivated, sorry!

1 Like

This is similar to the implementations that others have written, but this is the first public one, thanks.

However, I am skeptical whether this works in it’s current form. Reason being: you are sending entity handles/ids over the net, but these handles will be different across clients. Are you sure this works with multiple clients? Perhaps you need to use EntityToNet and NetToEntity to get the proper handles?

By itself this resource does nothing. This is more of a tool for developers to use by triggering certain events. If a person doesn’t know how to use this then they shouldn’t, it’s very simple.

3 Likes

Ahh! Alright thanks for clarifying that

This is similar to the implementations that others have written, but this is the first public one, thanks.
However, I am skeptical whether this works in it’s current form. Reason being: you are sending entity handles/ids over the net, but these handles will be different across clients. Are you sure this works with multiple clients? Perhaps you need to use EntityToNet and NetToEntity to get the proper handles?

Good point, I ought to further debug this and make proper changes if necessary.

1 Like

This is honestly pretty sick man!

Not sure what I’m going to do with this yet. I think some of the drag servers can probably use this though. Excited to see what’s next

FINALLY!!! YES THANK YOU! Great fking release. Thank you so much, I’ve been dying to get this. Thank you again. Can I hug you?

FINALLY!!! YES THANK YOU! Great fking release. Thank you so much, I’ve been dying to get this. Thank you again. Can I hug you?

not yet buddy, I have yet to test this with more than one player on the server

Fuck. If you still need someone to help test it lmk.

Nice release, quick question…

Why is this in there?

Citizen.CreateThread(function()
    while true do
        while myworld ~= 0 do
            SetPedDensityMultiplierThisFrame(0)
            SetScenarioPedDensityMultiplierThisFrame(0, 0)
            SetParkedVehicleDensityMultiplierThisFrame(0)
            SetRandomVehicleDensityMultiplierThisFrame(0)
            SetSomeVehicleDensityMultiplierThisFrame(0)
            SetVehicleDensityMultiplierThisFrame(0)
            ClearPlayerWantedLevel(PlayerId())
            Citizen.Wait(0)
        end
        Citizen.Wait(1000)
    end
end)

Are there otherwise bugs with collisions?

This was out of personal preference, I’m using this on a server I’m working on for a player race mini-game and I’d rather not have NPCs or NPC vehicles during the race.

By the way I pushed a little update that fixed entities not disappearing after switching between virtual worlds.

Ok, thank you for the quick reply :slight_smile:

I was gonna make something like this! Thank you

I created a pull request, since you are sending local entity id over the network to other machines.

My PR >>>should<<<, no guarantee, fix this problem but is not tested.

Is it right what i am understanding… Its like different instances? So we could use it for e.g. esx_property??

Looks like this is not instancing, but simply hiding a player from another. You will see opening doors and will hear other players that are hidden.