Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getCommandHandlers lua function clientside #653

Conversation

Projects
None yet
3 participants
@xLuxy
Copy link
Contributor

commented Oct 14, 2018

This PR closes issue #436

Tested with the following code:

local function listCommands(strCmd, strResourceName)
    local uResource = nil
    
    if(strResourceName) then
        uResource = getResourceFromName(strResourceName)
    end
       
    for _, command in ipairs(getCommandHandlers(uResource)) do
        if(type(command) == "table") then
            outputChatBox(("Command: %s - Resource name: %s"):format(command[1], getResourceName(command[2])))
        else
            outputChatBox(("Command: %s - Resource name: %s"):format(command, strResourceName))
        end
    end    
end

addCommandHandler("lc", listCommands)
  • Luxy.c
@CrosRoad95

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2018

Command created serverside should't be visible by this command clientside

@xLuxy

This comment has been minimized.

Copy link
Contributor Author

commented Oct 14, 2018

Serversided commands are not listed there @CrosRoad95

  • Luxy.c

@botder botder added the enhancement label Oct 25, 2018

@botder botder self-assigned this Jan 7, 2019

botder added some commits Jan 7, 2019

@botder botder merged commit 8d1f1b9 into multitheftauto:master Jan 7, 2019

3 checks passed

WIP Ready for review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@botder botder added this to the 1.5.7 milestone Jan 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.