Jump to content

Lloyd Logan

Members
  • Posts

    642
  • Joined

  • Last visited

Everything posted by Lloyd Logan

  1. Hey, the errors this code outputs it : 69 attempt to compare number with boolean, and 68 bad pointer at getPlayerMoney function paynspray(hitElement) local money = getPlayerMoney(hitElement) if ( money > 1000 ) then outputChatBox("Please wait whilst we work on your vehicle!", hitElement) setTimer ( fixVehicle, 5000, 1, hitElement ) end end addEventHandler("onMarkerHit", dutymarker, paynspray, hitElement)
  2. Sorry, my fault. I tried to edit it, but it didn't work. I forgot to change it back I'll change the OP
  3. So, i cant get this to work? To get the players login data? test = dbConnect( "mysql", "dbname=test;host=127.0.0.1", "root", "") function makeadminnow(thePlayer) local name = getAccountName(thePlayer) dbExec ( test, "UPDATE `accounts` SET `admin` = '12' WHERE `username` = ".. name .."" ) outputChatBox("You are now admin!", thePlayer) end addCommandHandler("makemeadmin", makeadminnow)
  4. That simple? name = getPlayerName then the dnExec?
  5. Thank you so much!!! Where you have put "Lloyd Logan" how would I replace that with whoever has logged in? Like getPlayerName? Then how would I implement this into the script? Thanks Again Lloyd
  6. Ahh, so what would i do? dbExec( connection, "UPDATE ?? SET ??=?", tableName, columnName, columnValue I don't understand what to replace with what?
  7. Oh, sorry! Thanks alot!
  8. Hey, I have been struggling for ages, and i can't quite get this to work So I am looking to update the players rank when he logs in (dont ask why), the rank in located in Localhost db = newser structure(<--- I think thats what its called) = account, then it is under the players name then admin, here is what i have so far? newserv = dbConnect( "mysql", "dbname=newserv;host=127.0.0.1", "root", "" ) function makeadminn (thePlayer) executeSQLQuery("UPDATE `account` SET `**dont know what to put here`=?, WHERE `admin`=2", thePlayer) end addCommandHandler("makemeadmin", makeadminn)
  9. So where is the fixVehicle in this?
  10. Thank you very much! I understand this quite a bit more!
  11. Lloyd Logan

    setTimer

    How would i put setTimer ( paynspray, 2000, 1 ) into this code? So that when the player enters the marker, it takes a bit of time before it repair the vehicle? function paynspray(hitElement) fixVehicle(hitElement) end addEventHandler("onMarkerHit", dutymarker, paynspray)
  12. Ahh, may be a bit much but could you give me an example
  13. Hey, In alot of the community scripts and WIKI examples, There's a line "for k, v in ipairs" what does this mean? and string.byte, what does this mean? full : function startup() local file = xmlLoadFile("pns.xml") for k, v in ipairs(xmlNodeGetChildren(file)) do local pos = split(xmlNodeGetAttribute(v,"pos"),string.byte(",")) local marker = createMarker(pos[1],pos[2],pos[3],"cylinder") createBlipAttachedTo(marker,63,2,255,0,0,255,0,250) setElementData(marker,"pnsMarker",true) setGarageOpen(tonumber(xmlNodeGetAttribute(v,"garage")),true) end xmlUnloadFile(file) end addEventHandler("onResourceStart",getResourceRootElement(),startup) Thanks Lloyd
  14. Ah okay, sounds fair! Just from the Skype conversation, you sounded like a newbie, Sorry!
  15. Charly? Yesterday you asked me how to start a server, and where to start scripting? Now your setting up a guys server?
  16. I've tried to add this in the old version and as you said it never worked. For some reason arguments (e.g. a file you want to open) weren't passed to the main function therefore not opening them. Ahh, is this fixed in the New Release?
  17. This is great, but the last time I used this I had one problem. This was when I right clicked the script, and set it so these type (.lua) open with Script Editor, but when the file is clicked, it doesn't open in the editor, you have to open it manually from there. Unlike N++ it automatically opens it when it is clicked. Is this just for me or will this be fixed in the next update? Lloyd
  18. **facepalm** Sorry! So will i need the modules for this to work? No. dbConnect is a built-in mta function. So if this were the line in my mysql folder, test_db = dbConnect( "mysql", "dbname=testdb;host=127.0.0.1", "-----", "---------", "share=1" ) If I made a login panel, would it all be in the login resource? such as : executeSQLQuery("INSERT INTO accounts(account,pass,) VALUES(?,?,?)", playerAccount, playerPassword) Would this be correct in my login_client script?
  19. **facepalm** Sorry! So will i need the modules for this to work?
  20. But how would i use this in a script? dbConnect . How do i connect it to localhost? Sorry If i am being ignorant, I'm just not too sure about MySQL
  21. But how would i use this in a script? dbConnect . How do i connect it to localhost? Sorry If i am being ignorant, I'm just not too sure about MySQL
  22. Well how would i do that? i am wanting to use a DB?
×
×
  • Create New...