Jump to content

milkshake333

Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by milkshake333

  1. insertToDB = "INSERT INTO vehshop (vehid, price, group, type) VALUES('" .. vehid .. "', '" .. price .. "', '" .. tostring(theGroup) .. "', '" .. tostring(theType) .. "')" It returns the error that there's an error in my syntax. What's wrong with it, I don't see nothing wrong.
  2. @Varez: Yes it does work good now, and it's a resource to get an echo bot on an IRC channel
  3. Thank you very much, it helped. But can you tell me what the problem was? Things you changed so it could work?
  4. 2010-10-29 14:50:35] Starting irc [2010-10-29 14:50:35] SCRIPT ERROR: irc/core.lua:1: unexpected symbol near 'ï' [2010-10-29 14:50:35] WARNING: Loading script failed: irc/core.lua:1: unexpected symbol near 'ï' [2010-10-29 14:50:35] ERROR: irc/irc.lua:93: attempt to call global 'outputIRC' (a nil value) [2010-10-29 14:50:35] irc restarted successfully [2010-10-29 14:51:02] restart: Requested by Rutger [2010-10-29 14:51:02] Stopping irc [2010-10-29 14:51:02] ERROR: irc/irc.lua:101: attempt to call global 'outputIRC' (a nil value) Strange.., there is no i on line 1 ... core.lua:1: -------------------------------------------------------- irc.lua:98-104: addEventHandler("onResourceStop",root, function (resource) if getResourceInfo(resource,"type") ~= "map" then outputIRC("07* Resource '"..(getResourceName(resource) or "?").."' stopped!") end end ) Though the outputIRC function is in the core.lua script, and it's exported...
  5. Okay, well I did the settings.xml, so it should work. But I'll try out by stopping one by one.
  6. I don't know what MTA Paradise is? I have the ml_sockets module and this irc resource. And if MTA Paradise is a resource, then no, I don't have it .
  7. I got a problem with the IRC Resource. I have the module in my modules folder, and the resource has been given admin rights, but when I try to start it I get: [2010-10-28 17:21:42] Starting irc [2010-10-28 17:21:42] Start up of resource irc cancelled by script [2010-10-28 17:21:42] Stopping irc What could this be?
  8. milkshake333

    Roads

    I want to create something, that makes it able to assign names to roads. Those roads hold all coordinates, with a difference of 5 units, or something. I created a command to save paths, it will save it to xml files. The problem is that such a file gets to big and it gets laggy. So my question is, is there somebody who knows a nice way to do such a thing? I want to use it for GPS, like in GTA IV. It really points you to where to go, not just a marker on your map(I know how to do this). And I want to use it for speedlimits(I know how to do this too). It's just the way of saving and loading the streets I want to know about .
  9. Is it possible to setElementData in one script and use getElementData in another script to retrieve the data? And also is it possible for resources? From one resource to another?
  10. Well, it worked. Thank you very much .
  11. INFO: INSERT INTO houses (ID, en_X, en_Y, en_Z, en_tX, en_tY, en_tZ, ex_X, ex_Y, ex_Z, ex_tX, ex_tY, ex_tZ, int, dim, cost, owner, key) VALUES('1', '427.71234130859', '-1573.3515625', '25.80558013916', '427.71234130859', '-1573.3515625', '25.80558013916', '427.71234130859', '-1573.3515625', '25.80558013916', '427.71234130859', '-1573.3515625', '25.80558013916', '3', '2', '100', 'none', ' ') Dots shouldn't be the problem, 'cause those work normally too. And I store this whole string in a variable. Then it's something like this: myquery = mysql_query(connection, mystring)
  12. Well I did outputDebugString, and I still can't find the problem...
  13. Well I was just wondering what it could be used for, because it's not explained very well on the wiki imo.
  14. Thank you for replying, I will test this. And no, I didn't know about injection. Also I will read about escaping strings. Thanks again
  15. Got this code to insert into a table: "INSERT INTO houses (ID, en_X, en_Y, en_Z, en_tX, en_tY, en_tZ, ex_X, ex_Y, ex_Z, ex_tX, ex_tY, ex_tZ, int, dim, cost, owner, key) VALUES('" ..ID.. "', '" ..tostring(eX).. "', '" ..tostring(eY).. "', '" ..tostring(eZ).. "', '" ..tostring(etX).. "', '" ..tostring(etY).. "', '" ..tostring(etZ).. "', '" ..tostring(exX).. "', '" ..tostring(exY).. "', '" ..tostring(exZ).. "', '" ..tostring(extX).. "', '" ..tostring(extY).. "', '" ..tostring(extZ).. "', '" ..int.. "', '" ..dim.. "', '" ..cost.. "', 'none', ' ')" It has to do something with the syntax of this code, but I can't see what... The table houses does exists, and all the arguments are passed to the function. It gives the error code 1064, which is ER_PARSE_ERROR. And it says something like this on the mysql reference website: Message: %s near '%s' at line %d. I don't really understand it....
  16. So it's like setElementData but then only for players?
  17. Is there a complete list of all the keys for setPlayerAnnounceValue? If so, where can I find it?
  18. Hmm, you actually brought me on an idea . First I thought that wasn't possible, but after some more thinking I think I can make it that way. Ty
  19. Hi, I don't know if it's the right section, but I think it's the right one. Is it possible to label a bunch of code and then go to it with the function goto label. Like: (I know this code isn't anything, just for an example ) A: if a == b then a = a + b end and then later on in your script if a == b then goto A end So my question is: Is this possible, if yes, how? Greetz, MILKSHAKE.
  20. I checked the server directory and there is a file called xml.dll. Maybe that's just the problem, that I got a damaged one. I'm now going to try to load another file, maybe that works. I tried to load another file, <test> <noob text="noob" /> </test> with: function loadXML(player, command) outputChatBox(tostring(fileExists("test.xml"))) myFile = xmlLoadFile("test.xml") if myFile then nChild = xmlFindChild(myFile, "noob", 0) if nChild then theNoob = xmlNodeGetAttribute(nChild, "text") if theNoob then outputChatBox(tostring(theNoob)) xmlUnloadFile(myFile) else outputChatBox("Unable to get attribute") xmlUnloadFile(myFile) end else outputChatBox("Unable to find child") xmlUnloadFile(myFile) end else outputChatBox("unable to open test.xml") end end addCommandHandler("xmltest", loadXML) And in the chatbox I get: true and noob.... So I really wonder what the problem is in my other script... EDIT: I re-checked my other posts and I saw that I had in my connect.xml the lines hostname="" ending with >, not with />. So now I'm going to try if that solves the problem. EDIT2: Didn't solve it. EDIT3: I load the function from Client side, with triggerServerEvent, can that cause the problem?
  21. Many thanks for your reply, I'll try your suggestions now . FileExists returns True, changed to , changed everything right, now looks like this: <connect> <hostname text=""> <username text=""> <password text=""> <database text=""> </connect> Code to retrieve data: local cFile = xmlLoadFile("connect.xml") if not cFile then outputChatBox("Unable to open connect.xml.", source) triggerClientEvent(source, "showRegisterWindow", source) return end hostChild = xmlFindChild(cFile, "hostname", 0) sqluserChild = xmlFindChild(cFile, "username", 0) sqlpassChild = xmlFindChild(cFile, "password", 0) databaseChild = xmlFindChild(cFile, "database", 0) hostname = xmlNodeGetAttribute(hostChild, "text") sqlusername = xmlNodeGetAttribute(sqluserChild, "text") sqlpassword = xmlNodeGetAttribute(sqlpassChild, "text") database = xmlNodeGetAttribute(databaseChild, "text") And underneath I check if it's there. Well you may guess, it returns: Unable to open connect.xml. Now I'm wondering, maybe I miss something in my windows? Like a .dll or something? I don't know if it uses dll's to open xml files, but maybe that's the problem.
  22. Please can someone help me? I really want to use 1.0.4, since it seems that the new version causes the problem. I tried upgrading, debugging, but it's no use... EDIT: It seems that the new version isn't the problem. I just don't get it, first it worked, now it isn't working anymore .
  23. Yes that what it does. And if I delete that lines where it checks if it's nill or false, it gives a Bad Argument error at xmlGetNodeAttribute, some lines underneath it. So the problem is really the xmlLoadFile.... I really don't get it. It always worked normally, but with the new 1.0.4 it doesn't work..
  24. Hi, I'm trying to load an XML file. I did everything right, but it isn't working. Code: local cFile = xmlLoadFile("connect.xml") if cFile == false or cFile == nil then outputChatBox("Unable to open connect.xml.", source) triggerClientEvent(source, "showRegisterWindow", source) return end I use xmlGetNodeAttribute on the cFile to retrieve the attributes from it. This is the code where it loads the file. In my resource folder is the file connect.xml: <connect hostname="****" username="*****" password="*****" database="*******" /> I hope this is enough information to solve my problem.
×
×
  • Create New...