rusztamas

Members
  • Content count

    125
  • Joined

  • Last visited

Community Reputation

3 Neutral

About rusztamas

  • Rank
    Sucka

Details

  • Location
    Hungary, Budapest
  • Interests
    System Administration, Programming

Recent Profile Visitors

450 profile views
  1. nothing, since then it made sence.
  2. string mouseButton, string buttonState, player playerWhoClicked, float clickPosX, float clickPosY, float clickPosZ but for example if i am lucky and i can find that coordinate, (clickPosX, clickPosY, and clickPosZ) i will be never that lucky again to find that coordinate. or can i use this somehow in an other way?
  3. yes i did, sorry for the hurry-scurry and i have an other question, i don't really want to make a new topic for that, because i post a lot of things here, so... on the image above, where the errors are as well, you can se a door. i tried to find a function i think i did not find the best function for that. i'd like to make a script for example i click the door, and it opens. what should i use for that?
  4. function OBJECTS() if DOOR_1 or DOOR_2 then destroyElement (DOOR_1) end --Destroys previous elements. DOOR_1 = createObject (2949, -709.25128173828, 947.37493896484, 11.458323478699) --Creates a door, declared as DOOR_1. DOOR_2 = createObject (2949, -709.25128173828, 948.9, 11.458323478699) --Creates a door, declared as DOOR_2. setElementData (DOOR_1, "locked", true) --DOOR_1 is locked. setElementData (DOOR_2, "locked", false) --DOOR_2 is unlocked. setElementData (DOOR_1, "open", false) --DOOR_1 is closed. setElementData (DOOR_1, "open", false) --DOOR_2 is closed. end addEventHandler ("onResourceStart", getRootElement(), OBJECTS) Line 75 is the 8th line, 83 is the 16th: function ATTEMPT_LOCK_INTERACTION(CLIENT) if isElementWithinMarker (CLIENT, DOOR_1_MARKER) then if getElementData (DOOR_1, "locked") == false then if getElementData (DOOR_1 "open") == false then setElementData (DOOR_1, "locked", true) end elseif getElementData (DOOR_1, "locked") == true then if getElementData (DOOR_1 "open") == false then setElementData (DOOR_1, "locked", false) end end end if isElementWithinMarker (CLIENT, DOOR_2_MARKER) then if getElementData (DOOR_2, "locked") == false then if getElementData (DOOR_2 "open") == false then setElementData (DOOR_2, "locked", true) end elseif getElementData (DOOR_2, "locked") == true then if getElementData (DOOR_2 "open") == false then setElementData (DOOR_2, "locked", false) end end end end addCommandHandler ("ATTEMPT_LOCK_INTERACTION", ATTEMPT_LOCK_INTERACTION)
  5. function lekerdez(jatekos, parancs, jatekosnev) qh = dbQuery(db, "SELECT * FROM feltoltesek WHERE jatekosnev='"..jatekosnev.."'") result = dbPoll (qh, -1) local row = result if row then local x = tostring(result["x"]) outputChatBox (""..x.."", jatekos) else outputChatBox ("Error!", jatekos) end end addCommandHandler ("lekerdez", lekerdez) I made one with dbPoll, as you said, i found this example in an other script, but it should output an X coordinate in the chat, but it puts "nil".
  6. not to annoy you, i really appreciate your helpfulness, but i am really new to this part of programming, and i don't really understand the problem. i picked this one from an other code, in that one it seems to work, here it is not, and i dont really understand the code you posted above. I'm trying to learn all of the functions of programming on a template, and i try to learn that template, but here every commenter posted different codes, and i don't know which one is the best to learn. for example yours is an anonymous function, and i found it interesting.
  7. what is wrong with this one? DB = dbConnect( "mysql", "dbname=teszt;host=127.0.0.1", "root", "mypassword", "share=1" ) local data = dbQuery(DB, "SELECT * FROM feltoltesek WHERE jatekosnev='"..jatekosnev.."'") if (data) then local x = tostring(data["x"]) outputChatBox (""..x.."", jatekos) end 2nd line: attempt to concatenate local 'jatekosnev' (a nil value)
  8. i made a script, that some of the player's data gets recorded into my database. i am very new to mysql, but i need it, and found it useful. i am thankful for the replies, and explanations but i dont really understand it yet. local table = "My Table"; local IsTomOnDatabase = dbExec(DB,"SELECT * FROM "..table.." WHERE jatekosnev=?",'cmdTommy' i've got these ones, but below it i dont. i dont know why i need # before isTomOnDatabase, and why not == instead of =~ and the meaning of 0.please help!
  9. thank you but, what does the # mean in the 6th line before IsTomOnDatabase? and this one:? ~= 0
  10. Hi! I know how to insert data to mysql, but i don't know how to get them, or find them. For example: I'd like to get cmdTommy's X Y and Z and set his position to them, when for example a type in a command. Could you please help me how to do it, and explain how does it work? I use the built-in mysql functions.
  11. Thank you very much!
  12. Hi! As i log into my server, i recieve a lot of warnings, which are really annoying, due to a timer, who is spamming it, i don't even understand why is it spamming my debugscript, while i am not in a vehicle, just standing. function bekapcsoltOvEllenorzese(jatekos) --this is line 55 if isPedInVehicle (jatekos) == true and getElementData (jatekos, "bekapcsoltOv") == false then if isTimer(beeping) then killTimer (beeping) beeping = setTimer ( function() triggerClientEvent ("beltWarning", jatekos) bindKey (jatekos, "F5", "down", "öv") end, 1000, 0) else beeping = setTimer ( function() triggerClientEvent ("beltWarning", jatekos) bindKey (jatekos, "F5", "down", "öv") end, 1000, 0) end end end addEventHandler ("onVehicleEnter", getRootElement(), bekapcsoltOvEllenorzese) --this is line 71 I am not even in a vehicle, so i don't know why the function gets called, while it has "onVehicleEnter"...
  13. Thank you for your help! You made me understand what the problem was, did this in a few cases too, fixed the buggy script.
  14. now this error is gone, but there is an other, i will post it here as soon as i arrive home from school
  15. Hello! I have the following problem: It is really annoying, because i don't know why is this happening. Whether i am in the car or not, it is spamming the debugscript, and starts, after i sat in the vehicle. function getJarmuElet() local jatekosVehicle = getPedOccupiedVehicle ( localPlayer ) local jarmuHealth = getElementHealth ( jatekosVehicle ) / 10 if jatekosVehicle and jarmuHealth then return jarmuHealth else return nil end end if jarmuHealth > 80 then dxDrawText ("Jármű: #42f448OK!", 1480/devX*jatekosX, 802.5/devY*jatekosY, _, _, _, _, "default-bold", _, _, _, _, _, true) elseif jarmuHealth <= 79 and jarmuHealth >= 51 then dxDrawText ("Jármű: #f49141STOP!", 1475/devX*jatekosX, 802.5/devY*jatekosY, _, _, _, _, "default-bold", _, _, _, _, _, true) elseif jarmuHealth <= 50 then dxDrawText ("Jármű: #f45241SERV!", 1475/devX*jatekosX, 802.5/devY*jatekosY, _, _, _, _, "default-bold", _, _, _, _, _, true) end jarmuHealth's definition in the other function: local jatekosVehicle = getPedOccupiedVehicle (localPlayer) --this one is defined as well, because later there are some things that need the vehicle element local jarmuHealth = getJarmuElet() Line 23 is the 3d line of function getJarmuElet. Sorry for hungarian namings, i already got used to it, but trying to use mixed languages in production code, and trying to use full english next time. But please help, i really don't know what the problem is.