-
Posts
112 -
Joined
-
Last visited
-
Days Won
1
Everything posted by quindo
-
You are checking if boss is true after you already changed player stats, you need to do that before, and return from function if it's true.
-
I sure did, passwordHash gives you hashed password, which you store in database, passwordVerify only checks if given password results in that given hash, you can't get password from hash. The original password isn't stored anywhere.
-
Please tell me you're not serious, never roll out your own crypto. Storing hashes from passwordHash is as safe as it gets, there's no "passwordUnhash", only feasible way of unhashing it are rainbow tables, but I'm sure mta salts the passwords, so it shouldn't be a problem.
-
You are triggering vendInit event, which is added serverside, but the error seems to mention different event
- 13 replies
-
- serverside
- clientside
-
(and 2 more)
Tagged with:
-
The event "onPlayer(ResourceName)Start" Isn't defined nor triggered anywhere in the snippet you posted.
- 13 replies
-
- serverside
- clientside
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
Not really, here's completely not optimised way that could work: function RemoveElementFromAttachedTable(element, player) if player then for ind,elem in ipairs(playerAttachedElements[player]) do if elem == element then table.remove(playerAttachedElements[player], ind) return end end else for _,player in pairs(playerAttachedElements) do for ind,elem in ipairs(playerAttachedElements[player]) do if elem == element then table.remove(playerAttachedElements[player], ind) return end end end end end When you're detaching the element, but before destroying the element, call this function. It will be fast if you pass both arguments (element and player), but it will also work if you pass only element, by looking over all players and elements attached to them in the table and deleting it from the first place where it finds that element. I suggest passing both element and player, because it will be much faster.- 38 replies
-
- 1
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
That's what i meant, if you attach element, and later detach it, it will still be in the playerAttachedElements[player] table, you will have to write function that removes it from table when you remove the element.- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
What are you even trying to do here: destroyElement(tostring(image[i][1]))--What am I doing wrong here? the tostring doesn't make sense in this place, also why are you trying to access index 1 of the image? just add destroyElement(source) at the end of your MineIronGUI function
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
function AttachElementToBone(element, player, ...) local dim = getElementDimension( player ) local int = getElementInterior( player ) setElementDimension( element, dim ) setElementInterior( element, int ) if isElement(element) and isElement(player) then if not playerAttachedElements[player] then playerAttachedElements[player] = {} end table.insert(playerAttachedElements[player],element) end return exports.bone_attach:attachElementToBone(element, player, ...) end Remember that if you want to remove attached object later on, you need to also remove it from playerAttachedElements table for it to work correctly.- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
local playerAttachedElements = {} function updatePlayerAttachedElements(lastInt, lastDim, curInt, curDim) local attachedObjects = getElementChildren ( source, "object") if playerAttachedElements[source] then for _,elem in pairs(playerAttachedElements[source]) do setElementDimension( elem, curDim ) setElementInterior( elem, curInt ) end end end addEventHandler( "onPlayerDimIntChange", root, updatePlayerAttachedElements ) function AttachElementToBone(element, player, ...) if isElement(element) and isElement(player) then if not playerAttachedElements[player] then playerAttachedElements[player] = {} end table.insert(playerAttachedElements[player],element) end return exports.bone_attach:attachElementToBone(element, player, ...) end- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
Bone attach doesn't use attachElement, so it wont work, it updates position on every frame- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
Okay, so it detects properly that the dimension changed, but it doesn't treat attached object as this player child object. It should be assigned as child element when you attach it to the bone, pretty weird.- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
Looks like it fails to refresh, maybe something wrong with event triggering, can you check what shows in debugscript when you change this: function updatePlayerAttachedElements(lastInt, lastDim, curInt, curDim) outputDebugString ( "Sanity check: "..tostring(source).." - "..tostring(lastInt).." - "..tostring(lastDim).." - "..tostring(curInt).." - "..tostring(curDim) ) local attachedObjects = getElementChildren ( source, "object") outputDebugString( "Number of attached objects: "..tostring(#attachedObjects) ) for _,elem in pairs(attachedObjects) do setElementDimension( elem, curDim ) setElementInterior( elem, curInt ) end end addEventHandler( "onPlayerDimIntChange", root, updatePlayerAttachedElements )- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
How are you attaching the Element now? using the orignial export function, or by the one i wrote earlier?- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
local DIM_REFRESH_FREQ = 1000 addEvent("onPlayerDimIntChange") local lastDimIntTable = {} function CheckPlayerDimension() local players = getElementsByType("player", root) for _,player in ipairs(players) do outputDebugString ( "We passed Check #1", 3) local curDim = getElementDimension( player ) local curInt = getElementInterior( player ) if not lastDimIntTable[player] then lastDimIntTable[player] = {dim = curDim, int = curInt} end if (curDim ~= lastDimIntTable[player].dim) or (curInt ~= lastDimIntTable[player].int) then outputDebugString ( "We passed Check #2", 3) triggerEvent( "onPlayerDimIntChange", player, lastDimIntTable[player].int, lastDimIntTable[player].dim, curInt, curDim) -- error here lastDimensionTable[player].dim = curDim lastDimensionTable[player].int = curInt end end end setTimer( CheckPlayerDimension, DIM_REFRESH_FREQ, 0 )- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
Aren't there any other errors from the script i gave you? It seems that rest of the script fails to load.- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
Where are those events defined? I mean the AttachPepsi, takeCash, OnDrink ones?- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
function updatePlayerAttachedElements(lastInt, lastDim, curInt, curDim) local attachedObjects = getElementChildren ( source, "object") for _,elem in pairs(attachedObjects) do setElementDimension( elem, curDim ) setElementInterior( elem, curInt ) end end addEventHandler( "onPlayerDimIntChange", root, updatePlayerAttachedElements )- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
Actually, can you check if it works? local DIM_REFRESH_FREQ = 1000 addEvent("onPlayerDimIntChange") local lastDimIntTable = {} function CheckPlayerDimension() local players = getElementsByType("player", root) for _,player in ipairs(players) do local curDim = getElementDimension( player ) local curInt = getElementInterior( player ) if not lastDimIntTable[player] then lastDimIntTable[player] = {dim = curDim, int = curInt} if (curDim ~= lastDimIntTable[player].dim) or (curInt ~= lastDimIntTable[player].int) then triggerEvent( "onPlayerDimIntChange", player, lastDimensionPlayer[player].int, lastDimensionPlayer[player].dim, curInt, curDim) lastDimensionTable[player].dim = curDim lastDimensionTable[player].int = curInt end end setTimer( CheckPlayerDimension, DIM_REFRESH_FREQ, 0 ) function updatePlayerAttachedElements(lastInt, lastDim, curInt, curDim) local attachedObjects = getElementChildren ( source, "object") for _,elem in pairs(attachedObjects) setElementDimension( elem, curDim ) setElementInterior( elem, curInt ) end end addEventHandler( "onPlayerDimIntChange", root, updatePlayerAttachedElements ) function AttachElementToBone(element, player, ...) if isElement(element) and isElement(player) then setElementParent(element, player) end return exports.bone_attach:attachElementToBone(element, player, ...) end It's not optimised at all, but it should automatically detect if player has changed dimension or interior, and update attached elements too. use AttachElementToBone function instead of exports.bone_attach:attachElementToBone I haven't tested it, so if there are any errors post it here- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
Ah, my code is client sided, and it only detects if local player changed dimension, if you need something that can update each player server sided i don't think something like that would be a good choice.- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
if (source) and x and y and z then x,y,z aren't defined anywhere, so the function ends here
-
boneAttach gets Invisible on entering another interior/dimension
quindo replied to Zuher Laith's topic in Scripting
You could also make it an event yourself: local DIM_REFRESH_FREQ = 1000 addEvent("onClientDimensionChange") local lastDimension = getElementDimension( localPlayer ) function CheckPlayerDimension() local curDim = getElementDimension( localPlayer ) if curDim ~= lastDimension then triggerEvent( "onClientDimensionChange", localPlayer, lastDimension, curDim) lastDimension = curDim end end setTimer( CheckPlayerDimension, DIM_REFRESH_FREQ, 0 ) it does check if player dimension changed every second, and if it happened it triggers event, it passes last dimension and new one as event arguments.- 38 replies
-
- attachbone
- interior
-
(and 2 more)
Tagged with:
-
You can use https://wiki.multitheftauto.com/wiki/OnClientVehicleDamage to get position where the bullet hit the car, and after that loop over vehicle components list and find which one was closest to the hit. It will not be at all precise, there may be some better way, i can't think of it now tho.
-
Do you get any errors when you enable /debugscript 3 ?
-
connection = dbConnect( "mysql", "dbname="..mySQLDetails["db"]..";host="..mySQLDetails["host"].."", ""..mySQLDetails["acc"].."", ""..mySQLDetails["pass"].."", "share=1" ) _dbQuery = dbQuery function dbQuery(query, values) return _dbQuery(connection,query,values) end