Spice Posted July 5, 2015 Share Posted July 5, 2015 local markers = { {296.20737, -37.42688, 1001.51563, 1}, {312.10248, -165.32639, 999.60101, 6}, {288.38971, -106.55548, 1001.51563, 6}, {277.55972, -37.21804, 1001.60779, 1}, {292.98145, -103.60979, 1008.27344, 6}, {293.52847, -80.34721, 1001.51563, 4}, {293.24643, -115.71572, 1008.27344, 4}, {312.62921, -149.50658, 1007.67291, 6}, {308.24817, -140.86179, 999.60156, 7}, } function markerscreate () for index, value in ipairs ( markers ) do local mx,my,mz,mi = unpack( markers[index] ) mar = createMarker (mx, my, mz-1, "cylinder", 1.5, 255, 255, 255, 180) setElementInterior (mar, mi, mx, my, mz-1) end end addEventHandler( "onClientResourceStart", resourceRoot, markerscreate ) function markerhit() if ( source == mar) then guiSetVisible (ammowin, true) showCursor (true) end end addEventHandler( "onClientMarkerHit", resourceRoot, markerhit ) ammowin = guiCreateWindow(351, 132, 590, 482, "Ammunations Shop", false) guiWindowSetSizable(ammowin, false) pistol = guiCreateButton(10, 27, 116, 40, "Pistol\n10,000 $", false, ammowin) pistolammo = guiCreateButton(162, 27, 116, 40, "Pistol Ammo\n5$ / ammo", false, ammowin) Desert = guiCreateButton(10, 77, 116, 40, "Desert Eagle\n25,000 $", false, ammowin) desertammo = guiCreateButton(162, 77, 116, 40, "Desert Eagle Ammo\n7$ / ammo", false, ammowin) shotgun = guiCreateButton(10, 126, 116, 40, "Shotgun\n40,000 $", false, ammowin) shotgunammo = guiCreateButton(162, 126, 116, 40, "Shotgun Ammo\n9$ / ammo", false, ammowin) sawnoffshotgun = guiCreateButton(10, 176, 116, 40, "Sawn-Off Shotgun\n35,000 $", false, ammowin) swanshotgunammo = guiCreateButton(162, 176, 116, 40, "Sawn-Off Ammo\n8$ / ammo", false, ammowin) combatshotgun = guiCreateButton(10, 226, 116, 40, "Combat Shotgun\n40,000 $", false, ammowin) combatammo = guiCreateButton(162, 226, 116, 40, "Combat Ammo\n9$ / ammo", false, ammowin) Uzi = guiCreateButton(10, 276, 116, 40, "Uzi\n30,000 $", false, ammowin) uziammo = guiCreateButton(162, 276, 116, 40, "Uzi Ammo\n6$ / ammo", false, ammowin) MP5 = guiCreateButton(10, 326, 116, 40, "MP5\n30,000 $", false, ammowin) tec9ammo = guiCreateButton(162, 376, 116, 40, "TEC-9 Ammo\n6$ / ammo", false, ammowin) TEC9 = guiCreateButton(10, 376, 116, 40, "TEC-9\n25,000 $", false, ammowin) ak47 = guiCreateButton(303, 27, 116, 40, "AK-47\n60,000 $", false, ammowin) m4 = guiCreateButton(303, 77, 116, 40, "M4\n60,000 $", false, ammowin) countryrifle = guiCreateButton(303, 127, 116, 40, "Country Rifle\n70,000 $", false, ammowin) sniperrifle = guiCreateButton(303, 176, 116, 40, "Sniper Rifle\n90,000 $", false, ammowin) miniigun = guiCreateButton(303, 226, 116, 40, "Minigun\n1,000,000 $", false, ammowin) MP5ammo = guiCreateButton(162, 326, 116, 40, "MP5 Ammo\n7$ / ammo", false, ammowin) ak47ammo = guiCreateButton(443, 27, 116, 40, "AK-47 Ammo\n11$ / ammo", false, ammowin) m4ammo = guiCreateButton(443, 76, 116, 40, "M4 Ammo\n11$ / ammo", false, ammowin) countryrifleammo = guiCreateButton(443, 127, 116, 40, "Country Rifle Ammo\n15$ / ammo", false, ammowin) sniperrifleammo = guiCreateButton(443, 177, 116, 40, "Sniper Rifle Ammo\n15$ / ammo", false, ammowin) minigunammo = guiCreateButton(443, 227, 116, 40, "Minigun Ammo\n3$ / ammo", false, ammowin) close = guiCreateButton(152, 426, 268, 34, "Close", false, ammowin) grenade = guiCreateButton(303, 326, 266, 40, "Grenade\n1,000$ / grenade", false, ammowin) teargas = guiCreateButton(303, 277, 266, 39, "Tear Gas\n1,100$ / tear gas", false, ammowin) satchel = guiCreateButton(303, 376, 266, 40, "Satchel\n1,000 $ / satchel", false, ammowin) guiSetVisible (ammowin, false) why the gui don't get shown ? Link to comment
LaCosTa Posted July 5, 2015 Share Posted July 5, 2015 Try this out . local markers = { {296.20737, -37.42688, 1001.51563, 1}, {312.10248, -165.32639, 999.60101, 6}, {288.38971, -106.55548, 1001.51563, 6}, {277.55972, -37.21804, 1001.60779, 1}, {292.98145, -103.60979, 1008.27344, 6}, {293.52847, -80.34721, 1001.51563, 4}, {293.24643, -115.71572, 1008.27344, 4}, {312.62921, -149.50658, 1007.67291, 6}, {308.24817, -140.86179, 999.60156, 7}, } ammowin = guiCreateWindow(351, 132, 590, 482, "Ammunations Shop", false) guiWindowSetSizable(ammowin, false) pistol = guiCreateButton(10, 27, 116, 40, "Pistol\n10,000 $", false, ammowin) pistolammo = guiCreateButton(162, 27, 116, 40, "Pistol Ammo\n5$ / ammo", false, ammowin) Desert = guiCreateButton(10, 77, 116, 40, "Desert Eagle\n25,000 $", false, ammowin) desertammo = guiCreateButton(162, 77, 116, 40, "Desert Eagle Ammo\n7$ / ammo", false, ammowin) shotgun = guiCreateButton(10, 126, 116, 40, "Shotgun\n40,000 $", false, ammowin) shotgunammo = guiCreateButton(162, 126, 116, 40, "Shotgun Ammo\n9$ / ammo", false, ammowin) sawnoffshotgun = guiCreateButton(10, 176, 116, 40, "Sawn-Off Shotgun\n35,000 $", false, ammowin) swanshotgunammo = guiCreateButton(162, 176, 116, 40, "Sawn-Off Ammo\n8$ / ammo", false, ammowin) combatshotgun = guiCreateButton(10, 226, 116, 40, "Combat Shotgun\n40,000 $", false, ammowin) combatammo = guiCreateButton(162, 226, 116, 40, "Combat Ammo\n9$ / ammo", false, ammowin) Uzi = guiCreateButton(10, 276, 116, 40, "Uzi\n30,000 $", false, ammowin) uziammo = guiCreateButton(162, 276, 116, 40, "Uzi Ammo\n6$ / ammo", false, ammowin) MP5 = guiCreateButton(10, 326, 116, 40, "MP5\n30,000 $", false, ammowin) tec9ammo = guiCreateButton(162, 376, 116, 40, "TEC-9 Ammo\n6$ / ammo", false, ammowin) TEC9 = guiCreateButton(10, 376, 116, 40, "TEC-9\n25,000 $", false, ammowin) ak47 = guiCreateButton(303, 27, 116, 40, "AK-47\n60,000 $", false, ammowin) m4 = guiCreateButton(303, 77, 116, 40, "M4\n60,000 $", false, ammowin) countryrifle = guiCreateButton(303, 127, 116, 40, "Country Rifle\n70,000 $", false, ammowin) sniperrifle = guiCreateButton(303, 176, 116, 40, "Sniper Rifle\n90,000 $", false, ammowin) miniigun = guiCreateButton(303, 226, 116, 40, "Minigun\n1,000,000 $", false, ammowin) MP5ammo = guiCreateButton(162, 326, 116, 40, "MP5 Ammo\n7$ / ammo", false, ammowin) ak47ammo = guiCreateButton(443, 27, 116, 40, "AK-47 Ammo\n11$ / ammo", false, ammowin) m4ammo = guiCreateButton(443, 76, 116, 40, "M4 Ammo\n11$ / ammo", false, ammowin) countryrifleammo = guiCreateButton(443, 127, 116, 40, "Country Rifle Ammo\n15$ / ammo", false, ammowin) sniperrifleammo = guiCreateButton(443, 177, 116, 40, "Sniper Rifle Ammo\n15$ / ammo", false, ammowin) minigunammo = guiCreateButton(443, 227, 116, 40, "Minigun Ammo\n3$ / ammo", false, ammowin) close = guiCreateButton(152, 426, 268, 34, "Close", false, ammowin) grenade = guiCreateButton(303, 326, 266, 40, "Grenade\n1,000$ / grenade", false, ammowin) teargas = guiCreateButton(303, 277, 266, 39, "Tear Gas\n1,100$ / tear gas", false, ammowin) satchel = guiCreateButton(303, 376, 266, 40, "Satchel\n1,000 $ / satchel", false, ammowin) guiSetVisible (ammowin, false) function markerscreate () for index, value in ipairs ( markers ) do local mx,my,mz,mi = unpack( markers[index] ) mar = createMarker (mx, my, mz-1, "cylinder", 1.5, 255, 255, 255, 180) setElementInterior (mar, mi, mx, my, mz-1) end end addEventHandler( "onClientResourceStart", resourceRoot, markerscreate ) function markerhit(hitElement) if getElementType(hitElement) == "player" and not isPedInVehicle(hitElement) then guiSetVisible (ammowin, true) showCursor (true) end end addEventHandler( "onClientMarkerHit", mar, markerhit ) Link to comment
xXMADEXx Posted July 5, 2015 Share Posted July 5, 2015 Try using this: local markers = { {296.20737, -37.42688, 1001.51563, 1}, {312.10248, -165.32639, 999.60101, 6}, {288.38971, -106.55548, 1001.51563, 6}, {277.55972, -37.21804, 1001.60779, 1}, {292.98145, -103.60979, 1008.27344, 6}, {293.52847, -80.34721, 1001.51563, 4}, {293.24643, -115.71572, 1008.27344, 4}, {312.62921, -149.50658, 1007.67291, 6}, {308.24817, -140.86179, 999.60156, 7}, } function markerscreate () for index, value in ipairs ( markers ) do local mx,my,mz,mi = unpack( markers[index] ) mar = createMarker (mx, my, mz-1, "cylinder", 1.5, 255, 255, 255, 180) setElementInterior (mar, mi, mx, my, mz-1) addEventHandler( "onClientMarkerHit", mar, markerhit ) end end addEventHandler( "onClientResourceStart", resourceRoot, markerscreate ) function markerhit( p ) if ( source == mar and p == localPlayer ) then guiSetVisible (ammowin, true) showCursor (true) end end ammowin = guiCreateWindow(351, 132, 590, 482, "Ammunations Shop", false) guiWindowSetSizable(ammowin, false) pistol = guiCreateButton(10, 27, 116, 40, "Pistol\n10,000 $", false, ammowin) pistolammo = guiCreateButton(162, 27, 116, 40, "Pistol Ammo\n5$ / ammo", false, ammowin) Desert = guiCreateButton(10, 77, 116, 40, "Desert Eagle\n25,000 $", false, ammowin) desertammo = guiCreateButton(162, 77, 116, 40, "Desert Eagle Ammo\n7$ / ammo", false, ammowin) shotgun = guiCreateButton(10, 126, 116, 40, "Shotgun\n40,000 $", false, ammowin) shotgunammo = guiCreateButton(162, 126, 116, 40, "Shotgun Ammo\n9$ / ammo", false, ammowin) sawnoffshotgun = guiCreateButton(10, 176, 116, 40, "Sawn-Off Shotgun\n35,000 $", false, ammowin) swanshotgunammo = guiCreateButton(162, 176, 116, 40, "Sawn-Off Ammo\n8$ / ammo", false, ammowin) combatshotgun = guiCreateButton(10, 226, 116, 40, "Combat Shotgun\n40,000 $", false, ammowin) combatammo = guiCreateButton(162, 226, 116, 40, "Combat Ammo\n9$ / ammo", false, ammowin) Uzi = guiCreateButton(10, 276, 116, 40, "Uzi\n30,000 $", false, ammowin) uziammo = guiCreateButton(162, 276, 116, 40, "Uzi Ammo\n6$ / ammo", false, ammowin) MP5 = guiCreateButton(10, 326, 116, 40, "MP5\n30,000 $", false, ammowin) tec9ammo = guiCreateButton(162, 376, 116, 40, "TEC-9 Ammo\n6$ / ammo", false, ammowin) TEC9 = guiCreateButton(10, 376, 116, 40, "TEC-9\n25,000 $", false, ammowin) ak47 = guiCreateButton(303, 27, 116, 40, "AK-47\n60,000 $", false, ammowin) m4 = guiCreateButton(303, 77, 116, 40, "M4\n60,000 $", false, ammowin) countryrifle = guiCreateButton(303, 127, 116, 40, "Country Rifle\n70,000 $", false, ammowin) sniperrifle = guiCreateButton(303, 176, 116, 40, "Sniper Rifle\n90,000 $", false, ammowin) miniigun = guiCreateButton(303, 226, 116, 40, "Minigun\n1,000,000 $", false, ammowin) MP5ammo = guiCreateButton(162, 326, 116, 40, "MP5 Ammo\n7$ / ammo", false, ammowin) ak47ammo = guiCreateButton(443, 27, 116, 40, "AK-47 Ammo\n11$ / ammo", false, ammowin) m4ammo = guiCreateButton(443, 76, 116, 40, "M4 Ammo\n11$ / ammo", false, ammowin) countryrifleammo = guiCreateButton(443, 127, 116, 40, "Country Rifle Ammo\n15$ / ammo", false, ammowin) sniperrifleammo = guiCreateButton(443, 177, 116, 40, "Sniper Rifle Ammo\n15$ / ammo", false, ammowin) minigunammo = guiCreateButton(443, 227, 116, 40, "Minigun Ammo\n3$ / ammo", false, ammowin) close = guiCreateButton(152, 426, 268, 34, "Close", false, ammowin) grenade = guiCreateButton(303, 326, 266, 40, "Grenade\n1,000$ / grenade", false, ammowin) teargas = guiCreateButton(303, 277, 266, 39, "Tear Gas\n1,100$ / tear gas", false, ammowin) satchel = guiCreateButton(303, 376, 266, 40, "Satchel\n1,000 $ / satchel", false, ammowin) guiSetVisible (ammowin, false) Link to comment
DNL291 Posted July 5, 2015 Share Posted July 5, 2015 Try this: local markers = { {296.20737, -37.42688, 1001.51563, 1}, {312.10248, -165.32639, 999.60101, 6}, {288.38971, -106.55548, 1001.51563, 6}, {277.55972, -37.21804, 1001.60779, 1}, {292.98145, -103.60979, 1008.27344, 6}, {293.52847, -80.34721, 1001.51563, 4}, {293.24643, -115.71572, 1008.27344, 4}, {312.62921, -149.50658, 1007.67291, 6}, {308.24817, -140.86179, 999.60156, 7}, } addEventHandler( "onClientResourceStart", resourceRoot, function() ammowin = guiCreateWindow(351, 132, 590, 482, "Ammunations Shop", false) guiWindowSetSizable(ammowin, false) pistol = guiCreateButton(10, 27, 116, 40, "Pistol\n10,000 $", false, ammowin) pistolammo = guiCreateButton(162, 27, 116, 40, "Pistol Ammo\n5$ / ammo", false, ammowin) Desert = guiCreateButton(10, 77, 116, 40, "Desert Eagle\n25,000 $", false, ammowin) desertammo = guiCreateButton(162, 77, 116, 40, "Desert Eagle Ammo\n7$ / ammo", false, ammowin) shotgun = guiCreateButton(10, 126, 116, 40, "Shotgun\n40,000 $", false, ammowin) shotgunammo = guiCreateButton(162, 126, 116, 40, "Shotgun Ammo\n9$ / ammo", false, ammowin) sawnoffshotgun = guiCreateButton(10, 176, 116, 40, "Sawn-Off Shotgun\n35,000 $", false, ammowin) swanshotgunammo = guiCreateButton(162, 176, 116, 40, "Sawn-Off Ammo\n8$ / ammo", false, ammowin) combatshotgun = guiCreateButton(10, 226, 116, 40, "Combat Shotgun\n40,000 $", false, ammowin) combatammo = guiCreateButton(162, 226, 116, 40, "Combat Ammo\n9$ / ammo", false, ammowin) Uzi = guiCreateButton(10, 276, 116, 40, "Uzi\n30,000 $", false, ammowin) uziammo = guiCreateButton(162, 276, 116, 40, "Uzi Ammo\n6$ / ammo", false, ammowin) MP5 = guiCreateButton(10, 326, 116, 40, "MP5\n30,000 $", false, ammowin) tec9ammo = guiCreateButton(162, 376, 116, 40, "TEC-9 Ammo\n6$ / ammo", false, ammowin) TEC9 = guiCreateButton(10, 376, 116, 40, "TEC-9\n25,000 $", false, ammowin) ak47 = guiCreateButton(303, 27, 116, 40, "AK-47\n60,000 $", false, ammowin) m4 = guiCreateButton(303, 77, 116, 40, "M4\n60,000 $", false, ammowin) countryrifle = guiCreateButton(303, 127, 116, 40, "Country Rifle\n70,000 $", false, ammowin) sniperrifle = guiCreateButton(303, 176, 116, 40, "Sniper Rifle\n90,000 $", false, ammowin) miniigun = guiCreateButton(303, 226, 116, 40, "Minigun\n1,000,000 $", false, ammowin) MP5ammo = guiCreateButton(162, 326, 116, 40, "MP5 Ammo\n7$ / ammo", false, ammowin) ak47ammo = guiCreateButton(443, 27, 116, 40, "AK-47 Ammo\n11$ / ammo", false, ammowin) m4ammo = guiCreateButton(443, 76, 116, 40, "M4 Ammo\n11$ / ammo", false, ammowin) countryrifleammo = guiCreateButton(443, 127, 116, 40, "Country Rifle Ammo\n15$ / ammo", false, ammowin) sniperrifleammo = guiCreateButton(443, 177, 116, 40, "Sniper Rifle Ammo\n15$ / ammo", false, ammowin) minigunammo = guiCreateButton(443, 227, 116, 40, "Minigun Ammo\n3$ / ammo", false, ammowin) close = guiCreateButton(152, 426, 268, 34, "Close", false, ammowin) grenade = guiCreateButton(303, 326, 266, 40, "Grenade\n1,000$ / grenade", false, ammowin) teargas = guiCreateButton(303, 277, 266, 39, "Tear Gas\n1,100$ / tear gas", false, ammowin) satchel = guiCreateButton(303, 376, 266, 40, "Satchel\n1,000 $ / satchel", false, ammowin) guiSetVisible (ammowin, false) end ) local mar = nil function markerscreate () for index, value in ipairs ( markers ) do local mx,my,mz,mi = unpack( markers[index] ) mar = createMarker (mx, my, mz-1, "cylinder", 1.5, 255, 255, 255, 180) setElementInterior (mar, mi, mx, my, mz-1) addEventHandler( "onClientMarkerHit", mar, function ( p ) if ( p == localPlayer ) then guiSetVisible (ammowin, true) showCursor (true) end end ) end end addEventHandler( "onClientResourceStart", resourceRoot, markerscreate ) And make sure there is no errors in debug. 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