bandi94 Posted August 20, 2013 Posted August 20, 2013 I just wanna ask if the "createMarker" atleast the corona tipe , is bugged ?? I am generating 8 corona type marker inside a "for" loop. But only 6 are created , so i changed the 8 to 6 , then only 4 are generated, alway's 2 are not generated. And i am not hitting the 34 limit. Bk every created corona is destroyed after 4s. Even i made a lopp checking getElementsByType("Marker") , and there are only the marker's generated by me = 8 . Is this happening to other's to ? Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
50p Posted August 20, 2013 Posted August 20, 2013 Without the code we can't help you. There are no bugs related to markers that I know of. It must be your code. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
bandi94 Posted August 20, 2013 Author Posted August 20, 2013 for i=1, 8 do local newX, newY = getPointFromDistanceRotation(x, y, 15, 360 * (i/8)); local marker_round =createMarker(x,y,z,"corona",3,math.random(255),math.random(255),math.random(255),255) local dumy_round = createObject(1235,x,y,z) attachElements(marker_round,dumy_round) moveObject(dumy_round,4000,newX,newY,z-20,0,0,0,"OutQuad") setTimer(destroyElement,4000,1,marker_round) setTimer(destroyElement,4000,1,dumy_round) end object 1235 is a small trash bin , created to can move the marker. The trash bin is created and i can see it moveing but the marker is not created / attached to it Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
Moderators IIYAMA Posted August 20, 2013 Moderators Posted August 20, 2013 You should watch out with those timers, they can destroy your whole server performance. I don't know what the problem is, every seems fine except for the amount of timers for some elements. Try this and make check if the markers got created: local elementTable = {} for i=1, 8 do local newX, newY = getPointFromDistanceRotation(x, y, 15, 360 * (i/8)); local marker_round = createMarker(x,y,z,"corona",3,math.random(255),math.random(255),math.random(255),255) local dumy_round = createObject(1235,x,y,z) attachElements(marker_round,dumy_round) moveObject(dumy_round,4000,newX,newY,z-20,0,0,0,"OutQuad") elementTable[#elementTable+1]=marker_round elementTable[#elementTable+1]=dumy_round if marker_round then outputChatBox("marker successfully created, marker number: " .. i) end end setTimer(function() for i=1,#elementTable do local element = elementTable[i] if isElement(element) then destroyElement(element) end end end,4000,1) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
bandi94 Posted August 20, 2013 Author Posted August 20, 2013 @IIYAMA , work's like a charm , the timer's must be the problem THX Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
Moderators IIYAMA Posted August 20, 2013 Moderators Posted August 20, 2013 np. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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