[HELP] Open a menu only if you have a specific job?


#1

Hi, I need help of the community because i’m trying to release some scripts but i’m alway stuck when is the time to open a specific menu only if you have the right job but I’m trying to find something in a lot of script but i can’t understand how it’s work so if someone can help me ? P.S: I’m french and english too :wink: Screen : https://gyazo.com/d160a1f52fce893b2e2a58793fa587d0 https://gyazo.com/5ee25a9d45f61900b621b4877c5493b7


#2

this mod looks nice

but i cant help you sry


#3

You have the jobsystem?


#4

Yes ! you’re french no ?


#5
function nameJob(player)
  local executed_query = MySQL:executeQuery("SELECT identifier, job_id, job_name FROM users LEFT JOIN jobs ON jobs.job_id = users.job WHERE users.identifier = '@identifier'", {['@identifier'] = player})
  local result = MySQL:getResults(executed_query, {'job_name'}, "identifier")
  return tostring(result[1].job_name)
end

and use

local namejob = nameJob(player)
    -- NAME OF YOUR JOB
    if namejob == "Mineur" then

#6

Tanks you so much i will test it right now !


#7

function nameJob goes in server.lua and local namejob in client.lua ?


#8

all in server.lua ^^


#9

Wait i’m giving you some screen


#10

Because all my HUD is in client.lua so i what i need to do after the then in server.lua


#11

you can create a code line to open the menu in server.lua ! :slight_smile:


#12

Okay do you have an idea how ?


#13

You can send your code to open the menu ? :wink:


#14

yes for sure ! let’s me 2 sec


#15

if IsControlJustPressed(1,51) and IsPlayerInRangeOfweashop() then
if weashop.opened then
CloseCreator()
else
OpenCreator()
end
end


#16

IsControlJustPressed(1,51) and IsPlayerInRangeOfweashop() and Jobname == “Mineur” for exemple ?


#17

Yes, have you teamspeak?


#18

Yes you have one or you want my ?


#19

Join me ^^ alcatrazrp.ts3serv.com


#20

No more idea ? Please I really need help ! I’m with Job system !