Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by LonelyRoad

  1. Solved this myself, I had the "Full Screen Minimize" option enabled. Seems a bit of a strange clash, though...
  2. So before I reinstalled my PC I had window borderless enabled as I have two monitors, and it used to cause various graphics issues if I Alt+Tabbed. However since reinstalling my PC, and as a result GTA and MTASA - I cannot seem to get borderless windowed mode to work. I've tried both the options on 'Fullscreen mode' in the Advanced tab, but even after restarting the client the game still completely minimizes when I Alt+Tab, which isn't what I want. Any help, please?
  3. It appears it is poor handling of NULL on part of the mysql module (not the native mysql functions). I added a type() check for string, and it works fine. Mods, Please lock/delete.
  4. If the value of a key in a table is empty (in context, its a table being returned from a MySQL query) should it be a userdata value? Basically what I have is this: if (characterData["faction_perks"]) then local factionPerks = fromJSON(characterData["faction_perks"]) else local factionPerks = { } It never triggers the else, instead returns characterData["faction_perks"] as userdata: 01E10138, and hence returns the following error: Bad argument @ 'fromJSON' [Expected string at argument 1] I have also just tried using this: local factionPerks = fromJSON(characterData["faction_perks"]) or { } The default value of faction_perks in the MySQL table is NULL.
  5. Can you clarify your question? Tell us what you're trying to do or give an example...
  6. Callum: Please see italics text for edit in my previous post.
  7. Calling SQL connect could be done onResourceStart (addEventHandler) right? Since you mention it, query and exec are the only two I am currently making use of, would you mind if I slightly modified your 'wrapper' and used it in my game mode? How should args be given to your functions?
  8. So I have been out of the MTA scene for a while, but now I am back and looking to continue with work on my own gamemode. More to the point, the last time I did work on said gamemode the module was the only method of working with a MySQL database. Now, evidently, it is possible to use the native SQL functions instead, and I assume for many reasons it would be a good idea to convert my gamemode to using them instead. Anyway, more on to the point of my post... How can I actually change my scripts now, everything I've done was using functions from the module with a 'wrapper' resource to provide ability to do queries etc. Is there any updated wrapper that provides the same functionality but with the native SQL functions? (See old wrapper here)
  9. I thought about doing that, but if possible I wanted to avoid the step of logging in or having to spend time understanding what's available in phpMyAdmin. I wanted a lighter user method.
  10. So I have plans to start what I want to call the OpenDev project, which will basically be an open source active development of a gamemode that will aim to be fairly 'generic' but still kind of specialize in RPG characteristics. Now that you have the background, what I actually want to know is two things: 1) Is there interest in such a project, it will probably work out of github (unless I find a better alternative) and will have a primary server, it will be overseen and monitored by myself but anyone can pull, fork or commit after I approve such actions. 2) For the nerds... Does anyone know of an application that gives people a method of seeing the design and content of a MySQL Database, kind of like a spreadsheet in a web browser. The idea being is people can see what is being stored, but not directly edit it.
  11. Well the method I am looking to rebuild and implement now is basically a 2 step process: 1) You type your username and password, and select remember me. 2) Your password is encrypted against your MTA Serial (see link) - with some random mambo-jambo stirred into the mix, and stored locally on your machine in a .xml file. Then whenever you connect, I can verify your .xml file and allow you to proceed with login. EDIT: I should probably point out that contrary to what myonlake said, all of this was going to happen on the client. Probably without the mambo jambo... I am trying to adapt my login system to cater for this system now, and its proving to be a lot more code than I initially expected, but I am wondering if there is any different/easier/better implementations I could potentially use?
  12. Setting alpha I think is a bad way to do it, because the client still has to 'think about' the dx drawings being there, then superimpose the alpha. It's better to just remove the event handler, as TAPL said.
  13. The example of this is on the createPed page itself. You will need to use the following code - CLIENT SIDE: function cancelPedDamage() cancelEvent() -- Cancels the onClientPedDamage event end addEventHandler("onClientPedDamage", AdrianaLima, cancelPedDamage)
  14. LonelyRoad

    20 lines

    We cannot do a great deal to help without knowing what is broken, however a couple of things I notice are as follows: You're using a useful function without including its code, see wiki page for getPlayerFromNamePart - you need to include the function's code before it will work. You're using the command args in reverse, and are possibly conflicting with a globally defined internal for all functions 'source'. You should use (source, command, targetPlayer) - and hence everything that is source should be targetPlayer, or if you so wish 'mutedPlayer'. You're explicitly defining (a check for) another possible return value with 'elseif' - when there are only two possible states for this script in its current format. What I mean is why have an 'elseif' if they can only be muted or not muted - in which case you can always apply the opposite. Btw, your script is very bloated in this case, as you can just use 'not currentstate' to apply the opposite to whatever they already have. * *: All need is something like this pseudo-code - DO NOT JUST COPY AND PASTE WHAT IS BELOW AND EXPECT IT TO WORK OR YOU WILL BE SHOT: function mmuteply(src, cmd, tgt) if isElement(tgt) then local target = getPlayerFromNamePart(tgt) if (hasPermission(src, muteplayer), true) then local mutestate = getElementData(target, "mutestate") or false local newstate = not mutestate setElementData(target, "mutestate", newstate) end end addCommandHandler("mmute", mmuteply) Also, you could add a outputChatBox that will adapt itself to the mute state to tell the player whether they are muted or not, but due to the time of night and me writing without a great deal of thought - I cannot remember how to do this. Someone else may help though.
  15. I would be inclined to agree with ^ What does sValue return if you outputChatBox or outputDebugString? I'd hazard a guess that your if statement on line 6 is not doing the correct comparison.
  16. Are you adding/removing teams after the resource start? This works fine, but only on teams that exist at resource start.
  17. The integrated db functions are a much better option for being future-proof, though I'm still in the process of converting my gamemode to that (not long ago did I start the project, and I regret starting with the module now). The point I was trying to make with the distance is where the actual game server is hosted, and where the DB is hosted. You need to allow for lag between the two servers, especially if they're in remote locations. You'd be much better off getting one good server to run it all through instead, or at least move the servers closer together, both VPS' through one company for example.
  18. I think he is referring to the MySQL Module's ping... Having said that, back on topic - there will inevitably be some lag, but how severe it is depends on the 'network distance' of the two physical servers (or VPS' or whatever).
  19. he said no debug I assumed that he did this after his script was running, if for example...the file failed to load, the error may not show up at this point.
  20. If you could speak better english it would help us; help you. Though, could you try running /debugscript 3 BEFORE you start your resource?
  21. Thats exactly why I questioned it, to me that wiki page does not clarify it, so instead of going unsure I just decided to ask.
  22. In the meta.xml, is writing: The equivalent to: ?
  23. Sounds good to me, thankyou for testing it Snake. I am going to go ahead and implement it tonight, I think.
  24. I still use ye olde faithful mta_mysql, and a heavily edited version of the MySQL resource from the good old days of the valhalla leak (I've already customised quite a bit of its behaviour to be better for me, though not directly)... I am just wondering if anyone knows of a way to adequately simulate the behaviour of the mta_mysql.dll module, through the use of dbQuery() and co. I don't want to have to sit and rewrite it all as such (if its not necessary), so I'm wondering if there's a quicker way?
  25. I've considered my options and chatted with a few friends about the topic, but basically I am trying to make a remember me script for my login system. I have decided how I want to do it, and hence I now need advice as to the best method of password encryption...I have been looking at using teaEncode + teaDecode but I don't know how safe these are? Is there a better implementation I could use..? P.S: Could anyone verify if teaDecode takes the args as follows: result of teaEncode() and key? Eg. teaEncode("lolwat", "derpderp") returns 12345 So that means teaDecode("12345", "derpderp") returns lolwat?
  • Create New...