Jump to content

Tebex

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

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

Tebex's Achievements

Vic

Vic (3/54)

0

Reputation

  1. I thought it might have been because the MTAEXPORT template appears to use C bindings as opposed to C++ bindings. Changed my headers to use C bindings, again compiled, but fails when trying to load: `[16:14:33] MODULE: Unable to load x64/modules/ml_base.so (/var/www/html/Servers/multitheftauto_linux_x64/x64/modules/ml_base.so: undefined symbol: InitServer)`
  2. Thanks for your response - the problem with using events is that the server owner then has to change all their resources to listen for these events no? To provide a little more context: The idea behind this is to be able to issue commands from a remote API - the server owner might have 5, 6 or 10 resources on their server that provide certain things, and from the API they would be able to execute commands from any of them as though they are in the console. Given that it looks like doing it in Lua isn't possible, I was thinking about doing it in a C++ module. I'm not a C++ developer by any means, so I'm probably totally misunderstanding, however I thought that `InitServer` (https://github.com/multitheftauto/mtasa-blue/blob/master/Server/mods/deathmatch/Server.cpp#L16) could be used as an exported function to return the current server - and from there I could use `HandleInput` to execute a command. However I've not had much luck so far - managed to get it to compile with some header mangling, however the module won't load: `Unable to load x64/modules/ml_base.so (/var/www/html/Servers/multitheftauto_linux_x64/x64/modules/ml_base.so: undefined symbol: _Z10InitServerv)` So I'm not sure if I've misunderstood how the exporting works (like I said, I'm not a C++ developer), or there is something else I need to do? Thanks!
  3. Ok, so playing around a bit more, it looks like the player has to be an admin for the command to execute - so it looks like even executing the command handler from a resource enforces the ACL. Is there any way around this? Ideally we'd like to be able to execute the commands as the console, although I tried to use `getElementsByType("console")[1]` and that didn't work - is there a way around this, even by using C++ if possible/needs be.
  4. Hi There, I'm not sure if it's either not possible or I'm missing something, but I cannot figure out how to call commands from other resources. I'm working on a plugin where commands are read from an API (controlled by the server owner), and then executed on the server. I can get it to work with commands registered within the same resource, but I don't seem to be able to get it to work with commands from other resources (for example trying to call `shout`) Just to try and get to the bottom of it, I'm running 'known' commands (as opposed to getting them from the API): --this doesn't work iprint(executeCommandHandler( "shout", getElementsByType("player")[1], "StandingSitar33 This is a test")); --this works - is a command added in my resource iprint(executeCommandHandler( "tebex:info", getElementsByType("player")[1])); There is nothing in the documentation that says it has to be a command created with addCommandHandler _in my resource_, but unless I'm missing something that's the only conclusion I can come to... Any help or suggestions for ways around this would be appreciated!
×
×
  • Create New...