Jump to content

[TUT] Send messages to Discord from MTA with Webhooks (This only works with MTA Server version 1.5.6 or higher!)


MrZsemle

Recommended Posts

  • 5 weeks later...

You need to change "param" into a table to catch all other subsequent params by using "..." then using table.concat to join them.

-- Test the function
function test(player, command, ...)
  local msg = table.concat({...}," ")
  sendDiscordMessage(msg)
end
addCommandHandler("dcmessage", test)

 

  • Like 3
Link to comment
7 hours ago, Mr.Loki said:

You need to change "param" into a table to catch all other subsequent params by using "..." then using table.concat to join them.


-- Test the function
function test(player, command, ...)
  local msg = table.concat({...}," ")
  sendDiscordMessage(msg)
end
addCommandHandler("dcmessage", test)

 

Thanks Loki, i'm update the resource.

  • Haha 1
Link to comment
  • 8 months later...
  • 6 months later...
  • 4 weeks later...
  • 2 weeks later...
  • 4 weeks later...
  • 1 month later...
On 04/06/2020 at 08:44, OKD Gaming said:

am i doing something wrong?spacer.pngspacer.pngspacer.pngspacer.pngspacer.png

What MTA Server version do you using?

In the future - if someone needs help, or found a bug, wants to give an advice - please consider using my GitHub Issues, or DM me.

Edited by MrZsemle
Link to comment
  • 3 weeks later...
  • 4 weeks later...
  • 2 years later...
  • Recently Browsing   0 members

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