[{"data":1,"prerenderedAt":466},["ShallowReactive",2],{"/docs/base/jobs-base/server-exports/job-bells":3,"/docs/base/jobs-base/server-exports/job-bells-surround":453,"/docs/base/jobs-base/server-exports/job-bells-implemented-suggestions":465},{"id":4,"title":5,"body":6,"description":443,"extension":444,"head":445,"implementedSuggestions":445,"meta":446,"navigation":447,"path":448,"schemaOrg":445,"seo":449,"sitemap":450,"stem":451,"__hash__":452},"docs/1.docs/base/2.jobs-base/4.server-exports/18.job-bells.md","Job Bells",{"type":7,"value":8,"toc":441},"minimark",[9,22,95,104,368,375,378,405,429,437],[10,11,12,16,17,21],"p",{},[13,14,15],"strong",{},"Server library API."," Import ",[18,19,20],"code",{},"Sky_Jobs"," through your resource's existing Jobs Base loader and call these methods after Jobs Base is ready. They are library methods, not standalone Cfx exports.",[23,24,25,38],"table",{},[26,27,28],"thead",{},[29,30,31,35],"tr",{},[32,33,34],"th",{},"Method",[32,36,37],{},"Returns",[39,40,41,56,66,79],"tbody",{},[29,42,43,49],{},[44,45,46],"td",{},[18,47,48],{},"Sky_Jobs.Bells.Register(key, job, definitions)",[44,50,51,52,55],{},"A set ",[18,53,54],{},"{ [runtimeId] = true, ... }"," of registered IDs",[29,57,58,63],{},[44,59,60],{},[18,61,62],{},"Sky_Jobs.Bells.Remove(key)",[44,64,65],{},"No return value",[29,67,68,73],{},[44,69,70],{},[18,71,72],{},"Sky_Jobs.Bells.GetAll()",[44,74,75,76],{},"Copies of normalized definitions keyed by runtime ID, including their ",[18,77,78],{},"job",[29,80,81,86],{},[44,82,83],{},[18,84,85],{},"Sky_Jobs.Bells.Ring(playerId, runtimeId)",[44,87,88,91,92],{},[18,89,90],{},"true"," or ",[18,93,94],{},"false, reason",[10,96,97,100,101,103],{},[18,98,99],{},"key"," and ",[18,102,78],{}," are non-empty strings of up to 64 bytes. A registration supports up to 32 sequential definitions. Invalid registration raises an error; it does not silently remove the existing registration.",[105,106,112],"pre",{"className":107,"code":108,"filename":109,"language":110,"meta":111,"style":111},"language-lua shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","local ids = Sky_Jobs.Bells.Register(\"reception\", \"police\", {\n    {\n        id = \"desk\",\n        label = \"Police reception\",\n        sound = \"R1\",\n        active = true,\n        positioned = true,\n        x = 441.0, y = -982.0, z = 30.7,\n        heading = 0.0,\n        propModel = \"sky_job_deskbell\",\n        spawnProp = true,\n        recipients = \"both\",\n        volume = 0.5\n    }\n})\n","server.lua","lua","",[18,113,114,169,175,194,211,228,241,253,286,299,316,328,345,356,362],{"__ignoreMap":111},[115,116,119,123,127,130,133,137,140,144,147,150,154,156,159,161,164,166],"span",{"class":117,"line":118},"line",1,[115,120,122],{"class":121},"sMK4o","local",[115,124,126],{"class":125},"sTEyZ"," ids ",[115,128,129],{"class":121},"=",[115,131,132],{"class":125}," Sky_Jobs.",[115,134,136],{"class":135},"sBMFI","Bells",[115,138,139],{"class":125},".",[115,141,143],{"class":142},"s2Zo4","Register",[115,145,146],{"class":125},"(",[115,148,149],{"class":121},"\"",[115,151,153],{"class":152},"sfazB","reception",[115,155,149],{"class":121},[115,157,158],{"class":125},", ",[115,160,149],{"class":121},[115,162,163],{"class":152},"police",[115,165,149],{"class":121},[115,167,168],{"class":125},", {\n",[115,170,172],{"class":117,"line":171},2,[115,173,174],{"class":125},"    {\n",[115,176,178,181,183,186,189,191],{"class":117,"line":177},3,[115,179,180],{"class":125},"        id ",[115,182,129],{"class":121},[115,184,185],{"class":121}," \"",[115,187,188],{"class":152},"desk",[115,190,149],{"class":121},[115,192,193],{"class":125},",\n",[115,195,197,200,202,204,207,209],{"class":117,"line":196},4,[115,198,199],{"class":125},"        label ",[115,201,129],{"class":121},[115,203,185],{"class":121},[115,205,206],{"class":152},"Police reception",[115,208,149],{"class":121},[115,210,193],{"class":125},[115,212,214,217,219,221,224,226],{"class":117,"line":213},5,[115,215,216],{"class":125},"        sound ",[115,218,129],{"class":121},[115,220,185],{"class":121},[115,222,223],{"class":152},"R1",[115,225,149],{"class":121},[115,227,193],{"class":125},[115,229,231,234,236,239],{"class":117,"line":230},6,[115,232,233],{"class":125},"        active ",[115,235,129],{"class":121},[115,237,238],{"class":121}," true",[115,240,193],{"class":125},[115,242,244,247,249,251],{"class":117,"line":243},7,[115,245,246],{"class":125},"        positioned ",[115,248,129],{"class":121},[115,250,238],{"class":121},[115,252,193],{"class":125},[115,254,256,259,261,265,268,270,273,276,279,281,284],{"class":117,"line":255},8,[115,257,258],{"class":125},"        x ",[115,260,129],{"class":121},[115,262,264],{"class":263},"sbssI"," 441.0",[115,266,267],{"class":125},", y ",[115,269,129],{"class":121},[115,271,272],{"class":121}," -",[115,274,275],{"class":263},"982.0",[115,277,278],{"class":125},", z ",[115,280,129],{"class":121},[115,282,283],{"class":263}," 30.7",[115,285,193],{"class":125},[115,287,289,292,294,297],{"class":117,"line":288},9,[115,290,291],{"class":125},"        heading ",[115,293,129],{"class":121},[115,295,296],{"class":263}," 0.0",[115,298,193],{"class":125},[115,300,302,305,307,309,312,314],{"class":117,"line":301},10,[115,303,304],{"class":125},"        propModel ",[115,306,129],{"class":121},[115,308,185],{"class":121},[115,310,311],{"class":152},"sky_job_deskbell",[115,313,149],{"class":121},[115,315,193],{"class":125},[115,317,319,322,324,326],{"class":117,"line":318},11,[115,320,321],{"class":125},"        spawnProp ",[115,323,129],{"class":121},[115,325,238],{"class":121},[115,327,193],{"class":125},[115,329,331,334,336,338,341,343],{"class":117,"line":330},12,[115,332,333],{"class":125},"        recipients ",[115,335,129],{"class":121},[115,337,185],{"class":121},[115,339,340],{"class":152},"both",[115,342,149],{"class":121},[115,344,193],{"class":125},[115,346,348,351,353],{"class":117,"line":347},13,[115,349,350],{"class":125},"        volume ",[115,352,129],{"class":121},[115,354,355],{"class":263}," 0.5\n",[115,357,359],{"class":117,"line":358},14,[115,360,361],{"class":125},"    }\n",[115,363,365],{"class":117,"line":364},15,[115,366,367],{"class":125},"})\n",[10,369,370,371,374],{},"Runtime IDs are scoped to the invoking resource, registration key, job and bell ID. Re-registering your own key replaces that registration. Resource-stop cleanup removes registrations owned by the stopping resource. ",[18,372,373],{},"GetAll()"," also includes inactive/unpositioned definitions and does not expose internal owner/cooldown state.",[10,376,377],{},"To ring, select a returned runtime ID and use an authenticated, nearby player server ID:",[105,379,382],{"className":107,"code":380,"filename":381,"language":110,"meta":111,"style":111},"local success, reason = Sky_Jobs.Bells.Ring(sourceId, runtimeId)\n","inside your existing server interaction handler",[18,383,384],{"__ignoreMap":111},[115,385,386,388,391,393,395,397,399,402],{"class":117,"line":118},[115,387,122],{"class":121},[115,389,390],{"class":125}," success, reason ",[115,392,129],{"class":121},[115,394,132],{"class":125},[115,396,136],{"class":135},[115,398,139],{"class":125},[115,400,401],{"class":142},"Ring",[115,403,404],{"class":125},"(sourceId, runtimeId)\n",[10,406,407,408,158,411,158,414,158,417,158,420,158,423,100,426,139],{},"Ring checks the current player, active/positioned bell, actual distance, available sound and player/bell/job cooldowns. Errors include ",[18,409,410],{},"disabled",[18,412,413],{},"invalid_bell",[18,415,416],{},"unavailable",[18,418,419],{},"player_missing",[18,421,422],{},"too_far",[18,424,425],{},"cooldown",[18,427,428],{},"sound_missing",[10,430,431,432,139],{},"Do not accept arbitrary recipient, sound-file or position data from a client. Configure those in the registered definitions. See ",[433,434,436],"a",{"href":435},"/docs/base/jobs-base/features/job-bells","Job Bells setup",[438,439,440],"style",{},"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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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":111,"searchDepth":118,"depth":171,"links":442},[],"Register and ring bells through the server-side Sky_Jobs library owner.","md",null,{},true,"/docs/base/jobs-base/server-exports/job-bells",{"title":5,"description":443},{"loc":448},"1.docs/base/2.jobs-base/4.server-exports/18.job-bells","l-v6fSRB7QasZWcD8fzJjcUYhFT6bfyR1iz0jY4B3fE",[454,459],{"title":455,"path":456,"stem":457,"description":458,"children":-1},"Business","/docs/base/jobs-base/server-exports/business","1.docs/base/2.jobs-base/4.server-exports/17.business","Read business state, submit authorized employee announcements or publish from trusted server integrations.",{"title":460,"path":461,"stem":462,"description":463,"icon":464,"children":-1},"Training","/docs/base/jobs-base/server-exports/training","1.docs/base/2.jobs-base/4.server-exports/2.training","Server-side access checks for integrations that accompany the Jobs Base Training App.","i-lucide-graduation-cap",[],1791814181635]