[{"data":1,"prerenderedAt":488},["ShallowReactive",2],{"/docs/jobs/jobcreator/api/shared-job-apis":3,"/docs/jobs/jobcreator/api/shared-job-apis-surround":474,"/docs/jobs/jobcreator/api/shared-job-apis-implemented-suggestions":487},{"id":4,"title":5,"body":6,"description":463,"extension":464,"head":465,"implementedSuggestions":465,"meta":466,"navigation":467,"path":469,"schemaOrg":465,"seo":470,"sitemap":471,"stem":472,"__hash__":473},"docs/1.docs/0.jobs/6.jobcreator/5.api/3.shared-job-apis.md","Shared Job APIs",{"type":7,"value":8,"toc":458},"minimark",[9,25,30,51,189,194,198,208,277,292,296,448,451,454],[10,11,12,13,20,21,24],"p",{},"Creator jobs use ",[14,15,16],"strong",{},[17,18,19],"code",{},"sky_jobs_base"," for shared gameplay. Call the owner named in each reference; adding ",[17,22,23],{},"sky_jobcreator"," to an export name does not expose another copy of the API.",[26,27,29],"h2",{"id":28},"read-a-players-job","Read a player's job",[10,31,32,38,39,42,43,46,47,50],{},[14,33,34,35,37],{},"Server · ",[17,36,19],{},"."," ",[17,40,41],{},"getPlayerJobInfo(playerId)"," takes an online player's numeric server ID. It returns ",[17,44,45],{},"{ job, grade, gradeLabel, onDuty }",", or ",[17,48,49],{},"nil"," when the player is invalid or not loaded.",[52,53,59],"pre",{"className":54,"code":55,"filename":56,"language":57,"meta":58,"style":58},"language-lua shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","-- player_source is the actual source of your authorized server request.\nlocal info = exports[\"sky_jobs_base\"]:getPlayerJobInfo(player_source)\nif not info then\n    print(\"Job lookup failed: the player is not loaded\")\n    return\nend\n\nprint(info.job, info.grade, info.gradeLabel, info.onDuty)\n","server.lua","lua","",[17,60,61,70,105,120,139,145,151,158],{"__ignoreMap":58},[62,63,66],"span",{"class":64,"line":65},"line",1,[62,67,69],{"class":68},"sHwdD","-- player_source is the actual source of your authorized server request.\n",[62,71,73,77,81,84,87,90,93,95,98,102],{"class":64,"line":72},2,[62,74,76],{"class":75},"sMK4o","local",[62,78,80],{"class":79},"sTEyZ"," info ",[62,82,83],{"class":75},"=",[62,85,86],{"class":79}," exports[",[62,88,89],{"class":75},"\"",[62,91,19],{"class":92},"sfazB",[62,94,89],{"class":75},[62,96,97],{"class":79},"]:",[62,99,101],{"class":100},"s2Zo4","getPlayerJobInfo",[62,103,104],{"class":79},"(player_source)\n",[62,106,108,112,115,117],{"class":64,"line":107},3,[62,109,111],{"class":110},"s7zQu","if",[62,113,114],{"class":75}," not",[62,116,80],{"class":79},[62,118,119],{"class":110},"then\n",[62,121,123,126,129,131,134,136],{"class":64,"line":122},4,[62,124,125],{"class":100},"    print",[62,127,128],{"class":79},"(",[62,130,89],{"class":75},[62,132,133],{"class":92},"Job lookup failed: the player is not loaded",[62,135,89],{"class":75},[62,137,138],{"class":79},")\n",[62,140,142],{"class":64,"line":141},5,[62,143,144],{"class":110},"    return\n",[62,146,148],{"class":64,"line":147},6,[62,149,150],{"class":110},"end\n",[62,152,154],{"class":64,"line":153},7,[62,155,157],{"emptyLinePlaceholder":156},true,"\n",[62,159,161,164,167,171,174,177,179,182,184,187],{"class":64,"line":160},8,[62,162,163],{"class":100},"print",[62,165,166],{"class":79},"(info.",[62,168,170],{"class":169},"sBMFI","job",[62,172,173],{"class":79},", info.",[62,175,176],{"class":169},"grade",[62,178,173],{"class":79},[62,180,181],{"class":169},"gradeLabel",[62,183,173],{"class":79},[62,185,186],{"class":169},"onDuty",[62,188,138],{"class":79},[10,190,191,193],{},[17,192,170],{}," is the technical job key, not its display label. Keep real grade numbers, including gaps; a grade is not an array position. Resolve current identity, job and duty on the server rather than trusting a client copy.",[26,195,197],{"id":196},"duty","Duty",[10,199,200,38,204,207],{},[14,201,34,202,37],{},[17,203,19],{},[17,205,206],{},"setPlayerDuty(playerId, onDuty)"," takes a numeric player server ID and an explicit boolean. It returns whether the resulting cached duty state matches the requested state. It uses the shared duty pipeline; it does not create a duty-capable job or grant your caller permission.",[52,209,211],{"className":54,"code":210,"filename":56,"language":57,"meta":58,"style":58},"-- Run only after your integration has authorized this change.\nlocal changed = exports[\"sky_jobs_base\"]:setPlayerDuty(player_source, false)\nif not changed then\n    print(\"The requested duty state could not be applied\")\nend\n",[17,212,213,218,248,258,273],{"__ignoreMap":58},[62,214,215],{"class":64,"line":65},[62,216,217],{"class":68},"-- Run only after your integration has authorized this change.\n",[62,219,220,222,225,227,229,231,233,235,237,240,243,246],{"class":64,"line":72},[62,221,76],{"class":75},[62,223,224],{"class":79}," changed ",[62,226,83],{"class":75},[62,228,86],{"class":79},[62,230,89],{"class":75},[62,232,19],{"class":92},[62,234,89],{"class":75},[62,236,97],{"class":79},[62,238,239],{"class":100},"setPlayerDuty",[62,241,242],{"class":79},"(player_source, ",[62,244,245],{"class":75},"false",[62,247,138],{"class":79},[62,249,250,252,254,256],{"class":64,"line":107},[62,251,111],{"class":110},[62,253,114],{"class":75},[62,255,224],{"class":79},[62,257,119],{"class":110},[62,259,260,262,264,266,269,271],{"class":64,"line":122},[62,261,125],{"class":100},[62,263,128],{"class":79},[62,265,89],{"class":75},[62,267,268],{"class":92},"The requested duty state could not be applied",[62,270,89],{"class":75},[62,272,138],{"class":79},[62,274,275],{"class":64,"line":141},[62,276,150],{"class":110},[10,278,279,280,284,285,288,289,37],{},"See ",[281,282,197],"a",{"href":283},"/docs/base/jobs-base/server-exports/duty"," for ",[17,286,287],{},"isPlayerOnDuty"," and ",[17,290,291],{},"getOnDutyPlayers",[26,293,295],{"id":294},"feature-references","Feature references",[297,298,299,312],"table",{},[300,301,302],"thead",{},[303,304,305,309],"tr",{},[306,307,308],"th",{},"Feature",[306,310,311],{},"API reference",[313,314,315,327,338,349,360,371,386,400,411,426,437],"tbody",{},[303,316,317,321],{},[318,319,320],"td",{},"Employee membership, hiring and grade changes",[318,322,323],{},[281,324,326],{"href":325},"/docs/base/jobs-base/server-exports/players-members","Players & Members",[303,328,329,332],{},[318,330,331],{},"Rank and management permissions",[318,333,334],{},[281,335,337],{"href":336},"/docs/base/jobs-base/server-exports/permissions","Permissions",[303,339,340,343],{},[318,341,342],{},"Work-time salary controls",[318,344,345],{},[281,346,348],{"href":347},"/docs/base/jobs-base/server-exports/salary","Salary",[303,350,351,354],{},[318,352,353],{},"Society balances and money changes",[318,355,356],{},[281,357,359],{"href":358},"/docs/base/jobs-base/server-exports/society-money","Society Money",[303,361,362,365],{},[318,363,364],{},"Invoice creation and confirmed payment events",[318,366,367],{},[281,368,370],{"href":369},"/docs/base/jobs-base/server-exports/billing","Billing",[303,372,373,376],{},[318,374,375],{},"Business status and announcements",[318,377,378,288,382],{},[281,379,381],{"href":380},"/docs/base/jobs-base/server-exports/business","Business server API",[281,383,385],{"href":384},"/docs/base/jobs-base/client-exports/business","client API",[303,387,388,391],{},[318,389,390],{},"Shared job inventory",[318,392,393,288,397],{},[281,394,396],{"href":395},"/docs/base/jobs-base/server-exports/storage","Storage server API",[281,398,385],{"href":399},"/docs/base/jobs-base/client-exports/storage",[303,401,402,405],{},[318,403,404],{},"Vehicles spawned by an external garage",[318,406,407],{},[281,408,410],{"href":409},"/docs/base/jobs-base/server-exports/external-garage-integration","External Garage Integration",[303,412,413,416],{},[318,414,415],{},"Radial actions and player interactions",[318,417,418,288,422],{},[281,419,421],{"href":420},"/docs/base/jobs-base/client-exports/radial-menu","Radial Menu",[281,423,425],{"href":424},"/docs/base/jobs-base/client-exports/player-interactions","Player Interactions",[303,427,428,431],{},[318,429,430],{},"Documents and tablet integrations",[318,432,433],{},[281,434,436],{"href":435},"/docs/base/jobs-base/client-exports","Jobs Base client exports",[303,438,439,442],{},[318,440,441],{},"Shared library startup",[318,443,444],{},[281,445,447],{"href":446},"/docs/base/jobs-base/library-and-startup","Library and Startup",[10,449,450],{},"A shared API being available does not enable every feature for every job. The job's saved feature settings, provider, permissions, duty and resource exclusions still apply. Generic Creator jobs do not gain specialized Police, Ambulance, Mechanic, Fire, Crime or DOJ gameplay by calling a shared export.",[10,452,453],{},"Job definitions and gameplay configuration have different owners. Use the Creator administration workflow to create/edit framework definitions, and its shared configuration sections for locations and feature settings. Employee and duty exports operate on the existing job; they do not create or configure that job.",[455,456,457],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":58,"searchDepth":65,"depth":72,"links":459},[460,461,462],{"id":28,"depth":72,"text":29},{"id":196,"depth":72,"text":197},{"id":294,"depth":72,"text":295},"Connect Creator jobs to Jobs Base duty, employees, salary, garage, business and tablet APIs.","md",null,{},{"icon":468},"i-lucide-blocks","/docs/jobs/jobcreator/api/shared-job-apis",{"title":5,"description":463},{"loc":469},"1.docs/0.jobs/6.jobcreator/5.api/3.shared-job-apis","DX0ZMchC14c4u5ZDySaixPivDmu9wp3_OSLEFSRk794",[475,481],{"title":476,"path":477,"stem":478,"description":479,"icon":480,"children":-1},"Server Exports","/docs/jobs/jobcreator/api/server-exports","1.docs/0.jobs/6.jobcreator/5.api/2.server-exports","Exact signatures, return values and startup limits for Job Creator's three server exports.","i-lucide-server",{"title":482,"path":483,"stem":484,"description":485,"icon":486,"children":-1},"Administration API","/docs/jobs/jobcreator/api/administration-api","1.docs/0.jobs/6.jobcreator/5.api/4.administration-api","Read authorized catalog and statistics data and understand the boundary around Creator's internal administration callbacks.","i-lucide-shield-check",[],1792510374888]