How to add a permission to marker

I would like to put that only the instructors can buy the cars

function vehSR_OpenCreator()
boughtcar = false
local ped = vehSR_LocalPed()
local pos = currentlocation.pos.inside
FreezeEntityPosition(ped,true)
SetEntityVisible(ped,false)
local g = Citizen.InvokeNative(0xC906A7DAB05C8D2B,pos[1],pos[2],pos[3],Citizen.PointerValueFloat(),0)
SetEntityCoords(ped,pos[1],pos[2],g)
SetEntityHeading(ped,pos[4])
vehshop.currentmenu = “main”
vehshop.opened = true
vehshop.selectedbutton = 0
end

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the FiveM community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!
:mascot:

Maybe an idea to say which framework you’re using?

the framework is vrp

if vRP.hasPermission(user_id, permission) then

I would like to add this permission if don’t have this permission send a message “you don’t have permission for do this” it possible?

if/else Send a hug ‘-’

Send a hug ‘-’ what do you mean?

just remembering that there is IF and ELSE

– build trash action
item.ch_trash = function(player,choice)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
– prompt number
if vRP.hasPermission(user_id, “object.trash”) then
vRP.prompt(player,lang.inventory.trash.prompt({vRP.getInventoryItemAmount(user_id,idname)}),"",function(player,amount)
local amount = parseInt(amount)
if vRP.tryGetInventoryItem(user_id,idname,amount,false) then
vRPclient.notify(player,{lang.inventory.trash.done({vRP.getItemName(idname),amount})})
vRPclient.playAnim(player,{true,{{“pickup_object”,“pickup_low”,1}},false})
else
vRPclient.notify(player,{lang.common.invalid_value()})
end
end)
else vRPclient.notify(player,{“Test”})
end
end
end
end

In this code doesn’t work why?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.