Jump to content

Problem with removeWorldModel


Spawn*

Recommended Posts

Hello! I'm having a serious problem with removeWorldModel ... I'm using a server-side function but if I add it more than once it doesn't work:

function sInit() 
     
    --removeWorldModel(3286, 5, -230.2031, 1185.7734, 23.3516) 
    removeWorldModel(16066, 5, -186.4844, 1217.6250, 20.5625) 
    --removeWorldModel(1352, 5, -206.0703, 1192.9219, 18.7109) 
  
    setGlitchEnabled("quickreload", false) 
    setGlitchEnabled("fastmove", false) 
    setGlitchEnabled("fastfire", false)  
    exports.scoreboard:addScoreboardColumn("FPS") 
end 
  
addEventHandler("onResourceStart", getRootElement(), sInit) 

if I use the code as below:

  
removeWorldModel(3286, 5, -230.2031, 1185.7734, 23.3516) 
removeWorldModel(16066, 5, -186.4844, 1217.6250, 20.5625) 
--removeWorldModel(1352, 5, -206.0703, 1192.9219, 18.7109) 
  

or

  
removeWorldModel(3286, 5, -230.2031, 1185.7734, 23.3516) 
removeWorldModel(16066, 5, -186.4844, 1217.6250, 20.5625) 
removeWorldModel(1352, 5, -206.0703, 1192.9219, 18.7109) 
  

don't work! :cry:

I have about 150 objects to remove... :x

The coordinates are accurate, I captured the center of the object in the virtual world! Even if I change the radius doesn' t work!

Help me please and sorry for my bad English :oops:

Link to comment

First of all you have to use 'resourceRoot' instead of 'getRootElement()' in 'onResourceStart' event.

Second, what server version you have? There were some fixes for broken removeWorldModel in the 4785th nightly build, may be you should try to update your server and try to run your script again.

If nothing helps, try to do your script on client-side.

Link to comment

I replaced 'getRootElement()' by 'resourceRoot' and I have a latest version of MTA (1.3.1, downloaded today) and still doesn't work :cry:

I changed type for client-side and it worked, but there are some models of objects that can not withdraw, as the 1308 :cry:

What do you think of this?

Link to comment
Oh god. Why do people use onResourceStart so much nowadays, completely waste of time.

removeWorldModel doesn't require an event and as far as I know it doesn't work. You also should use this server-side of better synchronization.

1. What do you mean by 'synchronization'?

2. What's so wrong about onResourceStart?

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