Jump to content

guix

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by guix

  1. Not much to explain, it just store the hook state prior to disabling it, and restore it when the loop completed. I can't explain more because I don't know to be honest
  2. Hello, So I have a script that require testing with like 3 or 4 players. I don't have 4 computers, only 2. Is it possible to have multiple instances of the MTA client running on the same computer? Thanks
  3. Indeed, working perfect in a server side script! I hope this will be fixed soon enough, if I could, I would try fix it myself but I have no idea where to start...
  4. I try to understand why my function doesn't return the correct result in MTA's Lua In codepad, the correct result: http://codepad.org/9iEiJsW8 In MTA, the exact same function and function calls (only with outputConsole) outputs different results : 1846309504 -931460096 335609632 Any idea why? Can it be because I compiled MTA myself, on a 64bits pc ? I really don't understand and I've searched a solution for 2 days now and I'm tired of searching... PS: I know about tocolor() Edit: I've asked on the Lua IRC and I've been told it's because (MTA's) Lua was compiled to use floats for numbers, and that above 2^24 there is a precision loss, which explain my incorrect results. Can be verified with: if 2^24 == 2^24+1 then outputConsole( "fail" ) end Can this be fixed?
  5. There is a protection in Lua that prevent infinite loops from blocking the server forever. Sometimes (when testing things) you may need a huge loop that you know will not be infinite, but unfortunately it could still trigger that protection, so here is how to disable it temporarily: local h1, h2, h3 = debug.gethook() debug.sethook() -- Your loop here debug.sethook( _, h1, h2, h3 ) I hope it will be useful for someone else
  6. Thank you very much for detailed post! This is working fVelocityRY = (fVelocityX * fMatrix[2][1]) + (fVelocityY * fMatrix[2][2]) + (fVelocityZ * fMatrix[2][3]) if fVelocityRY > 0 then -- vehicle move forward end I understand matrix a lot better now
  7. Hello! I would like to know how can I detect if vehicle move forward, or backward? I think using getElementMatrix but I have not much idea what to do with those values! I tried with getElementVelocity with Y velocity between 1 and -1, but, those velocities are related to the world, not the vehicle direction Sorry if this has been asked alrady but I searched for "vehicle forward" but no luck. Little help please? Also can you give me a description of the values in the 4*4 matrix ? Edit I did this, it seem to work: if (( fVelocityY < 0 and fRotationZ >= 90 and fRotationZ < 270 ) or ( fVelocityY > 0 and (fRotationZ < 90 or fRotationZ >= 270 )))then -- vehicle go forward end I think there is an easier way.
  8. IIYAMA, most of the script is made already I don't need to know how to make buttons (I was just explaining what my goal was), just how to send hardcoded commands! No I just want to make a roleplay server where players have some buttons in their houses or in the map to do handy actions instead of typing boring commands. You seem very arrogant and close-minded. If your goal is to annoy players (this isn't my goal at all, I'm a nice guy) then ok, and there are much more annoying things you can do while you are at it, for example teleport them somewhere random every seconds or flash their screen with huge white rectangles every milliseconds, good for epileptic people... Surely typing "/quit" automatically is more annoying than those allowed things I just described . Forget it, it isn't possible in MTA, thanks anyway.
  9. Not quite! They are buttons (using the keypad object) that players can press using the Enter key, look the images on this topic to understand: http://forum.sa-mp.com/showthread.php?t=74902 OnClientClick or whatever... there is still no solution to execute hardcoded commands such as /quit (which was the original question) right? Sorry for my bad english if you don't understand me
  10. Ok, I was hoping for a more universal solution but I think there isn't! Thank you anyway
  11. Yes but how to do with button on the wall? I don't want to manually type command or bind a key to the command, I would like with executeCommandHandler, but hardcoded commands are blocked in this function, so I would like a workaround if it's possible!
  12. Hello all, I'm a long time player of GTA SA, SA-MP and kind of new to MTA and I want to make scripts I would like to make something similar to Yom's Buttons script for SA-MP, where players can press a button on a wall and it open a door or write a chat command or whatever! But I have a problem, I can't find how to send MTA command such as "say hello", or "quit". I know it is restricted for "security reasons", but is there any workaround? Thanks, and happy new year!
×
×
  • Create New...