I have 2 problems. First minor problem I have is, I made a weed processing room, made it in to a ymap put it in resources, loaded the server and it’s a 50/50 shot it will load when I restart the server. Sometimes it will load in the area, sometimes it won’t load. What did I do wrong, seeing how all the other rooms added are ALWAYS there on load up?

2nd problem This room I made is not an instance like all the other rooms in the game and I would like to know how to make it an instance everyone can enter at the same time. So anyone doing drug runs needing to process weed will all be able to see/talk to one another. I would like it instanced but not like houses. Houses/apartments only allow one person to go in and you must invite each player, I would like this instance where anyone looking to process can go in with one another.

Also I’m a nub learning so I found an answer to this but have no clue where this code would go or how to get it to work. Thanks in advance for any help provided.

SET_ENTITY_LOCALLY_INVISIBLE #
// 0xE135A9FF3F5D05D8 0x51ADCC5F
// SetEntityLocallyInvisible
void SET_ENTITY_LOCALLY_INVISIBLE(Entity entity);

SET_ENTITY_LOCALLY_VISIBLE #
// 0x241E289B5C059EDC 0x235A57B3
// SetEntityLocallyVisible
void SET_ENTITY_LOCALLY_VISIBLE(Entity entity);

Problem #1:
Likely a case of you haven’t downloaded the props yet, as some of my players get this same issue when loading the interior for the first time, but subsequent times are fine.

Problem #2:
You can put teleport pads in to have players teleport from one area to this interior. I use a script that I can’t find for the life of me, but I’ll post the code here.

__resource.lua
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'

client_scripts {
    'client.lua'
}
client.lua
--positionTo	= enter
--positionFrom	= exit

local TeleportFromTo = {
	["Example 1"] = {
		positionTo = { ['x'] = 0.0, ['y'] = 0.0, ['z'] = 0.0, nom = "Enter Room"},
		positionFrom = { ['x'] = 0.0, ['y'] = 0.0, ['z'] = 0.0, nom = "Exit Room"},
	},

	["Coke Process"] = {
		positionTo = { ['x'] = 0.0, ['y'] = 0.0, ['z'] = 0.0, nom = "Enter Room"},
		positionFrom = { ['x'] = 0.0, ['y'] = 0.0, ['z'] = 0.0, nom = "Exit Room"},
	},
}

Drawing = setmetatable({}, Drawing)
Drawing.__index = Drawing


function Drawing.draw3DText(x,y,z,textInput,fontId,scaleX,scaleY,r, g, b, a)
    local px,py,pz=table.unpack(GetGameplayCamCoords())
    local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)

    local scale = (1/dist)*20
    local fov = (1/GetGameplayCamFov())*100
    local scale = scale*fov

    SetTextScale(scaleX*scale, scaleY*scale)
    SetTextFont(fontId)
    SetTextProportional(1)
    SetTextColour(r, g, b, a)
    SetTextDropshadow(0, 0, 0, 0, 255)
    SetTextEdge(2, 0, 0, 0, 150)
    SetTextDropShadow()
    SetTextOutline()
    SetTextEntry("STRING")
    SetTextCentre(1)
    AddTextComponentString(textInput)
    SetDrawOrigin(x,y,z+2, 0)
    DrawText(0.0, 0.0)
    ClearDrawOrigin()
end

function Drawing.drawMissionText(m_text, showtime)
    ClearPrints()
    SetTextEntry_2("STRING")
    AddTextComponentString(m_text)
    DrawSubtitleTimed(showtime, 1)
end

function msginf(msg, duree)
    duree = duree or 500
    ClearPrints()
    SetTextEntry_2("STRING")
    AddTextComponentString(msg)
    DrawSubtitleTimed(duree, 1)
end

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(2)
		local pos = GetEntityCoords(GetPlayerPed(-1), true)

		for k, j in pairs(TeleportFromTo) do

			--msginf(k .. " " .. tostring(j.positionFrom.x), 15000)
			if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 5.0)then
				DrawMarker(1, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, .801, 255, 255, 255,255, 0, 0, 0,0)
				if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 5.0)then
					Drawing.draw3DText(j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1.100, j.positionFrom.nom, 1, 0.2, 0.1, 255, 255, 255, 215)
					if(Vdist(pos.x, pos.y, pos.z, j.positionFrom.x, j.positionFrom.y, j.positionFrom.z) < 1.0)then
						ClearPrints()
						SetTextEntry_2("STRING")
						AddTextComponentString("Press [~p~E~w~] to exit.")
						DrawSubtitleTimed(0, 1)
						if IsControlJustPressed(1, 38) then
							DoScreenFadeOut(500)
							Citizen.Wait(2000)
							SetEntityCoords(GetPlayerPed(-1), j.positionTo.x, j.positionTo.y, j.positionTo.z - 1)
							DoScreenFadeIn(1500)
						end
					end
				end
			end

			if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 2.0)then
				DrawMarker(1, j.positionTo.x, j.positionTo.y, j.positionTo.z - 1, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, .801, 68, 68, 68,64, 0, 0, 0,0)
				if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 1.0)then
					Drawing.draw3DText(j.positionTo.x, j.positionTo.y, j.positionTo.z - 1.100, j.positionTo.nom, 1, 0.2, 0.1, 255, 255, 255, 215)
					if(Vdist(pos.x, pos.y, pos.z, j.positionTo.x, j.positionTo.y, j.positionTo.z) < 1.0)then
						ClearPrints()
						SetTextEntry_2("STRING")
						AddTextComponentString("Press [~p~E~w~] to enter.")
						DrawSubtitleTimed(0, 1)
						if IsControlJustPressed(1, 38) then
							DoScreenFadeOut(500)
							Citizen.Wait(2000)
							SetEntityCoords(GetPlayerPed(-1), j.positionFrom.x, j.positionFrom.y, j.positionFrom.z - 1)
							DoScreenFadeIn(1500)
						end
					end
				end
			end
		end
	end
end)

Okay, thanks a million on the first issue. 2nd issue much appreciated, I have a teleport script but yours looks so much more in depth so I’ll use this one for sure. Last question since you clearly know your shit. When it rains, it rains in the room… The only way to stop this is make collisions in 3ds max or is there an easier way? Again, thanks for your help, I thought I was going nuts cause the room would show up sometimes then other times nothing.

I have no idea how to stop rain from getting inside the room. Happens with my ymaps also. Kinda annoying, but until I figure out how to stop it, I just use the old “Man, they need to call a plumber, i think the roof has a leak” line in RP :stuck_out_tongue:

1 Like

Lmfao! Dude, thanks for helping me. You made my day! Much love to you, cuz!