Giter Club home page Giter Club logo

Comments (8)

BaziForYou avatar BaziForYou commented on September 6, 2024 1

hi use canShow function here one example can give you to put as canShow

canShow = function(target,pos,ent,endPos,modelHash,isNetworked,netId,targetDist,entityType)
    if ESX and ESX.PlayerData and ESX.PlayerData.job and ESX.PlayerData.job.name == "police" then
        return true
    end
    return false
end

from meta_target.

Arcticguy867 avatar Arcticguy867 commented on September 6, 2024

is there a way u can tell me how to put it in this ??

    exports.qtarget:AddBoxZone("uwu_register_2", vector3(-584.25, -1061.5, 22.37), 0.6, 0.5, {
        name="uwu_register_2",
        debugPoly = false,
        heading=270,
        minZ=21.0,
        maxZ=22.8,
        }, {
                options = {
                    {
                        event = "qb-uwu:bill",
                        parms = "2",
                        icon = "fas fa-credit-card",
                        label = "Charge Customer",
                        job = "uwu",
                    },
                },
                distance = 1.5
            })

end)

RegisterNetEvent("qb-uwu:bill", function()
local bill = exports["qb-input"]:ShowInput({
header = "Create Receipt",
submitText = "Charge Customer",
inputs = {
{
type = 'number',
name = "id",
text = 'ID',
isRequired = true,
},
{
type = 'number',
name = "amount",
text = '$',
isRequired = true
},
}
})
if bill ~= nil then
if not bill.id or not bill.amount then
return
end

    TriggerServerEvent('srp_billing:sendBill', bill.id, 'society_uwu', 'UwU Cafe', bill.amount)
end

end)

from meta_target.

BaziForYou avatar BaziForYou commented on September 6, 2024

can you send the code readable?
you can use
image

from meta_target.

Arcticguy867 avatar Arcticguy867 commented on September 6, 2024

https://ctxt.io/2/AAAQ1p28FA

are u able to see this ?

from meta_target.

BaziForYou avatar BaziForYou commented on September 6, 2024

didn't test this code but should be something like this

local PlayerData = {}
RegisterNetEvent('esx:playerLoaded', function(xPlayer)
	PlayerData = xPlayer
end)

RegisterNetEvent('esx:setJob', function(job)
	PlayerData.job = job
end)

RegisterNetEvent('esx:onPlayerLogout', function()
	PlayerData = {}
end)

AddEventHandler('esx:setPlayerData', function(key, val)
	if GetInvokingResource() == 'es_extended' then
		PlayerData[key] = val
	end
end)

exports.qtarget:AddBoxZone("uwu_register_2", vector3(-584.25, -1061.5, 22.37), 0.6, 0.5, {
	name="uwu_register_2",
	debugPoly = false,
	heading=270,
	minZ=21.0,
	maxZ=22.8,
	},
	{
		options = {
			{
				event = "qb-uwu:bill",
				parms = "2",
				icon = "fas fa-credit-card",
				label = "Charge Customer",
			},
		},
		distance = 1.5,
		canShow = function(target,pos,ent,endPos,modelHash,isNetworked,netId,targetDist,entityType)
			if PlayerData.job and PlayerData.job.name and PlayerData.job.name == "uwu" then
				return true
			end
			return false
		end
	}
)

from meta_target.

Arcticguy867 avatar Arcticguy867 commented on September 6, 2024

not working man still everyone is able to access it
what does foo = 'bar' do ??

from meta_target.

BaziForYou avatar BaziForYou commented on September 6, 2024

what framework you are using esx or qbcore?

from meta_target.

Arcticguy867 avatar Arcticguy867 commented on September 6, 2024

Esx

from meta_target.

Related Issues (20)

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.