Seba500PLK Posted January 23, 2015 Posted January 23, 2015 Hello, I have a problem with the ID of the object when you want the object to delete it I can not retrieve the ID -----m_s.lua------- function RemoveObject(object) local x, y, z = getElementPosition(getElementData(object, "parent")) destroyElement(getElementData(object, "parent")) destroyElement(object) local nid = getElementData(getElementData(object, "parent"),"nid") outputChatBox (nid) --local d = dbQuery ( dbConnection, "DELETE FROM Objects WHERE id='"..nid.."'" ) --dbFree ( d ) end addEvent("removeObject", true) addEventHandler("removeObject", getRootElement(), RemoveObject) Trigger Event "RemoveObject": if itemName == "Case" then local col = getElementData(getLocalPlayer(), "currentCol") triggerServerEvent("removeObject", getLocalPlayer(), getElementData(col, "parent")) disableMenu() return end error in console: [16:31:29] WARNING: [scripts]/Testing/m_s.lua:10: Bad argument @ 'getElementData ' [Expected element at argument 1] [16:31:29] WARNING: [scripts]/Testing/m_s.lua:10: Bad argument @ 'getElementData ' [Expected element at argument 1, got boolean] [16:31:29] WARNING: [scripts]/Testing/m_s.lua:12: Bad argument @ 'outputChatBox' [Expected string at argument 1, got boolean]
AMARANT Posted January 23, 2015 Posted January 23, 2015 That's because your object returns 'false'. Check your code earlier when you're trying to retrieve your object to understand where you went wrong.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now