Jump to content

Function: removeWorldModel


demojoel

Recommended Posts

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) 
  

Link to comment

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.

Link to comment

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