[Release] [Paid] Dynamic IPL's Loader

A script by Twittchter

No reviews yet.
[Release] [Paid] Dynamic IPL's Loader main image

Full Description

Dynamic IPL's Loader (ipls)

Version 0.5.1
Uses Escrow

Using PolyZone and it’s circle/sphere zone, as a dependency, to achieve easy request and removal of ipls.


Dependencies:
PolyZone
mapmanager


Tebex

Tebex Link - Store Offline for now


Example for adding a few ipls’s, included in the script.

-- PDM
-- Added callback to load and unload glass - bool is provided within the called functions internally
AddIpl("shr_int", vector3(-42.72736, -1096.1821, 28.287489), 225, function(bool)
    local active = IsInteriorEntitySetActive(GetInteriorAtCoordsWithType(-38.62, -1099.01, 27.31, "v_carshowroom"), "csr_beforeMission")
    if bool then
        ActivateInteriorEntitySet(GetInteriorAtCoordsWithType(-38.62, -1099.01, 27.31, "v_carshowroom"), "csr_beforeMission")
        ActivateInteriorEntitySet(GetInteriorAtCoordsWithType(-38.62, -1099.01, 27.31, "v_carshowroom"), "shutter_open")
    elseif active then
        DeactivateInteriorEntitySet(GetInteriorAtCoordsWithType(-38.62, -1099.01, 27.31, "v_carshowroom"), "csr_beforeMission")
        DeactivateInteriorEntitySet(GetInteriorAtCoordsWithType(-38.62, -1099.01, 27.31, "v_carshowroom"), "shutter_open")
    end
end)

-- Vangellico
AddIpl("post_hiest_unload", vector3(-624.103, -232.23875, 40.259274))

Functions & Current Exports:

--- add ipl to auto zone itself on "onClientMapStart" event 
---@param name string "The name of the asset"
---@param coords vector3 "The position of the asset in word coordinates vector3()"
---@param radius number "Can be nil, defaults to 250 units, some LOD's might want to be higher, like 500+??"
---#param callback function "add props or other things within the loaded ipl"
function AddIpl(name, coords, radius, callback)

--- get an ipl list
---@param bool boolean "return = true: number of active ipls or false: array of active ipl names"
function GetActiveIpls(bool)

--- get an ipl list
---@param bool boolean "return = true: number of inactive ipls or false: array of inactive ipl names"
function GetInactiveIpls(bool)

--- get an ipl list
---@param bool boolean "return = true: number of inactive ipls  or false: array of inactive ipl names"
function GetZonedIpls(bool)

--- force load the ipl
---@param name string "the name of the ipl"
function ForceLoadIpl(name)

--- force unload the ipl
---@param name string "the name of the ipl"
function ForceUnloadIpl(name)

--- force set a zone for the ipl
---@param name string "the name of the ipl"
function ForceZoneIpl(name)


If your a map maker, its as simple as adding it as a config option and use the export.

As noted above.


Demo Video

Link Here



Current Commands:

if conf.commands then
    RegisterCommand('iplload', function(source, args, rawCommand)
        ForceLoadIpl(args[1])
    end, false)

    RegisterCommand('iplunload', function(source, args, rawCommand)
        ForceUnloadIpl(args[1])
    end, false)

    RegisterCommand('iplzone', function(source, args, rawCommand)
        ForceZoneIpl(args[1])
    end, false)
end


Current features:

Prints loaded and unloaded ipls with simple config file for debugging.

(Mainly for map makers)
Commands to force load, unload and zone an ipl.
Note: iplzone reloads it and it behaves like a normal zone unloading and loading as needed.

Interior Prop loading functions, :white_check_mark:
(Use the callback)

Additional Exports exposing internal lists, :white_check_mark:



Upcoming features:

Adding IPLs via command that are not in the add.lua on "onClientMapStart" event.

Community requests.



Current issues:

Uses "onClientMapStart" to built its tables. So if your testing, after you restart the resource, re-join the server.
If you don’t use mapmanager then make an event using the same name as above.



Last note:

Please feel free to post the IPL’s you use to make it easier for others to add.



Known Bugs:

None? Let me know

Please fund my coffee addiction.

Config Merger
Have you tried Config Merger? Merge your configs easily