EggRP / fxcommands

Streamdeck Plugin for FiveM commands
MIT License
30 stars 6 forks source link

Other commands #18

Closed niterfjord closed 1 year ago

niterfjord commented 1 year ago

Hello

When I push the button with the command "naaminradio B-29 Pierre P" (it's to set my name in the radio), it sets this name in the radio: image

When I push the button with the command "id" and "escort", It doesn't work.

josh-tf commented 1 year ago

Do you have the command handling code for review?

niterfjord commented 1 year ago

image

This? Or what do you mean?

josh-tf commented 1 year ago

On the server end, the code to register the command so I can see how its processing the text If you don't run the server, you may need to contact the staff

niterfjord commented 1 year ago

I know they use QBCore but since it's a Dutch command, I think they added it themselves. I opened a ticket on their Discord to ask once.

niterfjord commented 1 year ago

If you don't run the server, you may need to contact the staff

That will eventually become a bit difficult that they give their code publicly. Is there no other way you could solve/test this?

josh-tf commented 1 year ago

They don't really need to publicise their custom code, just confirm how exactly they are interpreting the command

Are they using RegisterCommand with arguments, are they using the rawCmd variable and trimming off X characters or using regex or string replace to remove the command and slash to get the rest of the command

This is needed to see what they are doing, this is how its done on our server and it works fine:

RegisterCommand('me', function(source, args, raw)
    local text = string.gsub(raw, "me ", "")
    TriggerServerEvent('utils:shareMeDisplay', text)
end)

or

RegisterCommand('e', function(source, args, raw)
    if CanDoEmote() then
        if not args[1] then
            return showNotification("No emote name was provided, you can view the list of emotes in the <b>F1</b> menu", "danger")
        end

        if args[1] == "sitchairf" then
            args[1] = "sitchair"
            SetEntityHeading(PlayerPedId(), GetEntityRotation(PlayerPedId()) - 180)
            EmoteCommandStart(source, args, raw)
        else
            EmoteCommandStart(source, args, raw)
        end
    end
end)
niterfjord commented 1 year ago

Does this help you further?

josh-tf commented 1 year ago

Can you see if it works with slightly modified logic

They can try change the local customizedName.. line to:

local customizedName = string.gsub(rawCommand, (Config.RadioListChangeNameCommand .. " "), "")

and see if that works?

niterfjord commented 1 year ago

Thanks! But I can ask but I would also find it weird should someone ask me to modify the code on my server. For example, is there no solution that you change something in the code of the plugin so that it can work?

josh-tf commented 1 year ago

Hello, this has now been fixed in the latest update:

https://github.com/EggRP/fxcommands/commit/39098c3efbbfcec4f3bdd8b67747555a7840dec3

You can download the latest release from the releases page, I will have it updated in the Streamdeck plugins store shortly:

https://github.com/EggRP/fxcommands/releases/tag/v1.1.0

niterfjord commented 1 year ago

Thanks, the only thing I see now is the bullet before my name:

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

niterfjord commented 1 year ago

Thanks, the only thing I see now is the bullet before my name:

Can this also be solved?