[{"data":1,"prerenderedAt":940},["ShallowReactive",2],{"/docs/jobs/ambulancejob/reference/supported-ffa-scripts":3,"/docs/jobs/ambulancejob/reference/supported-ffa-scripts-surround":928,"/docs/jobs/ambulancejob/reference/supported-ffa-scripts-implemented-suggestions":939},{"id":4,"title":5,"body":6,"description":919,"extension":920,"head":921,"implementedSuggestions":921,"meta":922,"navigation":491,"path":923,"schemaOrg":921,"seo":924,"sitemap":925,"stem":926,"__hash__":927},"docs/1.docs/0.jobs/0.ambulancejob/4.reference/4.supported-ffa-scripts.md","Supported FFA Scripts",{"type":7,"value":8,"toc":906},"minimark",[9,14,27,30,34,61,71,74,94,101,104,124,131,134,154,166,169,189,196,200,206,355,358,382,397,400,404,420,429,801,814,820,824,830,880,886,890,893,902],[10,11,13],"h2",{"id":12},"supported-scripts","Supported scripts",[15,16,17,18,22,23,26],"p",{},"Sky Ambulance Job supports the following FFA, paintball, and faction-fight integrations through\n",[19,20,21],"code",{},"Config.Functions.beforeDeath"," and ",[19,24,25],{},"Config.Functions.beforeInjuries",".",[15,28,29],{},"The integration prevents the ambulance death screen and injury system from taking control while the\nplayer is participating in an FFA or faction fight. The ESX-compatible player death event is still\nsent so the external script can run its own death and revive flow.",[31,32,33],"h3",{"id":33},"nass_paintball",[35,36,37,45,53],"ul",{},[38,39,40,44],"li",{},[41,42,43],"strong",{},"Mode:"," Paintball",[38,46,47,50,51],{},[41,48,49],{},"Resource:"," ",[19,52,33],{},[38,54,55,50,58],{},[41,56,57],{},"State export:",[19,59,60],{},"exports[\"nass_paintball\"]:inGame()",[15,62,63,64,67,68,26],{},"The ambulance death and injury flows are blocked while ",[19,65,66],{},"inGame()"," returns ",[19,69,70],{},"true",[31,72,73],{"id":73},"ws_ffa-v2",[35,75,76,81,87],{},[38,77,78,80],{},[41,79,43],{}," FFA zone",[38,82,83,50,85],{},[41,84,49],{},[19,86,73],{},[38,88,89,50,91],{},[41,90,57],{},[19,92,93],{},"exports[\"ws_ffa-v2\"]:isInZone()",[15,95,63,96,67,99,26],{},[19,97,98],{},"isInZone()",[19,100,70],{},[31,102,103],{"id":103},"ws_gangwar-v2",[35,105,106,111,117],{},[38,107,108,110],{},[41,109,43],{}," Gangwar",[38,112,113,50,115],{},[41,114,49],{},[19,116,103],{},[38,118,119,50,121],{},[41,120,57],{},[19,122,123],{},"exports[\"ws_gangwar-v2\"]:isFightActive()",[15,125,63,126,67,129,26],{},[19,127,128],{},"isFightActive()",[19,130,70],{},[31,132,133],{"id":133},"sp_ffa",[35,135,136,141,147],{},[38,137,138,140],{},[41,139,43],{}," FFA",[38,142,143,50,145],{},[41,144,49],{},[19,146,133],{},[38,148,149,50,151],{},[41,150,57],{},[19,152,153],{},"exports[\"sp_ffa\"]:inFFA()",[15,155,63,156,67,159,161,162,165],{},[19,157,158],{},"inFFA()",[19,160,70],{},". This integration\nalso requires the ",[19,163,164],{},"OnRevive(lastWeapon)"," adjustment documented below.",[31,167,168],{"id":168},"sp_frakfights",[35,170,171,176,182],{},[38,172,173,175],{},[41,174,43],{}," Faction fight",[38,177,178,50,180],{},[41,179,49],{},[19,181,168],{},[38,183,184,50,186],{},[41,185,57],{},[19,187,188],{},"exports[\"sp_frakfights\"]:IsFrakFight()",[15,190,63,191,67,194,26],{},[19,192,193],{},"IsFrakFight()",[19,195,70],{},[10,197,199],{"id":198},"generate-the-functionslua-hooks","Generate the functions.lua hooks",[15,201,202,203,26],{},"Select the scripts installed on your server. The generator prepares the complete hook block for\n",[19,204,205],{},"sky_ambulancejob/config/functions.lua",[207,208,209,213,219,223,226,272,276,283,309,312,342,346],"steps",{},[31,210,212],{"id":211},"open-the-original-functionslua","Open the original functions.lua",[15,214,215,216,218],{},"Open ",[19,217,205],{},". Do not delete or replace the complete file.",[31,220,222],{"id":221},"find-the-replacement-start","Find the replacement start",[15,224,225],{},"Start at the comment directly above this function:",[227,228,233],"pre",{"className":229,"code":230,"language":231,"meta":232,"style":232},"language-lua shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Config.Functions.beforeDeath = function(context)\n","lua","",[19,234,235],{"__ignoreMap":232},[236,237,240,244,248,250,254,258,262,265,269],"span",{"class":238,"line":239},"line",1,[236,241,243],{"class":242},"sTEyZ","Config.",[236,245,247],{"class":246},"sBMFI","Functions",[236,249,26],{"class":242},[236,251,253],{"class":252},"s2Zo4","beforeDeath",[236,255,257],{"class":256},"sMK4o"," =",[236,259,261],{"class":260},"s7zQu"," function",[236,263,264],{"class":256},"(",[236,266,268],{"class":267},"sHdIc","context",[236,270,271],{"class":256},")\n",[31,273,275],{"id":274},"find-the-replacement-end","Find the replacement end",[15,277,278,279,282],{},"The replacement ends after the closing ",[19,280,281],{},"end"," of:",[227,284,286],{"className":229,"code":285,"language":231,"meta":232,"style":232},"Config.Functions.beforeInjuries = function(context)\n",[19,287,288],{"__ignoreMap":232},[236,289,290,292,294,296,299,301,303,305,307],{"class":238,"line":239},[236,291,243],{"class":242},[236,293,247],{"class":246},[236,295,26],{"class":242},[236,297,298],{"class":252},"beforeInjuries",[236,300,257],{"class":256},[236,302,261],{"class":260},[236,304,264],{"class":256},[236,306,268],{"class":267},[236,308,271],{"class":256},[15,310,311],{},"Stop immediately before this comment and function:",[227,313,315],{"className":229,"code":314,"language":231,"meta":232,"style":232},"-- Optional client-only hook that runs after a revive finishes.\nConfig.Functions.onRevive = function()\n",[19,316,317,323],{"__ignoreMap":232},[236,318,319],{"class":238,"line":239},[236,320,322],{"class":321},"sHwdD","-- Optional client-only hook that runs after a revive finishes.\n",[236,324,326,328,330,332,335,337,339],{"class":238,"line":325},2,[236,327,243],{"class":242},[236,329,247],{"class":246},[236,331,26],{"class":242},[236,333,334],{"class":252},"onRevive",[236,336,257],{"class":256},[236,338,261],{"class":260},[236,340,341],{"class":256},"()\n",[31,343,345],{"id":344},"generate-and-paste","Generate and paste",[15,347,348,349,351,352,354],{},"Select the installed scripts below, copy the generated configuration, and replace only the marked\n",[19,350,253],{},"/",[19,353,298],{}," section.",[356,357],"ffa-script-generator",{},[359,360,361],"warning",{},[15,362,363,364,367,368,367,371,374,375,367,378,381],{},"Keep ",[19,365,366],{},"Config.Functions.onRevive",", ",[19,369,370],{},"Config.Functions.onDeath",[19,372,373],{},"Config.Functions.onRespawn",",\n",[19,376,377],{},"Config.Functions.onAiMedicRequest",[19,379,380],{},"Config.Functions.sendDispatch",", and every other function\noutside the marked replacement range unchanged.",[15,383,384,385,388,389,391,392,388,394,396],{},"Returning ",[19,386,387],{},"false"," from ",[19,390,253],{}," disables the Sky Ambulance Job death flow for that death.\nReturning ",[19,393,387],{},[19,395,298],{}," prevents Sky injuries from being generated while the player\nis inside the external game mode.",[15,398,399],{},"The generated resource-state checks ensure that only installed and running integrations are called.",[10,401,403],{"id":402},"sp_ffa-update-the-revive-callback","sp_ffa: Update the revive callback",[15,405,406,407,412,413,415,416,419],{},"This section applies ",[41,408,409,410],{},"only to ",[19,411,133],{},". Its ",[19,414,164],{}," callback must wait until Sky\nAmbulance Job has completely rebuilt the player ped. Otherwise, selecting the previous weapon can\nhappen before ",[19,417,418],{},"NetworkResurrectLocalPlayer"," finishes.",[15,421,422,423,425,426,428],{},"Replace the existing ",[19,424,164],{}," callback in ",[19,427,133],{}," with:",[227,430,433],{"className":229,"code":431,"filename":432,"language":231,"meta":232,"style":232},"function OnRevive(lastWeapon)\n    CreateThread(function()\n        local timeout = GetGameTimer() + 8000\n\n        while LocalPlayer.state.skyAmbulanceReviveState ~= \"finished\"\n            and LocalPlayer.state.skyAmbulanceReviveState ~= \"failed\"\n            and GetGameTimer() \u003C timeout do\n            Wait(10)\n        end\n\n        if LocalPlayer.state.skyAmbulanceReviveState ~= \"finished\" then\n            return\n        end\n\n        local weaponHash = tonumber(lastWeapon)\n\n        if not weaponHash and type(lastWeapon) == \"string\" then\n            weaponHash = joaat(lastWeapon)\n        end\n\n        local ped = PlayerPedId()\n\n        if not HasPedGotWeapon(ped, weaponHash, false) then\n            GiveWeaponToPed(ped, weaponHash, 0, false, false)\n        end\n\n        SetCurrentPedWeapon(ped, weaponHash, true)\n    end)\nend\n","sp_ffa\\config\\sh_config.lua",[19,434,435,450,461,486,493,523,546,563,576,582,587,613,619,624,629,645,650,681,694,699,704,719,724,744,765,770,775,787,795],{"__ignoreMap":232},[236,436,437,440,443,445,448],{"class":238,"line":239},[236,438,439],{"class":260},"function",[236,441,442],{"class":252}," OnRevive",[236,444,264],{"class":256},[236,446,447],{"class":267},"lastWeapon",[236,449,271],{"class":256},[236,451,452,455,457,459],{"class":238,"line":325},[236,453,454],{"class":252},"    CreateThread",[236,456,264],{"class":242},[236,458,439],{"class":260},[236,460,341],{"class":256},[236,462,464,467,470,473,476,479,482],{"class":238,"line":463},3,[236,465,466],{"class":256},"        local",[236,468,469],{"class":242}," timeout ",[236,471,472],{"class":256},"=",[236,474,475],{"class":252}," GetGameTimer",[236,477,478],{"class":242},"() ",[236,480,481],{"class":256},"+",[236,483,485],{"class":484},"sbssI"," 8000\n",[236,487,489],{"class":238,"line":488},4,[236,490,492],{"emptyLinePlaceholder":491},true,"\n",[236,494,496,499,502,505,507,510,513,516,520],{"class":238,"line":495},5,[236,497,498],{"class":260},"        while",[236,500,501],{"class":242}," LocalPlayer.",[236,503,504],{"class":246},"state",[236,506,26],{"class":242},[236,508,509],{"class":246},"skyAmbulanceReviveState",[236,511,512],{"class":256}," ~=",[236,514,515],{"class":256}," \"",[236,517,519],{"class":518},"sfazB","finished",[236,521,522],{"class":256},"\"\n",[236,524,526,529,531,533,535,537,539,541,544],{"class":238,"line":525},6,[236,527,528],{"class":256},"            and",[236,530,501],{"class":242},[236,532,504],{"class":246},[236,534,26],{"class":242},[236,536,509],{"class":246},[236,538,512],{"class":256},[236,540,515],{"class":256},[236,542,543],{"class":518},"failed",[236,545,522],{"class":256},[236,547,549,551,553,555,558,560],{"class":238,"line":548},7,[236,550,528],{"class":256},[236,552,475],{"class":252},[236,554,478],{"class":242},[236,556,557],{"class":256},"\u003C",[236,559,469],{"class":242},[236,561,562],{"class":260},"do\n",[236,564,566,569,571,574],{"class":238,"line":565},8,[236,567,568],{"class":252},"            Wait",[236,570,264],{"class":242},[236,572,573],{"class":484},"10",[236,575,271],{"class":242},[236,577,579],{"class":238,"line":578},9,[236,580,581],{"class":260},"        end\n",[236,583,585],{"class":238,"line":584},10,[236,586,492],{"emptyLinePlaceholder":491},[236,588,590,593,595,597,599,601,603,605,607,610],{"class":238,"line":589},11,[236,591,592],{"class":260},"        if",[236,594,501],{"class":242},[236,596,504],{"class":246},[236,598,26],{"class":242},[236,600,509],{"class":246},[236,602,512],{"class":256},[236,604,515],{"class":256},[236,606,519],{"class":518},[236,608,609],{"class":256},"\" ",[236,611,612],{"class":260},"then\n",[236,614,616],{"class":238,"line":615},12,[236,617,618],{"class":260},"            return\n",[236,620,622],{"class":238,"line":621},13,[236,623,581],{"class":260},[236,625,627],{"class":238,"line":626},14,[236,628,492],{"emptyLinePlaceholder":491},[236,630,632,634,637,639,642],{"class":238,"line":631},15,[236,633,466],{"class":256},[236,635,636],{"class":242}," weaponHash ",[236,638,472],{"class":256},[236,640,641],{"class":252}," tonumber",[236,643,644],{"class":242},"(lastWeapon)\n",[236,646,648],{"class":238,"line":647},16,[236,649,492],{"emptyLinePlaceholder":491},[236,651,653,655,658,660,663,666,669,672,674,677,679],{"class":238,"line":652},17,[236,654,592],{"class":260},[236,656,657],{"class":256}," not",[236,659,636],{"class":242},[236,661,662],{"class":256},"and",[236,664,665],{"class":252}," type",[236,667,668],{"class":242},"(lastWeapon) ",[236,670,671],{"class":256},"==",[236,673,515],{"class":256},[236,675,676],{"class":518},"string",[236,678,609],{"class":256},[236,680,612],{"class":260},[236,682,684,687,689,692],{"class":238,"line":683},18,[236,685,686],{"class":242},"            weaponHash ",[236,688,472],{"class":256},[236,690,691],{"class":252}," joaat",[236,693,644],{"class":242},[236,695,697],{"class":238,"line":696},19,[236,698,581],{"class":260},[236,700,702],{"class":238,"line":701},20,[236,703,492],{"emptyLinePlaceholder":491},[236,705,707,709,712,714,717],{"class":238,"line":706},21,[236,708,466],{"class":256},[236,710,711],{"class":242}," ped ",[236,713,472],{"class":256},[236,715,716],{"class":252}," PlayerPedId",[236,718,341],{"class":242},[236,720,722],{"class":238,"line":721},22,[236,723,492],{"emptyLinePlaceholder":491},[236,725,727,729,731,734,737,739,742],{"class":238,"line":726},23,[236,728,592],{"class":260},[236,730,657],{"class":256},[236,732,733],{"class":252}," HasPedGotWeapon",[236,735,736],{"class":242},"(ped, weaponHash, ",[236,738,387],{"class":256},[236,740,741],{"class":242},") ",[236,743,612],{"class":260},[236,745,747,750,752,755,757,759,761,763],{"class":238,"line":746},24,[236,748,749],{"class":252},"            GiveWeaponToPed",[236,751,736],{"class":242},[236,753,754],{"class":484},"0",[236,756,367],{"class":242},[236,758,387],{"class":256},[236,760,367],{"class":242},[236,762,387],{"class":256},[236,764,271],{"class":242},[236,766,768],{"class":238,"line":767},25,[236,769,581],{"class":260},[236,771,773],{"class":238,"line":772},26,[236,774,492],{"emptyLinePlaceholder":491},[236,776,778,781,783,785],{"class":238,"line":777},27,[236,779,780],{"class":252},"        SetCurrentPedWeapon",[236,782,736],{"class":242},[236,784,70],{"class":256},[236,786,271],{"class":242},[236,788,790,793],{"class":238,"line":789},28,[236,791,792],{"class":260},"    end",[236,794,271],{"class":242},[236,796,798],{"class":238,"line":797},29,[236,799,800],{"class":260},"end\n",[15,802,803,806,807,809,810,813],{},[19,804,805],{},"SetCurrentPedWeapon"," can only select a weapon that already exists on the current ped.\n",[19,808,418],{}," can rebuild the ped without its previous native weapon, so the callback\nuses ",[19,811,812],{},"GiveWeaponToPed"," before selecting it.",[15,815,816,817,819],{},"The ",[19,818,447],{}," argument restores the weapon model only. If the FFA script also needs to preserve\nammunition, components, or tint, it must save those values before death and restore them in this\ncallback as well.",[10,821,823],{"id":822},"revive-state","Revive state",[15,825,826,827,829],{},"Sky Ambulance Job exposes the local ",[19,828,509],{}," player StateBag for client-side\nintegrations:",[831,832,833,846],"table",{},[834,835,836],"thead",{},[837,838,839,843],"tr",{},[840,841,842],"th",{},"Value",[840,844,845],{},"Meaning",[847,848,849,860,870],"tbody",{},[837,850,851,857],{},[852,853,854],"td",{},[19,855,856],{},"\"reviving\"",[852,858,859],{},"The revive flow is currently rebuilding the player.",[837,861,862,867],{},[852,863,864],{},[19,865,866],{},"\"finished\"",[852,868,869],{},"The player has been completely revived.",[837,871,872,877],{},[852,873,874],{},[19,875,876],{},"\"failed\"",[852,878,879],{},"The revive flow could not complete.",[15,881,882,883,26],{},"The StateBag is local to the player and can be read from other client resources through\n",[19,884,885],{},"LocalPlayer.state.skyAmbulanceReviveState",[10,887,889],{"id":888},"support","Support",[15,891,892],{},"Need help? Our support team is always ready to assist",[894,895],"u-button",{"color":896,"icon":897,"label":898,"target":899,"to":900,"variant":901},"neutral","i-simple-icons-discord","Join Discord","_blank","https://discord.gg/sky-systems","subtle",[903,904,905],"style",{},"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}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);}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}",{"title":232,"searchDepth":239,"depth":325,"links":907},[908,915,916,917,918],{"id":12,"depth":325,"text":13,"children":909},[910,911,912,913,914],{"id":33,"depth":463,"text":33},{"id":73,"depth":463,"text":73},{"id":103,"depth":463,"text":103},{"id":133,"depth":463,"text":133},{"id":168,"depth":463,"text":168},{"id":198,"depth":325,"text":199},{"id":402,"depth":325,"text":403},{"id":822,"depth":325,"text":823},{"id":888,"depth":325,"text":889},"Integrate supported FFA and faction-fight scripts with the Sky Ambulance Job death, injury, and revive flows.","md",null,{},"/docs/jobs/ambulancejob/reference/supported-ffa-scripts",{"title":5,"description":919},{"loc":923},"1.docs/0.jobs/0.ambulancejob/4.reference/4.supported-ffa-scripts","0vuAgbr1bM5zUGIcac2qj64JdWN3id8ByKDBTZ2Vd6o",[929,934],{"title":930,"path":931,"stem":932,"description":933,"children":-1},"FAQ","/docs/jobs/ambulancejob/reference/faq","1.docs/0.jobs/0.ambulancejob/4.reference/3.faq","Frequently asked questions about the Sky Ambulancejob resource.",{"title":935,"path":936,"stem":937,"description":938,"children":-1},"Server Exports","/docs/jobs/ambulancejob/api/server-exports","1.docs/0.jobs/0.ambulancejob/5.api/1.server-exports","Server-side exports provided by the Sky Ambulancejob resource.",[],1784817562672]