Jump to content

[HELP] I can not get the id


Seba500PLK

Recommended Posts

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]

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...