Jump to content

ZeusXBr

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ZeusXBr's Achievements

Square

Square (6/54)

0

Reputation

  1. I already tryied this, but dont works... same error...
  2. The code isnt returning nothing.
  3. How i can do that? How i can put "min_mta_version" on my xml??
  4. I want to store it, but, ts not working perfect... if python i use this like: test = [''] resourceName = getResourceName(res) for command in resource: test.append(command) print(f'Comand found in {resourceName}: {test}' How i can do this in lua?
  5. Dont works good, i think its better if on "for command in pairs( commands )", its put the commandsfound into a list, and after return at string, do you know how?
  6. addEventHandler("onResourceStart", resourceRoot, function(res) local resourceName = getResourceName(resourceRoot) local commandsList = {} --table to store commands for _, subtable in pairs( getCommandHandlers() ) do local commandName = subtable[1] local theResource = subtable[2] if not commandsList[theResource] then commandsList[theResource] = {} end table.insert( commandsList[theResource], commandName ) local commands = getCommandHandlers( theResource ) for _, command in pairs( commands ) do commandFound = command if commandFound then outputDebugString("Commands found in "..resourceName..": "..commandFound, 3, 255, 0, 0) end end end end) I'm trying to get all commands found in some resource, i'm trying to use this code, but doesnt works! any kind of help? please? How i want to work: On resource starts > Get Resource Name > Get Resource Commands > return (resName, Commands).
  7. I want to do this: Using webhook, something like this: -- created by zsenel local discordWebhookURL = "https://discord.com/api/webhooks/835103134270488596/FY5*********EXAMPLE************yKEaRsKJp4" function sendDiscordMessage(message) sendOptions = { formFields = { content = "Example:", username = "webhook - Example", embed = { description= "```Some user have typed \"help\" command.```", color= null, author= { name= "Webhook - Example" }, footer = { text = "I want to do this..." }, }, }, } fetchRemote ( discordWebhookURL, sendOptions, WebhookCallback ) end function WebhookCallback(responseData) outputDebugString("(Discord webhook callback): responseData: "..responseData) end function SendDiscordTestMessage(player, command, ...) local msg = table.concat({...}," ") -- for multiple words sendDiscordMessage(msg) end Return < Thats only a example do i want to do, any kind of help please?
  8. I see this, thanks!
  9. function webhookEmbed(url, content, author, icon_url, description) local webhook_url = url sendOptions = { formFields = { content="```"..content.."```" }, author = { "name": author, "icon_url": icon_url, "description": description, }, } fetchRemote(webhook_url, sendOptions) end addEventHandler("onResourceStart", resourceRoot, function(res) resourceName = getResourdiscordName(resourceRoot) url = "WebhookLink" webhookEmbed(url, "Test", "Test", "https://link.jpg", "Test") outputDebugString("["..resourceName.."]: Resource started.", 3, 97, 235, 52) end) addEventHandler("onResourceStop", resourceRoot, function(res) resourceName = getResourceName(resourceRoot) outputDebugString("["..resourceName.."]: Resource stopped.", 3, 255, 0, 0) end) But, the webhook dont works, any help?
  10. I'm trying to get the command when some user put any command, example? onPlayerCommand: outputchatbox("User "..playername.." used "..Command.." command." Any suggestion ?
  11. local gate = createObject(980, 1001.5, -1096.9000244141, 25.60000038147, 0, 0, 110) local marker = createMarker(1001.5, -1096.9000244141, 25.60000038147, "cylinder", 8, 0, 0, 0, 0) function moveGate(thePlayer) if isObjectInACLGroup("user." .. nomeAcc, aclGetGroup("TDF")) then moveObject(gate, 3000, 1001.5, -1096.9000244141, 20) end end addEventHandler("onMarkerHit", marker, moveGate) function move_back_gate() moveObject(gate, 3000, 1001.5, -1096.9000244141, 25.60000038147) end addEventHandler("onMarkerLeave", marker, move_back_gate) I think its all ok with this code, but... ERROR. I wrongly have deleted a wrong line on my code, thats all ok now guys, i think. local nomeAcc = getAccountName (getPlayerAccount (source))
×
×
  • Create New...