itHyperoX Posted March 29, 2017 Share Posted March 29, 2017 How can i get the zone name from table? local posTable = { {{2675.6840820313, 805.86389160156, 200}, {2675.6840820313, 805.86389160156, 10.434359550476}}, --< Las Venturas, Építkezés >-- {{2000.8110351563, 1563.2194824219, 200}, {2000.8110351563, 1563.2194824219, 14.934368133545}}, --< Las Venturas, Kaszinóval szemben hajó >-- {{2046.3370361328, 1158.7958984375, 200}, {2046.3370361328, 1158.7958984375, 10.134365081787}}, --< Las Venturas, Városi 2 sávos >-- {{1643.2946777344, -25.087184906006, 200}, {1643.2946777344, -25.087184906006, 36.03441619873}}, --< Los Santos, 2 sávos >-- {{47.896957397461, -1529.2211914063, 200}, {47.896957397461, -1529.2211914063, 4.8344135284424}}, --< Los Santos, déli határ >-- {{268.02044677734, 1882.9016113281, 200}, {268.02044677734, 1882.9016113281, -30.465515136719}}, --< Area 51 >-- {{250.90054321289, 2514.453125, 200}, {250.90054321289, 2514.453125, 16.134490966797}}, --< Elhagyatott reptér >-- {{-1978.5466308594, -1629.66796875, 250}, {-1978.5466308594, -1629.66796875, 87.234451293945}}, --< Chilliad >-- {{-2091.9978027344, 2313.4880371094, 200}, {-2091.9978027344, 2313.4880371094, 25.614063262939}} --< Tierra >-- } function dropTHIS(res) if res == getThisResource() then local rTable = posTable[math.random(#posTable)] local area = getZoneName(posTable[1], posTable[2], posTable[3]) local city = getZoneName(posTable[1], posTable[2], posTable[3], true) outputChatBox(area.." >< "..city,root) end end addEventHandler("onResourceStart",root,dropTHIS) Link to comment
NeXuS™ Posted March 29, 2017 Share Posted March 29, 2017 (edited) function dropTHIS(res) if res == getThisResource() then local rTable = posTable[math.random(#posTable)] local fX, fY, fZ = unpack(rTable[1]) local sX, sY, sZ = unpack(rTable[2]) local area = getZoneName(fX, fY, fZ) local city = getZoneName(sX, sY, sZ, true) outputChatBox(area.." >< "..city,root) end end addEventHandler("onResourceStart",root,dropTHIS) Edited March 29, 2017 by NeXuS™ 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