Newbie Posted March 22, 2015 Posted March 22, 2015 (edited) 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 March 22, 2015 by Guest
Ryancit2 Posted March 22, 2015 Posted March 22, 2015 setElementVisibleTo ( element theElement, element visibleTo, bool visible ) Replace theElement with object, replace visibleTo with root of players, remove bool visible with false.
Newbie Posted March 22, 2015 Author Posted March 22, 2015 And what if i use: engineSetModelLODDistance ?
xXMADEXx Posted March 22, 2015 Posted March 22, 2015 It would probably be best to use destroyElement on the client side, that way the game will completely remove it.
Newbie Posted March 22, 2015 Author Posted March 22, 2015 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
dewu Posted March 22, 2015 Posted March 22, 2015 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
Mr.unpredictable. Posted March 22, 2015 Posted March 22, 2015 Try this it will destroy the object with model id 800 function haha(modelID) local obj = getElementsByType("object") for i,v in ipairs(obj) do if (getElementModel(v) == modelID) then destroyElement(v) end end end haha(800)
dewu Posted March 22, 2015 Posted March 22, 2015 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
Newbie Posted March 22, 2015 Author Posted March 22, 2015 (edited) EDIT: Edited March 22, 2015 by Guest
Newbie Posted March 22, 2015 Author Posted March 22, 2015 Nah.. I've tested it again, same problem lol
Gallardo9944 Posted March 22, 2015 Posted March 22, 2015 setElementDimension to anything than 0 will hide an object, setElementDimension to 0 will show it up. Not a new idea though, been using it on my server for half a year already.
WhoAmI Posted March 22, 2015 Posted March 22, 2015 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now