no we need to ask the maker of this script to convert it to 3.0
+1 I have the same problem, impossible to harvest items as long as blips does not appear on the map.
I am not yet at 3.0, and for now I do not intend to go there.
@PandaBasketteur Hello ! Is there a way to hide/show a job in the selection only if the player is whitelisted (i use cops five m and want to hide āpolicierā for all non policer. ty
Itās simple, you make an event that you call as you like, a server event (before adding the buttons), you verify if it has the right to take with a request ā¦ Simple (SELECT)
If the table is not null you return true (or equal to a number, short condition) otherwise false.
You return this value to the client event by not forgetting the source, and then you add conditions by adding buttons only if the send value is true or false.
Putting words in French is not optimizingā¦ xD
Possible to add the work in the hud at the top right ?
I want to close the menu of job, after selecting one of them, itās possible please ?
In function changeJob add : Menu.hidden = not Menu.hidden
Hello, Iām looking for a way to give some prime to some people of my server . And those prime will change based on their behavior so that needs to be per person and variable . I tried to change your sql query in paycheck from INNER JOIN to FULL JOIN and adding a salary column in users but it doesnt . Any idea to help me ?
In case you are french
Jāessaye dāoctroyer des primes Ć certains joueurs avec votre script paycheck . Pour se faire jāai crĆ©Ć© une colone salary dans la table users en plus de celle dans jobs et jāai remplace votre query INNER JOIN en FULL JOIN , espĆ©rant que cela allait combinĆ© les 2 montants . Ca ne fonctionne malheureusement pas . Il me faudrait donc un peu dāaide . Cette prime devrait etre modifiable et assignĆ© Ć un seul joueur et devrait se rajouter au salaire liĆ© Ć son job .
Thanks / Merci
don"t work for me Someone work for him ?
function changeJob(id)
TriggerServerEvent("jobssystem:jobs", id)
Menu.hidden = not Menu.hidden
Menu.renderGUI()
end
Full code
Full join is not the solution, you must add a āprimeā table is make a code like this :
local executed_query = MySQL:executeQuery("SELECT salary,prime FROM users INNER JOIN jobs ON users.job = jobs.job_id WHERE identifier = '@username'",{['@username'] = user_id})
local result = MySQL:getResults(executed_query, {'salary','prime'})
local salary_job = result[1].salary
local prime = result[1].prime
user:addMoney((salary + prime + salary_job))
You can do even better:
local executed_query = MySQL:executeQuery("SELECT salary,prime FROM users INNER JOIN jobs ON users.job = jobs.job_id WHERE identifier = '@username'",{['@username'] = user_id})
local result = MySQL:getResults(executed_query, {'salary','prime'})
local salary_job = result[1].salary
if result[1].prime then
local prime = result[1].prime
user:addMoney((salary + prime + salary_job))
TriggerClientEvent("es_freeroam:notify", source, "CHAR_BANK_MAZE", 1, "Maze Bank", false, "Prime reƧu : " .. prime .. "~g~ā¬~s~~n~Salaire reƧu : + "..salary.."~g~ā¬~s~~n~Salaire metier reƧu : + "..salary_job.." ~g~ā¬")
else
user:addMoney((salary + salary_job))
TriggerClientEvent("es_freeroam:notify", source, "CHAR_BANK_MAZE", 1, "Maze Bank", false, "Salaire reƧu : + "..salary.."~g~ā¬~s~~n~Salaire metier reƧu : + "..salary_job.." ~g~ā¬")
end
Here.
(If the query does not work, replace SELECT salary, prime by SELECT salary, users.prime but ā¦ normally no query problem since you do not have prime tables in the table jobs so no conflict)
I got one problem. I select the jobs using the menu but nothing happens.
I get no confirmation or anything. In the DB it says in the users table that my job id is 4, which should be correct.
And yes, I do have the jobs table also.
Any tips?
Edit: When I do /job list I only have the default ones, not miner or cab driver.
Thanks a lot mate . I added a table prime to users and Iām gonna try now .
Works fine, thank you bro
function menuJobs()
MenuTitle = "Jobs"
ClearMenu()
for _, item in pairs(jobs) do
local nameJob = item.name
local idJob = item.id
Menu.addButton(nameJob,"changeJob",idJob)
end
end
function changeJob(id)
TriggerServerEvent("jobssystem:jobs", id)
Menu.hidden = not Menu.hidden
end
Anyone got a working Paycheck v1.0? iāve set mine up with couchDB so i think i need that version but thereās nothing on @PandaBasketteur git.
I know, iām not going to do update for DB layer simply because i would not pass for the moment to this method, i prefer MySQL which holds for the moment the road with 24 slots.
Itās possible to get different player model when choosing a job? This would be very interesting and I think many people want this
Good work to the author, and to all those who do their best to help us