Jump to content

Function: removeWorldModel


demojoel

Recommended Posts

Posted

I'm testing the function on the SF bridge, I know how to delete objects one by one, but I'd like to delete the whole bridge in one go, I did it once, but I can't remember how to do it again.

The Function so far: (Some parts of the code might not even be needed)

function removeobject() 
    removeWorldModel(10821, 2000,  -1292.48046875, 938.3876953125, 52.886108398438) -- Bridge Test 
     
end 
addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), removeobject) 
  
  
for i=10821,10000 do 
    removeWorldModel(i,2000,-1292.48046875, 938.3876953125, 52.886108398438) 
end 
  
  
function restoreall() 
    restoreAllWorldModels() 
end 
addCommandHandler("rawo", restoreall) 
  

Posted

I'm not sure,

function removeobject() 
    removeWorldModel(10821, 2000,  -1292.48046875, 938.3876953125, 52.886108398438) -- Bridge Test 
    
end 
addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), removeobject) 

That doesn't work, the bridge isn't removing.

Posted

You need to go away from the position.

And you also need to delete the LOD object.

If I helped you, please click the like button on the right ;) Thanks!

Posted (edited)

anyways, try this:

addEventHandler ("onResourceStart",resourceRoot, function() 
   removeWorldModel(10821, 2000,  -1292.48046875, 938.3876953125, 52.886108398438) 
    for i=10821,10000 do 
        removeWorldModel(i,2000,-1292.48046875, 938.3876953125, 52.886108398438) 
    end 
end)  
  
function restoreall() 
    restoreAllWorldModels() 
end 
addCommandHandler("rawo", restoreall) 

Edited by Guest

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

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