WelCome Posted June 1, 2018 Share Posted June 1, 2018 Hi, today i wanted create "random marker position" but i have problem table ={ ['A'] = { {-805.34595, 743.04645, 54.34844}, {-809.69177, 764.23022, 54.34844}, }, ['B'] = { {-838.24719, 731.62659, 54.34844}, {-834.38562, 762.48022, 54.34844}, }, } addCommandHandler("commander",function() for i,v in pairs(table) do local ran = math.random(1,#v) local marker =createMarker(v[ran][1],v[ran][2],v[ran][3],"ring",3,255,0,0,255) createBlipAttachedTo(marker,18) end end) sometimes marker create on wrong position and i dont know why bad = https://imgur.com/a/xhPNXw7 good = https://imgur.com/a/uiSy3Fq Link to comment
Skully Posted June 1, 2018 Share Posted June 1, 2018 It looks like your markers are being fine, using the coordinates you've specified in the table, are you sure those coordinates are correct to what you want? Also, I wouldn't recommend calling a variable table since it'll override the default Lua table functions. Link to comment
WelCome Posted June 2, 2018 Author Share Posted June 2, 2018 i want draw the cords of 'a' or 'b' Link to comment
Skully Posted June 3, 2018 Share Posted June 3, 2018 (edited) On 6/2/2018 at 09:49, WelCome said: i want draw the cords of 'a' or 'b' From my understanding, are you attempting to place a random marker whenever a player does the command? If so, this should work fine. positions = { [1] = {-805.34595, 743.04645, 54.34844}, [2] = {-809.69177, 764.23022, 54.34844}, [3] = {-838.24719, 731.62659, 54.34844}, [4] = {-834.38562, 762.48022, 54.34844}, } addCommandHandler("commander", function() local ran = math.random(1, #positions) local marker = createMarker(positions[ran][1], positions[ran][2], positions[ran][3], "ring", 3, 255, 0, 0, 255) createBlipAttachedTo(marker, 18) end) Edited June 3, 2018 by Skully Link to comment
WelCome Posted June 3, 2018 Author Share Posted June 3, 2018 I want math.random "a" or "b" and create a marker with positions of "a" or "b" 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