Jump to content

Bonsai

Members
  • Posts

    1,031
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Bonsai

  1. You can work with https://wiki.multitheftauto.com/wiki/PHP_SDK and call an exported function that counts the players.
  2. Exactly. I don't understand how its possible to screw up this badly over and over again. You either know what you are doing or you don't. And they apparently don't. At least they are not listed at https://www.multitheftauto.com/hosters/ anymore. The term "list of professional hosters" does not fit at all.
  3. Try: https://wiki.multitheftauto.com/wiki/Se ... tagShowing Bonsai
  4. I like it too, but maybe you should switch to using English names.
  5. Meanwhile I found a much easier and better solution. I simply attached an event to that function and element. No idea why I didn't think about that earlier. Its working fine now.
  6. This should work, at least it does for me: function onPlayerCommand(command) if command == "logout" or command == "login" then cancelEvent() return end end addEventHandler("onPlayerCommand", root, onPlayerCommand) Same for other commands.
  7. That seems to be a working solution, but I'm not sure if its a good idea doing it like that. I also tried using string.dump to save the function and execute it later but MTA won't let me execute it: Bad usage @ 'loadstring' [argument 1 is invalid. Please re-compile at https://luac.multitheftauto.com/] Anyway, I might have to go with a global table then Bonsai
  8. Seems there is no such group then. Use "aclGroupList" instead of your table.
  9. Hey there, I got a little problem using tables that contain functions as element data. According to the wiki you can't use functions for that. I have one file that contains something with this structure: function Test.new(name) local self = {}; self.element = createElement("Test", name) function self.destroy() destroyElement(self.element) outputDebugString("Destroyed") end setElementData(self.element, "object", self) return self end Then I have another file that that contains a function that is triggered at some point: function test() local testObject = getElementData(source, "object") testObject.destroy() end The problem is that I can't access the "destroy" function like this. Does anyone know a solution for this? The only thing I can think of is using a global table containing the object, which isn't that nice. Bonsai
  10. What did you try so far? I think you need to save the original position of each "element" or make them all depend on a shared value using an offset. Then use interpolateBetween until a target position is reached. In order to make it go back you need to use interpolateBetween again until the original positon is reached.
  11. Maybe I should have mentioned which direction I'm talking about. Now I'm requesting the status every 500ms from the server for every client. Bonsai
  12. Right, but it was triggerLatentClientEvent, therefore serverside, then the client doesn't seem to know about the handles.
  13. Well, I already tested and its not a that complicated task. Code and other stuff doesn't have much to do with the problem. That seems to be the problem then.. Pretty bad problem even. This way the server has to do the check for all players and send it to them. That kinda sucks. Anyway, thanks for making this clear.
  14. Hey Guys, I was just trying to use "getLatentEventHandles" clientside, but it doesn't seem to work. I triggered a very slow latent event, made one client and one server-side command to test that. Only the serverside command returned the correct value. Is this function not working the way I think on clientside or is there a different problem? Bonsai
  15. Seems nobody who replies here bothers to read about the actual problem. Maybe the order in the mtaconfig file or include in meta makes a difference? But that doesn't seem to be a good way of doing it.
  16. Yep, I switched to what MrTasty said and simply calculate the delta time on my own. Using onClientRender instead of onClientPreRender also pretty much ensures, with setting a low priority, no other resource or map will draw on top of it.
  17. Did you try /debugscript 3? It most likely shows some error or warning.
  18. I thought about that. I usually prefer to use things that are already existing instead of writing something new. I'm not sure if onClientPreRender has any disadvantage over onClientRender. So far it seems to be working fine tho.
  19. Yeah, that's what I did. Anyway, meanwhile I found the problem. I was using "onClientPreRender" because I needed the delta time and this event is always triggered before "onClientRender". Now I will probably have to change everything to "onClientPreRender". Thanks for your reply. Bonsai
  20. Hey Guys, I tried to use the priority argument on "addEventHandler" to manage the order of dx stuff that is drawn "onClientRender". It did not work, so I wonder if this is something that cannot be done this way? Can it be done at all? I need a way to make sure certain things are always on top of others, even things that come from different resources. Using postGui is kinda annoying since it blocks gui elements. Bonsai
  21. What?! What he said makes more sense than your code.. fileRead returns a String already + you don't execute it aswell.
  22. I think you have to use the pcall function to execute the loaded string. pcall(luaCode) EDIT: Not the string from fileRead, but from loadString.
  23. Vortex is nice as long as it works fine. But as soon as there is a problem you are pretty much lost. But I guess for these cheap prices you can't expect much more.
  24. Make the output serverside then I guess. Tho it seems to be pretty spammy.
  25. How can you even start working on a Multigamemode if you have no idea how to do the main thing a multigamemode does?
×
×
  • Create New...