Code Monkey home page Code Monkey logo

tnj-smallresources's Introduction

tnj-smallresources

In this resource are some standalone addons which you can add to the current 'qb-smallresources' resource.

All .lua's in client should go into the client folder in 'qb-smallresources'.

All .lua's in server should go into the server folder in 'qb-smallresources'

bin.lua

This gives players the ability to hide in bins using qb-target.

btf.lua

This gives players the ability to 'travel back to the future' (to a waypoint) using a deluxo at 88mph. It will leave particles as you teleport.

Commands:

/btf

practiselaptop.lua

This gives players the ability to 'practise' the bank hacks using a laptop item.

Installation:

in 'qb-core/shared/items.lua'

["practicelaptop"] 		 	 	 = {["name"] = "practicelaptop",           		["label"] = "Practice Laptop",	 		["weight"] = 2500, 		["type"] = "item", 		["image"] = "boostinglaptop.png", 		["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,   	["combinable"] = nil,   ["description"] = "A laptop"},

trunk.lua

Allows for players to enter the trunk of a vehicle.

Commands:

/git - Get in the trunk of closest vehicle
/pit - Put person in trunk
/dot - Drag person out of trunk

Installation:

in 'qb-core/client/functions.lua'

function QBCore.Functions.RequestAnimDict(animDict)
	if not HasAnimDictLoaded(animDict) then
		RequestAnimDict(animDict)

		while not HasAnimDictLoaded(animDict) do
			Wait(4)
		end
	end
end

QBCore.Functions.LoadAnimDict = function(dict)
	while (not HasAnimDictLoaded(dict)) do RequestAnimDict(dict) Citizen.Wait(5); end
end

QBCore.Functions.RemoveAnimDict = function(dict)
	RemoveAnimDict(dict)
end

QBCore.Functions.VehicleInFront = function()
    local pos = GetEntityCoords(PlayerPedId())
    local entityWorld = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 3.0, 0.0)
    local rayHandle = CastRayPointToPoint(pos.x, pos.y, pos.z, entityWorld.x, entityWorld.y, entityWorld.z, 10, PlayerPedId(), 0)
    local a, b, c, d, result = GetRaycastResult(rayHandle)
    return result
end

QBCore.Functions.GetClosestPlayerRadius = function(radius)
    local players = QBCore.Functions.GetPlayers()
    local closestDistance = -1
    local closestPlayer = -1
    local ply = PlayerPedId()
    local plyCoords = GetEntityCoords(ply)

    for index,value in ipairs(players) do
        local target = GetPlayerPed(value)
        if(target ~= ply) then
            local targetCoords = GetEntityCoords(GetPlayerPed(value), 0)
            local distance = #(targetCoords - plyCoords)
            if(closestDistance == -1 or closestDistance > distance) then
                closestPlayer = value
                closestDistance = distance
            end
        end
    end
	print("closest player is dist: " .. tostring(closestDistance))
	if closestDistance ~= -1 and closestDistance <= radius then
		return closestPlayer
	else
		return nil
	end
end

function PersistentAlert(action, id, ttype, text, style)
	if ttype == 'inform' then ttype = 'primary'; end
	QBCore.Functions.PersistentNotify(action, id, text, ttype, style)
end

exports('PersistentAlert', PersistentAlert);

QBCore.Functions.PersistentNotify = function(action, id, text, textype, style)
	if action:upper() == 'START' then
		SendNUIMessage({
			persist = action,
			id = id,
			type = textype,
			text = text,
			style = style
		})
	elseif action:upper() == 'END' then
		SendNUIMessage({
			persist = action,
			id = id
		})
	end
end

QB TARGET

Config.TargetModels = {
	["BIN"] = {
        models = {
            "prop_dumpster_01a", 
            "prop_dumpster_02a", 
            "prop_dumpster_02b", 
            "prop_dumpster_4a", 
            "prop_dumpster_4b",
        },
        options = {
            {
                type = "client",
                event = "dcrp-dumpsters:getInBin",
                
                icon = "fa-solid fa-dumpster",
                label = "Hide In Bin",
            },
        },
        distance = 3.0
    },
}

tnj-smallresources's People

Contributors

csgwilliams avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.