Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. Why the hell is line 7 there? localPlayer = source This is deleting the localPlayer variable's value, so it's nil. Remove the line.
  2. Well, you can't export OOP functions right now, a bug is reported (again, TAPL's links) so you just have to wait or try something different. The topic covered a possible work around, check it.
  3. Did you even read the replies in the topic TAPL linked you to? Meta tables are resource specific not global. If you don't understand then it's time to learn more about OOP or just drop it and use procedural syntax.
  4. Did you add a debug message like I said? This way we don't have to go through your code looking for bugs ourselves. Add a debug message in the server-side event handler first thing and check if it's output. Don't forget to also check for errors.
  5. You don't need a screen source at all. A render target will do just fine. Create the target once (not on render), set it as the target on render, draw the text to it, reset the target and then draw the render target with dxDrawImageSection.
  6. The problem is that you're comparing the localPlayer which is an element (userdata value) to a gui-element, so the check always returns false and the event is not even triggered. if (localPlayer == wDrink ) then Should be: if (source == wDrink ) then This why you need to learn how to debug your code, a simple outputDebugString with any message in the server-side event handler would have shown that the event is not even triggered.
  7. Here's one for SQLite: viewtopic.php?f=148&t=38203#p393074 I'll write one for MySQL very soon.
  8. Its wiki page mentions that it's expensive, you're also calling it on each render which is A LOT. Most of these calls are useless since the player doesn't always change position/rotation each render. You can try different things to get over this. Maybe using getTickCount to limit the call to 3 seconds? Perhaps use the less expensive isLineOfSightClear before using processLineOfSight?
  9. Shouldn't that be render target? Since he wants to draw a section of a dx text, not a section of the screen.
  10. Not really. Just replace the dot with a semi-colon. local menu = exports[ "SAFMenu" ]:Menu_create( localPlayer, bot:getData("name"),155,0, 0 ) exports[ "SAFMenu" ]:Menu_open( localPlayer,absoluteX, absoluteY )
  11. Just remove "Client" from the event names. onPlayerJoin and onPlayerQuit. Always look on the wiki for events and functions.
  12. You assign Menu_open before you define Menu.open? Move the line below the function.
  13. Did you export the open function with the correct type?
  14. Why are you using loadstring? loadstring is used to run code, you're passing the returned value of Menu_open to loadstring.
  15. A client side file can be used to save client specific data, ones that don't need to be that secure. You can't create a file on the client and save it to the server resource directory. You'll have to create the file server side. fileDelete should delete the file not just wipe it. Are you sure you are closing after deleting?
  16. onClientPlayerJoin only works when other players join the server and not the client itself, so that's a possible problem. Also, a stupid question, but, you're checking the client resource directory and not the server one right?
  17. That's one possible solution, it's annoying but makes it possible. That topic has everything you need.
  18. There is no easy way to do this as far as I know, "IF NOT EXISTS" in your query is useless as well. The error (more like warning) is harmless, it doesn't stop your query or anything, you can just carry on without the need to worry whether it will output the warning or not. Now, if you really want to do this, there are certainly some methods, one is PRAGMA. PRAGMA is used to query for internal data. Here's the query: PRAGMA table_info(`table_name`); A screenshot of the output: cid is the column's id in the table, name is the column's name. That's all you need. And here's how you can use it in your script: dbQuery(callback, database, "PRAGMA table_info(`table_name`)") function callback(qh) local column_exists = false local result = dbPoll(qh, 0) for index, row in pairs(result) do if (row.name == "column_name") then column_exists = true end end if (not column_exists) then --code to alter table end end Please note that I've never tried this in MTA before, but it should work.
  19. Why getPlayerFromName when you already have the source?
  20. With your code, only the first player who hits the marker will have a car, the others won't.
  21. You do escape it, but you don't end it with another one. character = "\"" outputDebugString(character) outputDebugString("\"")
  22. JR10

    Abseil problem

    I think you mean that he didn't use setElementData first? If so, then no he actually did.
×
×
  • Create New...