Comments (8)
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.
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.
can you send the code readable?
you can use
from meta_target.
are u able to see this ?
from meta_target.
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.
not working man still everyone is able to access it
what does foo = 'bar' do ??
from meta_target.
what framework you are using esx or qbcore?
from meta_target.
Esx
from meta_target.
Related Issues (20)
- multiple options showing HOT 1
- Melee Issues HOT 3
- meta_target for housing-v3
- Target not clearing, can still be accessed far away HOT 5
- Feature Request: Pass entity ID onSelect HOT 1
- polyzone issue
- addModels HOT 3
- how to open HOT 8
- meta_target entitytype options HOT 3
- meta_target HOT 7
- no doc and also no discord where we can get info HOT 2
- Add Compatibility with qb-target
- Add CanInteract function HOT 2
- s2w nil value error HOT 1
- I tried to use the example HOT 3
- readme missing info on default reveal hotkey HOT 4
- no way to get entity handle HOT 6
- no example for how to use .addVehicle HOT 9
- addPlayer doesn't work if player ped is frozen HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meta_target.