Newbie Posted March 22, 2015 Share 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 Link to comment
Ryancit2 Posted March 22, 2015 Share 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. Link to comment
Newbie Posted March 22, 2015 Author Share Posted March 22, 2015 And what if i use: engineSetModelLODDistance ? Link to comment
xXMADEXx Posted March 22, 2015 Share Posted March 22, 2015 It would probably be best to use destroyElement on the client side, that way the game will completely remove it. Link to comment
Newbie Posted March 22, 2015 Author Share 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 Link to comment
dewu Posted March 22, 2015 Share 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 Link to comment
Newbie Posted March 22, 2015 Author Share Posted March 22, 2015 ) expected near =, line 4 Link to comment
Mr.unpredictable. Posted March 22, 2015 Share 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) Link to comment
dewu Posted March 22, 2015 Share 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 Link to comment
Newbie Posted March 22, 2015 Author Share Posted March 22, 2015 (edited) EDIT: Edited March 22, 2015 by Guest Link to comment
Newbie Posted March 22, 2015 Author Share Posted March 22, 2015 Nah.. I've tested it again, same problem lol Link to comment
Gallardo9944 Posted March 22, 2015 Share 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. Link to comment
WhoAmI Posted March 22, 2015 Share 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. Link to comment
Newbie Posted March 22, 2015 Author Share Posted March 22, 2015 Thanks for help, i made what i needed for! Link to comment
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