Jump to content

Pirulax

Discord Moderators
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Pirulax

  1. So, i want to create a dead system, and i need 1 thing, and that is: cancelling the camera shake effect when the player dies.. And i want to reanimate the player when i use SetElementHealth(...) I already tried setCameraTarget() but not worked.. Thanks in advance.
  2. So,I was wondering what's the counterpart of DxGetStatus() I searched for dxSetSetting,dxSetStatus, but found nothing.. I need it for dashboard / graphics settings tab Haven't wrote a script yet
  3. Használj kód tageket kérlek.
  4. Best answer ever... Btw, why you want to download that file?Even if its in the x resource you can use it in the y resource like this: --Example local font = dxCreateFont(":x/files/font.ttf",9,false,"antianalised")
  5. Wait, so, this script isn't ur?
  6. What you exactly want from us?We can help you, but we will not write a script for you. Btw, user assert instead of that if not x or not y or not w or not h then outputDebugString("Error: Missing some arguments (x,y,w,h)") end So, you assert function will look like this: for k,v in ipairs({x,y,w,h}) do assert(type(v) == "number" or not v, "Expected number at argument #" .. k .. " @ createList [got " .. type(v) .. "]") end
  7. Next time add that addEventHandler("onClientRender",....) ((Just before you write down a post again, teaching me ==> I know the correct addEventHandler syntax.
  8. I know, that dbPoll returns the number of affected rows, last insert id, and a table too. From the MTA Wiki ==> Btw, if im not using dbExec propertly, then go and try to run a script like this,and it will succeed. dbExec(con "SELECT * FROM accounts WHERE id=?", 1) This will return true most likely.
  9. Pirulax

    vehicle ID

    ahh, vehS = vehS + 1 The problem was, that u didnt saved the last number.
  10. Pirulax

    lua problem

    Please Code in code tags.
  11. Pirulax

    vehicle ID

    So, what you want from us?To create a getcar command?If so, here it is: function getCar(c,p,id) if not id then outputChatBox("Please enter a valid vehID",p) return end for k,v in ipairs(getElementsByType("vehicle")) do if getElementData(v, "vehID") == id then setElementPosition(v, Vector3(getElementPosition(p))) outputChatBox("Here it is!",p) return end outputChatBox("Invalid vehID",p) end end end addCommandHandler("getcar", getCar, false,false)
  12. So, i have a little code ==> id,charname,anick,dead,ajail,otherdata,skinid,pos,bones,health,hunger = getElementData(client, "acc:id"), name,"admin",toJSON({0, false}), toJSON({false, 0, "", "", 0}),toJSON({szuldate,varos,age,cm,kg}), skinid,toJSON(spawnPosTable),toJSON({})--[[csontok..]],100,100 theXec = dbExec(con, "INSERT INTO characters SET id=?,charname=?,anick=?,dead=?,ajail=?,otherdata=?,skinid=?,pos=?,bones=?,health=?,hunger=?", id,charname,anick,dead,ajail,otherdata,skinid,pos,bones,health,hunger) if theXec then --doSomething else --doSomething else end outputDebugString(tostring(theXec)) All the variables have their value, but for some reason dbExec is returning nil.And does nothing.((Nothing in the Db tho)) My 2nd question is: What can return a number of affected rows?I have a query: "SELECT * FROM accounts WHERE id=?", and i want to get the number of affected rows.
  13. Figured it out later the missing "[]" was the problem
  14. So, heres my table local twonodes = {"login", "rpteszt"} local thirdnodes = {[twonodes[1]] = {"username","password", "rememberMe"}, [twonodes[2]]={"rpteszt"}} local values = {thirdnodes[twonodes[1]]={"false"}} Seems good, right?Yeah, for u,but not for Lua... ERROR: Loading script failed: loginpanel/loginpanelC:112: '}' expected near '=''
  15. Pirulax

    RGB Vector?

    What about this one?==> function rgbVector(r,g,b) return r,g,b end Btw made by me.
  16. Same happened to me, it was bcuz the script contained errors.
  17. Pirulax

    RGB Vector?

    Hello guys, just a fast question.Does something like RGB Vector exists?I know about Vector2,Vector3,Vector4 and nothing more.
  18. Hello guys, for some reason debugscript is saying this..Heres my script piece: setElementData(p, "acc:admin", 7) if not getElementData(p, "acc:admin") > 0 then return end Nothing else changes acc:admin. Edit: Found the solution: setElementData(p, "acc:admin", 7) if not (getElementData(p, "acc:admin") > 0) then return end But, i still don't understand, so can someone explain me whats the difference between those code blocks?
  19. I know, that dbPoll frees it.But you need to free a dbQuery(except if u used it in a dbPoll). https://wiki.multitheftauto.com/wiki/DbQuery
  20. you should use dbFree too(in case u not need results) So, you script should look something like this: function doSomeSQLThing() local query = dbQuery(dbConnection, " Some SQL command here") -- do something with mysql query if you want. dbFree(query) end
×
×
  • Create New...