Jump to content
  • 0

Remove Object


skybad

Question

Hello before I start I want to wish a Happy New Year to all.

So my problem is this I'm trying to remove an object but to do this I remove all objects with the same ID, I'll leave here sctipt I'm running with the object.

The problem is I want to remove only some and not all who have the same id.

And one more thing I not only remove all as also in some of them it is a kind of plates on which we can pass through them.

Normal:

wsjv9.png

URL For Image :http://i50.tinypic.com/wsjv9.png

After start the script: :redhotevil::redhotevil::redhotevil::redhotevil::redhotevil:

54t1jc.png

URL For Image :http://i49.tinypic.com/54t1jc.png

Comes from how to walk inside and see what was there anything :redhotevil::x:x:x:cry::cry::cry:

3325nya.jpg

URL For Image :http://i49.tinypic.com/3325nya.jpg

1j9do9.png

URL For Image :http://i48.tinypic.com/1j9do9.png

And i found this resource but i dont know how use this. Or how instal this for exec.

URL For Script i found :https://community.multitheftauto.com/index.php?p=resources&s=details&id=5993

I wish you can help me on that, thank you and good year

Link to comment

14 answers to this question

Recommended Posts

  • 0

I have the same problem this dont solve i think this is my script:

addEventHandler ("onResourceStart",resourceRoot, function() 
    removeWorldModel(3569, 1000, 2234.390625, -2244.828125, 14.9375) -- Model 
    end) 
      
    function restoreall() 
        restoreAllWorldModels() 
        setOcclusionsEnabled(false) 
        setElementAlpha ( thePlayer, 0 ) 
    end 
    addCommandHandler("restore", restoreall) 

Link to comment
  • 0
I have the same problem this dont solve i think this is my script:
addEventHandler ("onResourceStart",resourceRoot, function() 
    removeWorldModel(3569, 1000, 2234.390625, -2244.828125, 14.9375) -- Model 
    end) 
      
    function restoreall() 
        restoreAllWorldModels() 
        setOcclusionsEnabled(false) 
        setElementAlpha ( thePlayer, 0 ) 
    end 
    addCommandHandler("restore", restoreall) 

lol why change player alpha to 0 i mean change object alpha to zero,

try this (not tested).

  
local myObject = removeWorldModel(3569, 1000, 2234.390625, -2244.828125, 14.9375) 
addEventHandler ("onResourceStart",resourceRoot, function() 
    removeWorldModel(3569, 1000, 2234.390625, -2244.828125, 14.9375) -- Model 
    setElementAlpha ( myObject, 0 ) 
    end) 
    function restoreall() 
        restoreAllWorldModels() 
        setOcclusionsEnabled(false) 
        setElementAlpha ( myObject, 255 ) 
    end 
    addCommandHandler("restore", restoreall) 

Link to comment
  • 0

try this.

addEventHandler ("onResourceStart",resourceRoot, function objectRemover() 
    local objects = getElementsByType ( "object" ) 
    local myObject = objects == 3569 
if ( myObject ) then 
    removeWorldModel(myObject, 1000, 2234.390625, -2244.828125, 14.9375) -- Model 
    setElementAlpha ( myObject, 0 ) 
    end 
end) 
    function restoreall() 
        restoreAllWorldModels() 
        setOcclusionsEnabled(false) 
        setElementAlpha ( myObject, 255 ) 
    end 
    addCommandHandler("restore", restoreall) 

Link to comment
  • 0

I found the problem is one thing called LOD now the script is like this

    addEventHandler ("onResourceStart",resourceRoot, function() 
        removeWorldModel(3569, 1000, 2234.390625, -2244.828125, 14.9375) -- Model 
        removeWorldModel(3747, 1000, 2234.390625, -2244.828125, 14.9375) -- LOD 
        end) 
          
        function restoreall() 
            restoreAllWorldModels() 
            setOcclusionsEnabled(false) 
            setElementAlpha ( thePlayer, 0 ) 
        end 
        addCommandHandler("restore", restoreall) 

Not it works but not all i want remove one truck not all and this sh1t remove all trucks :(

Link to comment
  • 0
I found the problem is one thing called LOD now the script is like this
    addEventHandler ("onResourceStart",resourceRoot, function() 
        removeWorldModel(3569, 1000, 2234.390625, -2244.828125, 14.9375) -- Model 
        removeWorldModel(3747, 1000, 2234.390625, -2244.828125, 14.9375) -- LOD 
        end) 
          
        function restoreall() 
            restoreAllWorldModels() 
            setOcclusionsEnabled(false) 
            setElementAlpha ( thePlayer, 0 ) 
        end 
        addCommandHandler("restore", restoreall) 

Not it works but not all i want remove one truck not all and this sh1t remove all trucks :(

my code remove all trucks or yours ? (whats the real problem and what you want)

Link to comment
  • 0

This code that I ate there makes what I wanted to disappear would leave there until this all right, the problem now is that instead of disappearing just that object disappear all objects with the same ID who are on the map, likes this: Object ID is 3569 who are all objects on the map with this ID disappear, I think the problem is this number: removeWorldModel(3569, 1000, 2234.390625, -2244.828125, 14.9375, i think the number 1000 is the rotation so remove all the same objets in that rotation with the id 3569 i will test again for see but i think i found the problem

Link to comment
  • 0
This code that I ate there makes what I wanted to disappear would leave there until this all right, the problem now is that instead of disappearing just that object disappear all objects with the same ID who are on the map, likes this: Object ID is 3569 who are all objects on the map with this ID disappear, I think the problem is this number: removeWorldModel(3569, 1000, 2234.390625, -2244.828125, 14.9375, i think the number 1000 is the rotation so remove all the same objets in that rotation with the id 3569 i will test again for see but i think i found the problem

Sorry, i gave you code to remove all objects with same id's, here is another code, try it:

addEventHandler ("onResourceStart",resourceRoot, function objectRemover() 
    local myObject = 3569 
if ( myObject ) then 
    removeWorldModel(myObject, 1000, 2234.390625, -2244.828125, 14.9375) -- Model 
    setElementAlpha ( myObject, 0 ) 
    end 
end) 
    function restoreall() 
        restoreAllWorldModels() 
        setOcclusionsEnabled(false) 
        setElementAlpha ( myObject, 255 ) 
    end 
    addCommandHandler("restore", restoreall) 

if that code not work then try this

  
addEventHandler ("onResourceStart",resourceRoot, function objectRemover() 
    local myObject = 3569 
if ( myObject ) then 
    removeWorldModel(myObject, 1000, 2234.390625, -2244.828125, 14.9375) -- Model 
    removeWorldModel(3747, 1000, 2234.390625, -2244.828125, 14.9375) -- LOD 
    setElementAlpha ( myObject, 0 ) 
    end 
end) 
    function restoreall() 
        restoreAllWorldModels() 
        setOcclusionsEnabled(false) 
        setElementAlpha ( myObject, 255 ) 
    end 
    addCommandHandler("restore", restoreall) 

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