Jump to content

lolcatsareawesome

Members
  • Posts

    38
  • Joined

  • Last visited

lolcatsareawesome's Achievements

Rat

Rat (9/54)

0

Reputation

  1. Hi, I was scripting when suddenly that error appears. I want save a huge string in a var but I got this error and it say to put a min version. I put that on the meta but still not working: <min_mta_version client="1.3.2" server="1.3.0-9.03773"/> If someone have an idea, thanks.
  2. Hello, I've an error by using string.gsub because I want to remplace a string by another one but the script think it's a pattern but I don't want a pattern string. The string that I want to remplace is ")" to " ". With string.find per example, he have an argument for disable the pattern. local theString = "lolcats)are)awesome"; local result = string.gsub(theString, ")", " "); outputChatBox(result) The error that I've is "Invalid pattern capture".
  3. Some errors in your code but you understand what I mean. GUI focus isn't the good way to do that. Based on your idea, I find the solution. isGui = false addEventHandler("onClientMouseEnter", getRootElement(), function() if source then isGui = true; end end) addEventHandler("onClientMouseLeave", getRootElement(), function() if source then isGui = false; end end) Thank you !
  4. I think you don't understand what i'm talking about. I'll try to explain more... (forgot the blowVehicle thing) As you know, the event onClientClick is actived when the user click with his mouse. This event give us a parameter, that parameter is an element. This element is the element where the player clicked on GTA world. This element can be vehicle, player, object etc. The fact is that, when I open any GUI and click on it (example: admin panel), the onClientClick still running. (Using the admin panel example, I want to press a button, unfortunly, a vehicle is at the same place in my screen. Then the event onClientClick will detect that click.) The element that onClientClick returns is a MTA element but it works only for vehicle, player, objects etc not GUI elements (As far i know, GUI elements are MTA elements: https://wiki.multitheftauto.com/wiki/Element ) How can I know if the player click in a GUI element or in a element in the GTA world? I hope you understand guys...
  5. addEventHandler("onClientClick", getRootElement(), function(button, state, x, y, wx, wy, wz, element) if (button == "left") and (state == "down") then if element and (getElementType(element) == "vehicle") then blowVehicle(element) else -- CHECK IF THE ELEMENT WHERE THE USER CLICK IS A GUI, IF IT'S THEN DO NOTHING end end end)
  6. You don't understand my previous post.
  7. Hi there, I've made a script when the player click on a vehicle, the vehicle is destroyed via the event onClientClick. The problem is that, when the player open a window (admin panel per example) and do his stuff into it, the event onClientClick continue to do his things. I want to limit it, when the player click in a GUI, onClientClick doesn't do anything. The element argument from onClientClick doesn't detect the GUI elements. It allways return false. Thanks for your help !
  8. Hi there again, I want to know if it's possible to call a function with his name as a string. Per example i have: function myFunctionName() end and in another part of my code, I've: local theFunction = "myFunctionName"; It's possible to call the function using theFunction() ? Thanks.
  9. Of course. The dxGetTexturePixels return a string that contain the texture as a string. I want to know what kind of string is because, with this string i want to create it with the PHP function imagecreatefromstring(). Understand now?
  10. Hi there, I want to know what kind of string the dxGetTexturePixels function returns? I mean, what type is like base64 or something like that. Because, I want to recreate the image after with PHP. Someone?
  11. Okay, it works perfectly good. Thanks !
  12. Oh ok, say me if I'm on the right way. addEventHandler("onClientResourceStart", resourceRoot, function() myRenderTarget = dxCreateRenderTarget( 100, 80 ) end ) local rotation = 90; addEventHandler( "onClientRender", root, function() if myRenderTarget then dxSetRenderTarget( myRenderTarget ) dxDrawText ( "Hello", 10, 20 ) dxDrawImage( 50, 50, 100, 100, myRenderTarget , rotation, 0, 0) end end )
  13. Hi there, I want to know if exist a function or a trick to set a rotation to a dx text. That would be nice. Thanks
×
×
  • Create New...