Jump to content

Recommended Posts

Posted (edited)

Hi ED,

Since the introduction of Dynamic slots and the "All spawn/parking slots are occupied" pop up message, it would be really great if we could return a tuple on onPlayerTryChooseSlot like onPlayerTryConnect so that we can customize the message to avoid confusion.

At present, we must send the player a chat message, and hope they have the window open to explain why the slot block is in effect.

 

image.png

 

Reproduction

Ideally, we could use a hook as follows (which allows for backwards compatibility) in Server\Scripts\Hooks to return the tuple:
 

DCL_HOOKS = {}
DCL_HOOKS.cb = {}

DCL_HOOKS.cb.onPlayerTryChangeSlot = function(playerID, side, slotID)
    -- If we try spawn a huey at FARP1, fail else we bubble
    local slot_name = DCS.getUnitProperty(slotID, DCS.UNIT_NAME)
    if string.sub(slot_name, 1, 11) == "FARP1_UH-1H" then
        net.send_chat_to("Blocked access to UH-1H at FARP1", playerID)
        return false, "Blocked access to UH-1H at FARP1"
    end
    
    return nil, nil 
end

DCS.setUserCallbacks(DCL_HOOKS.cb)

 

Launch Mission on Server: SlotBlock-Blocked.miz

Try slotting in UH-1H at FARP1

Thanks,
Martin

Edited by MartinCo
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...