Jump to content

[RESOLVED] When use removeWorldObject the server lags...


kalyn

Recommended Posts

Hy guys,

Recently I get a code from one of the forum members which deletes the fence in area51 because I wanted the players to enter that area, now the fence has dissapeared but all the players of the server gets lagged, even I am lagged and the server runs on my computer.

The code is:

addEventHandler("onResourceStart",resourceRoot,function(res) 
    if res == getThisResource() then 
        removeWorldModel(16094,118.60,135.17442,1941.87561,19.32008) 
    end 
end) 

the code is Serverside but when I made him Clientside doesn't work so that's not the problem, if can you give me any suggestions it would be great.

Thanks!

Edited by Guest
Link to comment
This isn't related to lag, but checking whether res == getThisResource() is totally pointless, as the event is only triggered for resourceRoot. Due to this, the function params doesn't need the res declaration.

It behaves like lagging....

And how to edit the function to be right?!

Link to comment
  • Moderators

just write it as old school .lua.

function remove( resourcename ) 
         removeWorldModel(16094,118.60,135.17442,1941.87561,19.32008) 
  
end 
addEventHandler( "onResourceStart", resourceRoot, remove ) 

Link to comment

Try to put

setOcclusionsEnabled( false ) 

after removeElementModel. So the final result will be:

function remove( resourcename ) 
    removeWorldModel(16094,118.60,135.17442,1941.87561,19.32008) 
    setOcclusionsEnabled( false ) 
end 
addEventHandler( "onResourceStart", resourceRoot, remove ) 

Link to comment
Try to put
setOcclusionsEnabled( false ) 

after removeElementModel. So the final result will be:

function remove( resourcename ) 
    removeWorldModel(16094,118.60,135.17442,1941.87561,19.32008) 
    setOcclusionsEnabled( false ) 
end 
addEventHandler( "onResourceStart", resourceRoot, remove ) 

Is the same, it's like the FPS goes up and down dramatically......:-?? dunno what's the problem to resolve it.

Link to comment
Maybe reïnstal gta or check if you have mods running(on that object).
\

the object is the fence around area51 because there I created the Army base and it was closed, but I have like 74 - 75 resources running, idk, if that's the problem....

My computer specifications are:

Windows 7

Intel 2 Core Quad Q8300 @ 2,50 GHZ (4 CPU's)

3 GB RAM

250 GB HDD

On-Board Video Graphics NVidia GeForce 7100/ nForce 630i 256MB

And the down/up speed on aprox 800km's is:

2125278194.png

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