![](https://forum.multitheftauto.com/uploads/monthly_2018_02/bgimg..png.2e935deab1b1b4c3240520a864d18cfc.png)
Pirulax
Discord Moderators-
Posts
403 -
Joined
-
Last visited
Everything posted by Pirulax
-
Will not work, bcuz camera is on event.. onClientPreRender.
- 25 replies
-
- cancelling camera shake effect
- lua
- (and 4 more)
-
are you talking about canceling the shake effect, or the dead thing?
- 25 replies
-
- 1
-
-
- cancelling camera shake effect
- lua
- (and 4 more)
-
I dont think so, because setCameraTarget already does that. But, i'll give it a try.Tomorrow
- 25 replies
-
- cancelling camera shake effect
- lua
- (and 4 more)
-
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.
- 25 replies
-
- cancelling camera shake effect
- lua
- (and 4 more)
-
never mind...
-
Használj kód tageket kérlek.
-
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")
-
Wait, so, this script isn't ur?
-
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
-
Next time add that addEventHandler("onClientRender",....) ((Just before you write down a post again, teaching me ==> I know the correct addEventHandler syntax.
-
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.
-
ahh, vehS = vehS + 1 The problem was, that u didnt saved the last number.
-
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)
-
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.
-
Figured it out later the missing "[]" was the problem
- 10 replies
-
- lua
- lua tables
-
(and 2 more)
Tagged with:
-
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 '=''
- 10 replies
-
- lua
- lua tables
-
(and 2 more)
Tagged with:
-
Same happened to me, it was bcuz the script contained errors.
-
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?
-
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
-
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