Skip to content

support interior type #10

Description

@AstroNext

Hi I think this resource missed interior support.
I edit my resource with these codes.

exports

exports('AddTargetInterior',function(opts) 
	if not opts or not opts.name or not opts.label or not opts.interiorId or not opts.options then error("Invalid opts for AddTargetInterior",1) return end
	table.insert(allTargets,{
		typeof        = "interior",
		name          = opts.name,
		label         = opts.label,
		icon          = opts.icon or "fas fa-question",
		interiorId    = opts.interiorId,
		onInteract    = opts.onInteract,
		options       = opts.options,
		vars          = opts.vars,
		resource      = GetInvokingResource()
	})
end)

Loop

if v.typeof == "interior" then
	if GetInteriorFromEntity(PlayerPedId()) == v.interiorId then
		targets[v.name] = v
		if not activeTargets[v.name] then
			updateTargets = true
		end
	else
		if activeTargets[v.name] then
			activeTargets[v.name] = false
			updateTargets = true
		end
	end
end

Command

RegisterCommand('interiorid', function()
    local ped = PlayerPedId()
    local interior = GetInteriorFromEntity(ped)
    if IsValidInterior(interior) then
        local group = GetInteriorGroupId(interior)
        local heading = GetInteriorHeading(interior)
        local coords, hash = GetInteriorLocationAndNamehash(interior)
        print('Id : ' .. interior, 'Group : ' ..group,'Heading : '..heading, 'Coords : ' .. coords,"Hash : " ..hash)
    end
end)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions