BigBoss1234 Posted April 11, 2023 Share Posted April 11, 2023 (edited) -- Group payout timer function sendTurfPayout ( ) local playerJobs = { } for i, Police Officer in pairs ( getElementsByType ( 'player' ) ) do local exports.NGJobs:getPlayerJobs ( 'Police Officer' ) if ( g and playerJobs [ g ] and playerJobs [ g ] > 0 ) then local c = playerJobs [ g ] * tonumber ( get ( "*PAYOUT_CASH" ) ) givePlayerMoney ( Police Officer, c ) exports.NGMessages:sendClientMessage ( "Police: Here is $ "( playerJobs [ g ] ).."playout" v, 0, 255, 0 ) end end end setTimer ( sendTurfPayout, (60*tonumber(get("*PAYOUT_TIME")))*1000, 0 ) Help fro fix that Edited April 11, 2023 by BigBoss1234 Link to comment
P[ow]er Posted April 13, 2023 Share Posted April 13, 2023 function sendTurfPayout() local playerJobs = {} for i, policeOfficer in ipairs(getElementsByType('player')) do local jobName = exports.NGJobs:getPlayerJob(policeOfficer) if jobName == 'Police Officer' then local jobLevel = exports.NGJobs:getPlayerJobLevel(policeOfficer, jobName) if jobLevel and jobLevel > 0 then local payout = jobLevel * tonumber(get('*PAYOUT_CASH')) givePlayerMoney(policeOfficer, payout) exports.NGMessages:sendClientMessage(policeOfficer, 'Police: Here is $'..payout..' payout', 0, 255, 0) end end end end setTimer(sendTurfPayout, (60 * tonumber(get('*PAYOUT_TIME'))) * 1000, 0) Try it and say if it works please Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now