Jump to content

destroyElement problem


Padul

Recommended Posts

    if clientSyrenaState == 1 then
        syrena = playSound3D ( "shrtvaw.ogg" , x, y, z, true )
        setElementData(playerOccupiedRadiolka,"radiolka:syrenaClientSyrena",syrena)
        attachElements(syrena,playerOccupiedRadiolka)
    elseif clientSyrenaState == 2 then
        destroyElement(syrena)
        triggerServerEvent( "usunDateBoPoChujOna" ,localPlayer)
        syrena = playSound3D ( "lngvaw.ogg" , x, y, z, true )
        setElementData(playerOccupiedRadiolka,"radiolka:syrenaClientSyrena",syrena)
        attachElements ( syrena, playerOccupiedRadiolka )
    elseif clientSyrenaState == 0 then
        destroyElement(syrena)
        triggerServerEvent( "usunDateBoPoChujOna" ,localPlayer)
    end

warning @ destroy element ( expetced element, got nill )

Link to comment
  • Moderators

Once you have set the element data, you can get it back by using getElementData

if clientSyrenaState == 1 then
    local syrena = playSound3D ( "shrtvaw.ogg" , x, y, z, true )
    setElementData(playerOccupiedRadiolka,"radiolka:syrenaClientSyrena",syrena) -- set the element data for syrena
    attachElements(syrena,playerOccupiedRadiolka)
elseif clientSyrenaState == 2 then
    local syrena = getElementData(playerOccupiedRadiolka,"radiolka:syrenaClientSyrena") -- get the element data for syrena
    destroyElement(syrena)
    triggerServerEvent( "usunDateBoPoChujOna" ,localPlayer)
    syrena = playSound3D ( "lngvaw.ogg" , x, y, z, true )
    setElementData(playerOccupiedRadiolka,"radiolka:syrenaClientSyrena",syrena) -- set the element data for syrena
    attachElements ( syrena, playerOccupiedRadiolka )
elseif clientSyrenaState == 0 then
    local syrena = getElementData(playerOccupiedRadiolka,"radiolka:syrenaClientSyrena") -- get the element data for syrena
    destroyElement(syrena)
    triggerServerEvent( "usunDateBoPoChujOna" ,localPlayer)
end

 

Link to comment

i have finaly done that

 

local syrena={}


	if signal=="slow" then
		syrena[veh]=playSound3D("shrtvaw.ogg",x,y,z,true)
		attachElements(syrena[veh],veh)
	elseif signal=="fast" then
		destroyElement(syrena[veh])
		syrena[veh]=playSound3D("lngvaw.ogg",x,y,z,true)
		attachElements(syrena[veh],veh)
	else destroyElement(syrena[veh]) end

 

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...