Giter Site home page Giter Site logo

[Q] Job Requirements about weasel-crafting HOT 8 CLOSED

weaselrp avatar weaselrp commented on August 30, 2024
[Q] Job Requirements

from weasel-crafting.

Comments (8)

Trey2k avatar Trey2k commented on August 30, 2024

To add job requirements you would want to create a custom crafting menu probably from the jobs menu using this trigger TriggerEvent("weasel-crafting:customMenu", (Items structured exactly the same as in the config but for the custom menu), (lvl))

from weasel-crafting.

SantyR0 avatar SantyR0 commented on August 30, 2024

my bad can't make it work, do u have a example? thanks for taking time replying.

i tried it like this, but it keeps giving me errors. I put it on policejob\client\main.lua

local crafttables = {
1917885559
}

exports.qtarget:AddTargetModel(crafttables, {
options = {
{
event = "weasel-crafting:mechcraft",
icon = "fas fa-tools",
label = "Crafting Table"
},
},
distance = 2
})
RegisterNetEvent("weasel-crafting:mechcraft")
AddEventHandler("weasel-crafting:mechcraft", function()
TriggerEvent('weasel-crafting:openMenu',{
Name = "lockpick",
DisplayName = "Lockpick",
Quantity = 2,
MetaData = {},
Time = 10000,
Level = 1,
Recipe = {
{'Schroot', 'scrapmetal', 10, {}, true},
{'Rubber', 'rubber', 2, {}, true},
{'Plastic', 'plastic', 4, {}, true},
{'Staal', 'steel', 3, {}, true},
}})
end)

from weasel-crafting.

Trey2k avatar Trey2k commented on August 30, 2024

That looks like the qtarget example, are you using qtarget?

from weasel-crafting.

SantyR0 avatar SantyR0 commented on August 30, 2024

Yes. I'm sorry for too many question, but trying to learn. I'm trying to make a craftable items per job. I have managed to make a crafting entity by following the guide but I want to make different craftable items per job.

from weasel-crafting.

Trey2k avatar Trey2k commented on August 30, 2024

I have attached one of our resources that used a custom crafting menu. You would want to use the same method for the police job.
weasel-selling.zip

from weasel-crafting.

SantyR0 avatar SantyR0 commented on August 30, 2024

Wow thanks, this is good. But I need to make it only accessible for certain job. Is there any way to make it that way?

from weasel-crafting.

Trey2k avatar Trey2k commented on August 30, 2024

Yes, if you do it exactly the same as the file I sent you but move the event trigger to the jobs menu. Only that job will be able to access it.

from weasel-crafting.

SantyR0 avatar SantyR0 commented on August 30, 2024

Sorry, I don't understand how I can do that instead I do this:

RegisterNetEvent("weasel-crafting:police")
AddEventHandler("weasel-crafting:police", function(Crafting)
EnableGui(true)
SendNUIMessage({
type = "addCraftingItems",
Items = Config.Police,
BtnText = "Craft Item(s)",
})
TriggerEvent('weasel-crafting:police', 1)
end)

exports.qtarget:AddTargetModel({1917885559, 666561306}, {
options = {
{
event = "weasel-crafting:police",
icon = "fas fa-box-circle-check",
label = "action 1",
num = 1,
job = "police",
}
},
distance = 2
})

I believe it works not in a way that the crafting menu is limited to a specific job but I'm receiving this error:
image

Am I doing something wrong?

from weasel-crafting.

Related Issues (3)

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.