Jump to content

ViRuZGamiing

Members
  • Posts

    1,050
  • Joined

  • Last visited

Everything posted by ViRuZGamiing

  1. <meta> <script src="client.lua" type="client" /> <min_mta_version server="1.5.0-9.07439" /> </meta> Client: local x, y = guiGetScreenSize() local browser = createBrowser(x, y, true) addCommandHandler("lgn", function() loadBrowserURL(browser, "http://mta/local/login.html") addEventHandler("onClientRender", getRootElement(), function() dxDrawImage(0, 0, x, y, browser, 0, 0, 0, tocolor(255, 255, 255), true) end) end) File tree being:
  2. Lol there is no part attaching it to the player, it's not good. It does work but that's not the question. Read the question
  3. 'without having to compile' read the question
  4. Not sure if this will help but I found the MTA source code and the error you're getting: function edfLoadDefinition(fromResource, inResource, alreadyLoaded) local fromResourceName = getResourceName(fromResource) --get the EDF filename local definitionName = getResourceInfo(fromResource, "edf:definition") if not definitionName then return false end --try to load it local definitionRoot = xmlLoadFile(':' .. getResourceName(fromResource) .. '/' .. definitionName) if not definitionRoot then outputDebugString(fromResourceName .. ': couldn\'t load edf file', 1) return false end --etc.. https://github.com/multitheftauto/mtasa-resources/blob/master/[editor]/edf/edf.lua#L220 As I see and the error says, there's an error finding the file, are the Caps correctly? maybe try writing lowercase in meta and change the file name to be lowercase
  5. then make sure the team name is indeed HassoN or change that
  6. Remove if getPlayerTeam(v) == getTeamFromName("HassoN") then
  7. Atom is quite good as well, especially when you have LUA installed it can show you compile errors
  8. Not just the OS, reinstalling MTA does it as well (when deleting all remains, been there and used it as work around to create multiple accounts on a same server type) but about the code, what does Debuglog tell you at the moment, still boolean?
  9. Do keep in mind the serial does change, for example reinstalling could change the serial and people won't be able to play from different pc's
  10. getAccount(tostring(getPlayerSerial(source))) This won't give an error but would not work, since getAccount asks for a string that represents the username, you're giving a string that represents the user serial. Both are strings. I think you ment to do: getAccount(getPlayerName(source))
  11. So I got it to work by changing the if state to check if instead of query that query[1] returns true. Appearantly Query did return true although it was empty. I think it's default like this: local query = { {} } which makes that query isn't nil cause query returns a table but that table is empty. addEventHandler ("onPlayerJoin", getRootElement(), function () local query = execQuery("SELECT username FROM users WHERE username = ?", {getPlayerName(source)}) if (query[1]) then outputChatBox("found! "..query[1]["username"]) else outputChatBox("didn't found username, inserting!") execQuery("INSERT INTO users (username) VALUES(?)", {getPlayerName(source)}) end end ) But I guess this isn't clean code probably
  12. how about giving it a name and checking isTimer() before creating? local timer if not isTimer(timer) then timer = setTimer(...) end
  13. ViRuZGamiing

    CJ

    createMarker addEventHandler --"onMarkerHit" setPedStat
  14. attempt to index field '?' (a nil value)
  15. give the timer a name and kill it, killTimer()
  16. By using math, screenX / 2 is the horizontal middle screenY / 2 is the vertical middle this gives the center.
  17. appearantly I'm not able to concate my query and I need to use:
  18. Thanks for the clear answer!
  19. I do know how that works, mine is just an analogue example to show you what I mean, I do know i'd need an onClientRender, etc. it could've been GUI as well, just an example. My question is all about a client OR server sided function which can be called from both client AND server side with the same name 'exported'. For example (as mentioned before): outputChatBox() which is both Server and Client sided (Shared Function)
  20. I do know I'm a programmer in multiple languages, just not that good in LUA (C#, Java, VB.NET, HTML, Javascript + jQuery, PHP, and a bit of python if you're wondering) I just thought that would be my result if i'd do a SELECT * but since I did SELECT username I thought I'd just return 1 value. So it'd always returns an entire row?
  21. So I do have to name them by 2 different names, it's not possible to have 1 name?
×
×
  • Create New...