Skip to content

Add getPlayerSyncerElements #2400

@ThatG-I

Description

@ThatG-I

Is your feature request related to a problem? Please describe.
It's not really a problem. It would be just nice to have.

Describe the solution you'd like
A function like getPlayerSyncerElements that returns a table of elements (vehicles and peds) that the player is currently sycning.

Describe alternatives you've considered
When I set a player as a syncer of somthing I store that infomation and try to keep it up to date as much as possible.

If anybody is wanting something like we are talking about here you go:

function getElementsSyncedByPlayer( player,  theType )
    local elementsByType = getElementsByType( theType )
    local elementsSyncedByPlayer = {}
    for i, v in pairs(elementsByType) do
        local syncer = getElementSyncer( v )
        if syncer == player then
            table.insert( elementsSyncedByPlayer, v )
        end
    end
    return elementsSyncedByPlayer
end

This is not a nice way of doing it but it's good enough for now I guess

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions