Jump to content

[Solved]


Newbie

Recommended Posts

Since MTA Race maps became very "cluttered" with useless objects like hipoly trees and ect. That causes lag / FPS drops for some players. About the idea, is is posibble to hide specified obejcts for player ?

Edited by Guest
Link to comment

Can someone show me an example of destroyElement, i never used this so far.

Thats what i got with setting LOD distance:

function lager(thePlayer) 
for i=600,800 do 
engineSetModelLODDistance(i, 1)   
end 
end 
addCommandHandler("antilag", lager) 

600 - 800 ID's Threes, some plants.

Setting Model Lods, isn't the best way.. Well its working fine, but i think i should better use destroyElement

Link to comment
    function AntiLag() 
    for _, v in ipairs ( getElementsByType ( "object", root, true ) ) do  
      local id = getElementModel ( v )  
      if ( id => 600 and <= 800) then  
       destroyElement(v) 
     end  
    end 
    end 

Link to comment

He wants to destroy objects from id 600 to 800.

Try now:

 function AntiLag() 
    for _, v in ipairs ( getElementsByType ( "object", root, true ) ) do 
      local id = getElementModel ( v ) 
      if ( id => 600 and id <= 800) then 
       destroyElement(v) 
     end 
    end 
    end 

Link to comment
function AntiLag() 
    for _, v in ipairs ( getElementsByType ( "object", root, true ) ) do 
      local id = getElementModel ( v ) 
      if ( id >= 600 and id <= 800) then 
       destroyElement(v) 
     end 
    end 
    end 

Try it.

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