Jump to content

Dimos7

Members
  • Posts

    1,546
  • Joined

  • Last visited

Everything posted by Dimos7

  1. you need use the event onClientRender and take local player position in each frame and draw the line
  2. Dimos7

    Help Please

    Make again that function of use the data store that he is mechanic
  3. the thing is i want to make it so when press the button to have wait for 45 seconds how to do that
  4. i tried make it like that local lscarShop = createMarker(552, -1266.90, 15.69, "cylinder", 3, 0, 70, 0, 255) local sfcarShop = createMarker(-1649, 1203.90, 6.3, "cylinder", 3, 0, 70, 0, 255) local lvcarShop = createMarker(2171.69, 1410.19, 10.19, "cylinder", 3, 0, 70, 0, 255) local lsapcarShop = createMarker(1924.5, -2242.30, 12.5, "cylinder", 3, 0, 70, 0, 255) local sfapcarShop = createMarker(-1350.19, -516.40, 13.19, "cylinder", 3, 0, 70, 0, 255) local lvapcarShop = createMarker(1292, 1359.69, 9.6, "cylinder", 3, 0, 70, 0 , 255) local baysidecarShop = createMarker(-2329, 2292.8, 3.5, "cylinder", 3, 0, 70, 0, 255) local vehiclePrices ={{445,100000}, {602,150000},{429,210000}, {536,200000}, {496,100000}, {402,2600000},{541,3000000}, {415,2500000},{589,100000}, {480, 1500000},{562, 2000000},{587,700000},{533, 700000}, {434, 500000}, {494, 2000000}, {503, 2000000}, {502, 2000000}, {579, 1200000}, {411, 2500000}, {559, 1500000}, {400, 2000000}, {500, 500000}, {603, 1000000}, {475, 400000}, {495, 700000}, {405, 1300000}, {535, 1000000}, {409, 1700000}, {560, 1500000},{506, 3000000}, {451, 3200000}, {558, 2000000}, {555, 1500000}, {477, 1000000}, {482, 1000000}, {581, 70000}, {521, 100000}, {463, 80000},{522, 200000}, {461, 100000}, {468, 80000},{592, 5000000}, {577, 4000000}, {511, 500000}, {512, 500000}, {593, 300000}, {553, 3000000}, {476, 3500000}, {519, 2000000}, {460, 1500000}, {513, 2000000}, {417, 800000},{487, 1500000},{469, 800000},{473, 200000}, {493, 500000}, {452, 700000}, {454, 200000}} function createcarShopwindow() local screenW, screenH = guiGetScreenSize() local windowW, windowH = 714, 556 local left, top = (screenW-windowW)/2, (screenH-windowH)/2 carShopwindow = guiCreateWindow(left, top, windowW, windowH, "Carshop", false) guiWindowSetMovable(carShopwindow, false) guiWindowSetSizable(carShopwindow, false) carGridList = guiCreateGridList(33, 29, 502, 333, false, carShopwindow) columnName = guiGridListAddColumn(carGridList, "Name", 0.8) columnPrice = guiGridListAddColumn(carGridList, "Price", 0.8) for i , v in ipairs (vehiclePrices) do if isElementWithinMarker(localPlayer, lscarShop) or isElementWithinMarker(localPlayer, sfcarShop) or isElementWithinMarker(localPlayer, lvcarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, v[1]) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, lsapcarShop) or isElementWithinMarker(localPlayer, sfapcarShop) or isElementWithinMarker(localPlayer, lvapcarShop) then local notAcceptableVehicles = {Automobile = true, Bike = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, v[1]) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, baysidecarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Automobile = true, Bike= true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, v[1]) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end end end buy = guiCreateButton(43, 407, 96, 49, "Buy", false, carShopwindow) preview = guiCreateButton(224, 407, 96, 49, "Preview", false, carShopwindow) cancel = guiCreateButton(373, 407, 96, 49, "Cancel", false, carShopwindow) end function showcarShopWindow() createcarShopwindow() if carShopwindow ~= nil then guiSetVisible(carShopwindow, true) else outputChatBox("An error has been ocupited!", 255, 0 , 0) end showCursor(true) end addEventHandler("onClientMarkerHit", root, showcarShopWindow) addEventHandler("onClientGUIClick", root, function() if not carShopwindow or not guiGetVisible(carShopwindow) then return end if source == buy then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local price = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2) local modelID = tonumber(modelID) local price = tonumber(price) triggerServerEvent("buyCar", root, modelID, price) guiSetVisible(carShopwindow, false) showCursor(false) elseif source == preview then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local modelID = tonumber(modelID) x, y, z = getElementPosition(localPlayer) vehicle = createVehicle(modelID, x+10, y, z - 10) if not getTickCount() < 45000 then outputChatBox("You need wait 45 seconds to see another vehicle!", 255, 0, 0) end local ptimer = setTimer(function() destroyElement(vehicle) end, 45000, 1) elseif source == cancel then guiSetVisible(carShopwindow,false) showCursor(false) end end ) function resourceStart() createBlipAttachedTo(lsapcarShop, 55, 2) createBlipAttachedTo(sfapcarShop, 55, 2) createBlipAttachedTo(lvapcarShop, 55, 2) createBlipAttachedTo(lscarShop, 55, 2) createBlipAttachedTo(sfcarShop, 55, 2) createBlipAttachedTo(lvcarShop, 55, 2) createBlipAttachedTo(baysidecarShop, 55, 2) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) that i want is when a player click preview button for 45 seocnds he can't press it again and apear a message say that you need wait seconds for see another vehicle but a get error i try compare bollen with a number
  5. i think that its shaders change but idk if you can synce so all players see that i think its for local only
  6. Hello guys i want ask a question for be sure before do it i want when i click a gui button i know that event name but i want make it so when someone click a button need wait some time i need getTickCount or setTimer for that?
  7. That it not scripting but map go to map editor open it click object a and go to type dances and you will find it
  8. local lscarShop = createMarker(552, -1266.90, 15.69, "cylinder", 3, 0, 70, 0, 255) local sfcarShop = createMarker(-1649, 1203.90, 6.3, "cylinder", 3, 0, 70, 0, 255) local lvcarShop = createMarker(2171.69, 1410.19, 10.19, "cylinder", 3, 0, 70, 0, 255) local lsapcarShop = createMarker(1924.5, -2242.30, 12.5, "cylinder", 3, 0, 70, 0, 255) local sfapcarShop = createMarker(-1350.19, -516.40, 13.19, "cylinder", 3, 0, 70, 0, 255) local lvapcarShop = createMarker(1292, 1359.69, 9.6, "cylinder", 3, 0, 70, 0 , 255) local baysidecarShop = createMarker(-2410.39, 2313.69, 4, "cylinder", 3, 0, 70, 0, 255) local vehiclePrices ={{445,100000}, {602,150000},{429,210000}, {536,200000}, {496,100000}, {402,2600000},{541,3000000}, {415,2500000},{589,100000}, {480, 1500000},{562, 2000000},{587,700000},{533, 700000}, {434, 500000}, {494, 2000000}, {503, 2000000}, {502, 2000000}, {579, 1200000}, {411, 2500000}, {559, 1500000}, {400, 2000000}, {500, 500000}, {603, 1000000}, {475, 400000}, {495, 700000}, {405, 1300000}, {535, 1000000}, {409, 1700000}, {560, 1500000},{506, 3000000}, {451, 3200000}, {558, 2000000}, {555, 1500000}, {477, 1000000}, {482, 1000000}, {581, 70000}, {521, 100000}, {463, 80000},{522, 200000}, {461, 100000}, {468, 80000},{592, 5000000}, {577, 4000000}, {511, 500000}, {512, 500000}, {593, 300000}, {553, 3000000}, {476, 3500000}, {519, 2000000}, {460, 1500000}, {513, 2000000}, {417, 800000},{487, 1500000},{469, 800000},{473, 200000}, {493, 500000}, {452, 700000}, {454, 200000}} function createcarShopwindow() local screenW, screenH = guiGetScreenSize() local windowW, windowH = 714, 556 local left, top = (screenW-windowW)/2, (screenH-windowH)/2 carShopwindow = guiCreateWindow(left, top, windowW, windowH, "Carshop", false) guiWindowSetMovable(carShopwindow, false) guiWindowSetSizable(carShopwindow, false) carGridList = guiCreateGridList(33, 29, 502, 333, false, carShopwindow) columnName = guiGridListAddColumn(carGridList, "Name", 0.8) columnPrice = guiGridListAddColumn(carGridList, "Price", 0.8) for i , v in ipairs (vehiclePrices) do if isElementWithinMarker(localPlayer, lscarShop) or isElementWithinMarker(localPlayer, sfcarShop) or isElementWithinMarker(localPlayer, lvcarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) iprint("modelID ia", guiGridListGetItemData(carGridList,guiGridListGetSelectedItem(carGridList), 1), "prices is a", guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2)) end elseif isElementWithinMarker(localPlayer, lsapcarShop) or isElementWithinMarker(localPlayer, sfapcarShop) or isElementWithinMarker(localPlayer, lvapcarShop) then local notAcceptableVehicles = {Automobile = true, Bike = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) iprint("modelID ia", guiGridListGetItemData(carGridList,guiGridListGetSelectedItem(carGridList), 1), "prices is a", guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2)) end elseif isElementWithinMarker(localPlayer, baysidecarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Automobile = true, Bike= true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) iprint("modelID ia", guiGridListGetItemData(carGridList,guiGridListGetSelectedItem(carGridList), 1), "prices is a", guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2)) end end end buy = guiCreateButton(43, 407, 96, 49, "Buy", false, carShopwindow) preview = guiCreateButton(224, 407, 96, 49, "Preview", false, carShopwindow) cancel = guiCreateButton(373, 407, 96, 49, "Cancel", false, carShopwindow) end function showcarShopWindow() createcarShopwindow() if carShopwindow ~= nil then guiSetVisible(carShopwindow, true) else outputChatBox("An error has been ocupited!", 255, 0 , 0) end showCursor(true) end addEventHandler("onClientMarkerHit", root, showcarShopWindow) addEventHandler("onClientGUIClick", root, function() if not carShopwindow or not guiGetVisible(carShopwindow) then return end if source == buy then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local price = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2) local modelID = tonumber(modelID) local price = tonumber(price) if modelID and price then triggerServerEvent("buyCar", root, modelID, price) guiSetVisible(carShopwindow, false) showCursor(false) else iprint("modelID is a", modelID, "price is a", price) end elseif source == preview then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local modelID = tonumber(modelID) if modelID then x, y, z = getElementPosition(localPlayer) vehicle = createVehicle(modelID, x, y, z - 10) else iprint("modelID is a",modelID) end local ptimer = setTimer(function(vehicle) if isElement(vehicle) then destroyElement(vehicle) end end, 45000, 1) elseif source == cancel then guiSetVisible(carShopwindow,false) showCursor(false) end end ) function resourceStart() createBlipAttachedTo(lsapcarShop, 55, 2) createBlipAttachedTo(sfapcarShop, 55, 2) createBlipAttachedTo(lvapcarShop, 55, 2) createBlipAttachedTo(lscarShop, 55, 2) createBlipAttachedTo(sfcarShop, 55, 2) createBlipAttachedTo(lvcarShop, 55, 2) createBlipAttachedTo(baysidecarShop, 55, 2) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) when try to debug it like this say modelID is a after modelID is [DUP X40 and X80]
  9. can you give me a example please
  10. hmm okay i will try to see but i think when create the gui and modelID is place in and didn't understand where exalcy to put it
  11. --client local lscarShop = createMarker(552, -1266.90, 15.69, "cylinder", 3, 0, 70, 0, 255) local sfcarShop = createMarker(-1649, 1203.90, 6.3, "cylinder", 3, 0, 70, 0, 255) local lvcarShop = createMarker(2171.69, 1410.19, 10.19, "cylinder", 3, 0, 70, 0, 255) local lsapcarShop = createMarker(1924.5, -2242.30, 12.5, "cylinder", 3, 0, 70, 0, 255) local sfapcarShop = createMarker(-1350.19, -516.40, 13.19, "cylinder", 3, 0, 70, 0, 255) local lvapcarShop = createMarker(1292, 1359.69, 9.6, "cylinder", 3, 0, 70, 0 , 255) local baysidecarShop = createMarker(-2410.39, 2313.69, 4, "cylinder", 3, 0, 70, 0, 255) local vehiclePrices ={{445,100000}, {602,150000},{429,210000}, {536,200000}, {496,100000}, {402,2600000},{541,3000000}, {415,2500000},{589,100000}, {480, 1500000},{562, 2000000},{587,700000},{533, 700000}, {434, 500000}, {494, 2000000}, {503, 2000000}, {502, 2000000}, {579, 1200000}, {411, 2500000}, {559, 1500000}, {400, 2000000}, {500, 500000}, {603, 1000000}, {475, 400000}, {495, 700000}, {405, 1300000}, {535, 1000000}, {409, 1700000}, {560, 1500000},{506, 3000000}, {451, 3200000}, {558, 2000000}, {555, 1500000}, {477, 1000000}, {482, 1000000}, {581, 70000}, {521, 100000}, {463, 80000},{522, 200000}, {461, 100000}, {468, 80000},{592, 5000000}, {577, 4000000}, {511, 500000}, {512, 500000}, {593, 300000}, {553, 3000000}, {476, 3500000}, {519, 2000000}, {460, 1500000}, {513, 2000000}, {417, 800000},{487, 1500000},{469, 800000},{473, 200000}, {493, 500000}, {452, 700000}, {454, 200000}} function createcarShopwindow() local screenW, screenH = guiGetScreenSize() local windowW, windowH = 714, 556 local left, top = (screenW-windowW)/2, (screenH-windowH)/2 carShopwindow = guiCreateWindow(left, top, windowW, windowH, "Carshop", false) guiWindowSetMovable(carShopwindow, false) guiWindowSetSizable(carShopwindow, false) carGridList = guiCreateGridList(33, 29, 502, 333, false, carShopwindow) columnName = guiGridListAddColumn(carGridList, "Name", 0.8) columnPrice = guiGridListAddColumn(carGridList, "Price", 0.8) for i , v in ipairs (vehiclePrices) do if isElementWithinMarker(localPlayer, lscarShop) or isElementWithinMarker(localPlayer, sfcarShop) or isElementWithinMarker(localPlayer, lvcarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, lsapcarShop) or isElementWithinMarker(localPlayer, sfapcarShop) or isElementWithinMarker(localPlayer, lvapcarShop) then local notAcceptableVehicles = {Automobile = true, Bike = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, baysidecarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Automobile = true, Bike= true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end end end buy = guiCreateButton(43, 407, 96, 49, "Buy", false, carShopwindow) preview = guiCreateButton(224, 407, 96, 49, "Preview", false, carShopwindow) cancel = guiCreateButton(373, 407, 96, 49, "Cancel", false, carShopwindow) end function showcarShopWindow() createcarShopwindow() if carShopwindow ~= nil then guiSetVisible(carShopwindow, true) else outputChatBox("An error has been ocupited!", 255, 0 , 0) end showCursor(true) end addEventHandler("onClientMarkerHit", root, showcarShopWindow) addEventHandler("onClientGUIClick", root, function() if not carShopwindow or not guiGetVisible(carShopwindow) then return end if source == buy then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local price = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2) local modelID = tonumber(modelID) local price = tonumber(price) if modelID and price then triggerServerEvent("buyCar", root, modelID, price) guiSetVisible(carShopwindow, false) showCursor(false) else iprint("modelID is a", modelID, "price is a", price) end elseif source == preview then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local modelID = tonumber(modelID) if modelID then x, y, z = getElementPosition(localPlayer) vehicle = createVehicle(modelID, x, y, z - 10) else iprint("modelID is a",modelID) end local ptimer = setTimer(function(vehicle) if isElement(vehicle) then destroyElement(vehicle) end end, 45000, 1) elseif source == cancel then guiSetVisible(carShopwindow,false) showCursor(false) end end ) function resourceStart() createBlipAttachedTo(lsapcarShop, 55, 2) createBlipAttachedTo(sfapcarShop, 55, 2) createBlipAttachedTo(lvapcarShop, 55, 2) createBlipAttachedTo(lscarShop, 55, 2) createBlipAttachedTo(sfcarShop, 55, 2) createBlipAttachedTo(lvcarShop, 55, 2) createBlipAttachedTo(baysidecarShop, 55, 2) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) --server function buyCar(modelID, price) if isElement(source) and source == client then local money = getPlayerMoney(source) if modelID and price then if money >= price then local x, y, z = getElementPosition(source) takePlayerMoney(source, price) createVehicle(x, y, z-10) else outputChatBox("You don't have enough money to buy this vehicle!", source, 255, 0, 0) end else iprint("modelID is a", modelID, "price is a", price) end end end addEvent("buyCar", true) addEventHandler("buyCar", root, buyCar) when try press button buy nothing happend only clsoe the window when pres preview say modelID is a nothing else
  12. local lscarShop = createMarker(552, -1266.90, 15.69, "cylinder", 3, 0, 70, 0, 255) local sfcarShop = createMarker(-1649, 1203.90, 6.3, "cylinder", 3, 0, 70, 0, 255) local lvcarShop = createMarker(2171.69, 1410.19, 10.19, "cylinder", 3, 0, 70, 0, 255) local lsapcarShop = createMarker(1924.5, -2242.30, 12.5, "cylinder", 3, 0, 70, 0, 255) local sfapcarShop = createMarker(-1350.19, -516.40, 13.19, "cylinder", 3, 0, 70, 0, 255) local lvapcarShop = createMarker(1292, 1359.69, 9.6, "cylinder", 3, 0, 70, 0 , 255) local baysidecarShop = createMarker(-2410.39, 2313.69, 4, "cylinder", 3, 0, 70, 0, 255) local vehiclePrices ={{445,100000}, {602,150000},{429,210000}, {536,200000}, {496,100000}, {402,2600000},{541,3000000}, {415,2500000},{589,100000}, {480, 1500000},{562, 2000000},{587,700000},{533, 700000}, {434, 500000}, {494, 2000000}, {503, 2000000}, {502, 2000000}, {579, 1200000}, {411, 2500000}, {559, 1500000}, {400, 2000000}, {500, 500000}, {603, 1000000}, {475, 400000}, {495, 700000}, {405, 1300000}, {535, 1000000}, {409, 1700000}, {560, 1500000},{506, 3000000}, {451, 3200000}, {558, 2000000}, {555, 1500000}, {477, 1000000}, {482, 1000000}, {581, 70000}, {521, 100000}, {463, 80000},{522, 200000}, {461, 100000}, {468, 80000},{592, 5000000}, {577, 4000000}, {511, 500000}, {512, 500000}, {593, 300000}, {553, 3000000}, {476, 3500000}, {519, 2000000}, {460, 1500000}, {513, 2000000}, {417, 800000},{487, 1500000},{469, 800000},{473, 200000}, {493, 500000}, {452, 700000}, {454, 200000}} function createcarShopwindow() local screenW, screenH = guiGetScreenSize() local windowW, windowH = 714, 556 local left, top = (screenW-windowW)/2, (screenH-windowH)/2 carShopwindow = guiCreateWindow(left, top, windowW, windowH, "Carshop", false) guiWindowSetMovable(carShopwindow, false) guiWindowSetSizable(carShopwindow, false) carGridList = guiCreateGridList(33, 29, 502, 333, false, carShopwindow) columnName = guiGridListAddColumn(carGridList, "Name", 0.8) columnPrice = guiGridListAddColumn(carGridList, "Price", 0.8) for i , v in ipairs (vehiclePrices) do if isElementWithinMarker(localPlayer, lscarShop) or isElementWithinMarker(localPlayer, sfcarShop) or isElementWithinMarker(localPlayer, lvcarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, lsapcarShop) or isElementWithinMarker(localPlayer, sfapcarShop) or isElementWithinMarker(localPlayer, lvapcarShop) then local notAcceptableVehicles = {Automobile = true, Bike = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, baysidecarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Automobile = true, Bike= true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end end end buy = guiCreateButton(43, 407, 96, 49, "Buy", false, carShopwindow) preview = guiCreateButton(224, 407, 96, 49, "Preview", false, carShopwindow) cancel = guiCreateButton(373, 407, 96, 49, "Cancel", false, carShopwindow) end function showcarShopWindow() createcarShopwindow() if carShopwindow ~= nil then guiSetVisible(carShopwindow, true) else outputChatBox("An error has been ocupited!", 255, 0 , 0) end showCursor(true) end addEventHandler("onClientMarkerHit", root, showcarShopWindow) addEventHandler("onClientGUIClick", root, function() if not carShopwindow or not guiGetVisible(carShopwindow) then return end if source == buy then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) price = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2) triggerServerEvent("buyCar", root, tonumber(modelID), tonumber(price)) guiSetVisible(carShopwindow, false) showCursor(false) elseif source == preview then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end modelID=tonumber(modelID) if modelID then x, y, z = getElementPosition(localPlayer) vehicle = createVehicle(modelID, x, y, z - 10) else iprint("modelID is a",modelID) end local ptimer = setTimer(function() destroyElement(vehicle) end, 45000, 1) elseif source == cancel then guiSetVisible(carShopwindow,false) showCursor(false) end end ) function resourceStart() createBlipAttachedTo(lsapcarShop, 55, 2) createBlipAttachedTo(sfapcarShop, 55, 2) createBlipAttachedTo(lvapcarShop, 55, 2) createBlipAttachedTo(lscarShop, 55, 2) createBlipAttachedTo(sfcarShop, 55, 2) createBlipAttachedTo(lvcarShop, 55, 2) createBlipAttachedTo(baysidecarShop, 55, 2) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) it print the modelID is a and nothing else
  13. you can change the type to share i think
  14. local lscarShop = createMarker(552, -1266.90, 15.69, "cylinder", 3, 0, 70, 0, 255) local sfcarShop = createMarker(-1649, 1203.90, 6.3, "cylinder", 3, 0, 70, 0, 255) local lvcarShop = createMarker(2171.69, 1410.19, 10.19, "cylinder", 3, 0, 70, 0, 255) local lsapcarShop = createMarker(1924.5, -2242.30, 12.5, "cylinder", 3, 0, 70, 0, 255) local sfapcarShop = createMarker(-1350.19, -516.40, 13.19, "cylinder", 3, 0, 70, 0, 255) local lvapcarShop = createMarker(1292, 1359.69, 9.6, "cylinder", 3, 0, 70, 0 , 255) local baysidecarShop = createMarker(-2410.39, 2313.69, 4, "cylinder", 3, 0, 70, 0, 255) local vehiclePrices ={{445,100000}, {602,150000},{429,210000}, {536,200000}, {496,100000}, {402,2600000},{541,3000000}, {415,2500000},{589,100000}, {480, 1500000},{562, 2000000},{587,700000},{533, 700000}, {434, 500000}, {494, 2000000}, {503, 2000000}, {502, 2000000}, {579, 1200000}, {411, 2500000}, {559, 1500000}, {400, 2000000}, {500, 500000}, {603, 1000000}, {475, 400000}, {495, 700000}, {405, 1300000}, {535, 1000000}, {409, 1700000}, {560, 1500000},{506, 3000000}, {451, 3200000}, {558, 2000000}, {555, 1500000}, {477, 1000000}, {482, 1000000}, {581, 70000}, {521, 100000}, {463, 80000},{522, 200000}, {461, 100000}, {468, 80000},{592, 5000000}, {577, 4000000}, {511, 500000}, {512, 500000}, {593, 300000}, {553, 3000000}, {476, 3500000}, {519, 2000000}, {460, 1500000}, {513, 2000000}, {417, 800000},{487, 1500000},{469, 800000},{473, 200000}, {493, 500000}, {452, 700000}, {454, 200000}} function createcarShopwindow() local screenW, screenH = guiGetScreenSize() local windowW, windowH = 714, 556 local left, top = (screenW-windowW)/2, (screenH-windowH)/2 carShopwindow = guiCreateWindow(left, top, windowW, windowH, "Carshop", false) guiWindowSetMovable(carShopwindow, false) guiWindowSetSizable(carShopwindow, false) carGridList = guiCreateGridList(33, 29, 502, 333, false, carShopwindow) columnName = guiGridListAddColumn(carGridList, "Name", 0.8) columnPrice = guiGridListAddColumn(carGridList, "Price", 0.8) for i , v in ipairs (vehiclePrices) do if isElementWithinMarker(localPlayer, lscarShop) or isElementWithinMarker(localPlayer, sfcarShop) or isElementWithinMarker(localPlayer, lvcarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, lsapcarShop) or isElementWithinMarker(localPlayer, sfapcarShop) or isElementWithinMarker(localPlayer, lvapcarShop) then local notAcceptableVehicles = {Automobile = true, Bike = true, Boat = true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, baysidecarShop) then local notAcceptableVehicles = {Plane = true, Helicopter = true, Automobile = true, Bike= true} local vehicleType = getVehicleType(v[1]) if not notAcceptableVehicles[vehicleType] then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end end end buy = guiCreateButton(43, 407, 96, 49, "Buy", false, carShopwindow) preview = guiCreateButton(224, 407, 96, 49, "Preview", false, carShopwindow) cancel = guiCreateButton(373, 407, 96, 49, "Cancel", false, carShopwindow) end function showcarShopWindow() createcarShopwindow() if carShopwindow ~= nil then guiSetVisible(carShopwindow, true) else outputChatBox("An error has been ocupited!", 255, 0 , 0) end showCursor(true) end addEventHandler("onClientMarkerHit", root, showcarShopWindow) addEventHandler("onClientGUIClick", root, function() if not carShopwindow or not guiGetVisible(carShopwindow) then return end if source == buy then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local price = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2) triggerServerEvent("buyCar", root, tonumber(modelID), tonumber(price)) guiSetVisible(carShopwindow, false) showCursor(false) elseif source == preview then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local x, y, z = getElementPosition(localPlayer) local vehicle = createVehicle(tonumber(modelID), x, y, z - 10) local ptimer = setTimer(function() destroyElement(vehicle) end, 45000, 1) elseif source == cancel then guiSetVisible(carShopwindow,false) showCursor(false) end end ) function resourceStart() createBlipAttachedTo(lsapcarShop, 55, 2) createBlipAttachedTo(sfapcarShop, 55, 2) createBlipAttachedTo(lvapcarShop, 55, 2) createBlipAttachedTo(lscarShop, 55, 2) createBlipAttachedTo(sfcarShop, 55, 2) createBlipAttachedTo(lvcarShop, 55, 2) createBlipAttachedTo(baysidecarShop, 55, 2) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) ty mate for advice now i have another problem when try to create the Vehicle say it take nil not number
  15. apear the model i don't want it in that marker for exacle i made it so when a vehicle is plane dont add row but still have it
  16. on markers apear the vehicle type i don't want to apear but still there be
  17. local lscarShop = createMarker(552, -1266.90, 15.69, "cylinder", 3, 0, 70, 0, 255) local sfcarShop = createMarker(-1649, 1203.90, 6.3, "cylinder", 3, 0, 70, 0, 255) local lvcarShop = createMarker(2171.69, 1410.19, 10.19, "cylinder", 3, 0, 70, 0, 255) local lsapcarShop = createMarker(1924.5, -2242.30, 12.5, "cylinder", 3, 0, 70, 0, 255) local sfapcarShop = createMarker(-1350.19, -516.40, 13.19, "cylinder", 3, 0, 70, 0, 255) local lvapcarShop = createMarker(1292, 1359.69, 9.6, "cylinder", 3, 0, 70, 0 , 255) local baysidecarShop = createMarker(-2410.39, 2313.69, 4, "cylinder", 3, 0, 70, 0, 255) local vehiclePrices ={{445,100000}, {602,150000},{429,210000}, {536,200000}, {496,100000}, {402,2600000},{541,3000000}, {415,2500000},{589,100000}, {480, 1500000},{562, 2000000},{587,700000},{533, 700000}, {434, 500000}, {494, 2000000}, {503, 2000000}, {502, 2000000}, {579, 1200000}, {411, 2500000}, {559, 1500000}, {400, 2000000}, {500, 500000}, {603, 1000000}, {475, 400000}, {495, 700000}, {405, 1300000}, {535, 1000000}, {409, 1700000}, {560, 1500000},{506, 3000000}, {451, 3200000}, {558, 2000000}, {555, 1500000}, {477, 1000000}, {482, 1000000}, {581, 70000}, {521, 100000}, {463, 80000},{522, 200000}, {461, 100000}, {468, 80000},{592, 5000000}, {577, 4000000}, {511, 500000}, {512, 500000}, {593, 300000}, {553, 3000000}, {476, 3500000}, {519, 2000000}, {460, 1500000}, {513, 2000000}, {417, 800000},{487, 1500000},{469, 800000}, {473, 200000}, {493, 500000}, {452, 700000}, {454, 200000}} function createcarShopwindow() local screenW, screenH = guiGetScreenSize() local windowW, windowH = 714, 556 local left, top = (screenW-windowW)/2, (screenH-windowH)/2 local carShopwindow = guiCreateWindow(left, top, windowW, windowH, "Carshop", false) guiWindowSetMovable(carShopwindow, false) guiWindowSetSizable(carShopwindow, false) local carGridList = guiCreateGridList(33, 29, 502, 333, false, carShopwindow) local columnName = guiGridListAddColumn(carGridList, "Name", 0.8) local columnPrice = guiGridListAddColumn(carGridList, "Price", 0.8) for i, v in ipairs(vehiclePrices) do if isElementWithinMarker(localPlayer, lscarShop) or isElementWithinMarker(localPlayer, sfcarShop) or isElementWithinMarker(localPlayer, lvcarShop) then if getVehicleType(v[1]) ~= "Plane" or getVehicleType(v[1]) ~= "Helicopter" or getVehicleType(v[1]) ~= "Boat" then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, lsapcarShop) or isElementWithinMarker(localPlayer, sfapcarShop) or isElementWithinMarker(localPlayer, lvapcarShop) then if getVehicleType(v[1]) ~="Automobile" or getVehicleType(v[1]) ~="Bike" or getVehicleType(v[1])~= "Boat" then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end elseif isElementWithinMarker(localPlayer, baysidecarShop) then if getVehicleType(v[1]) ~="Automobile" or getVehicleType(v[1]) ~="Bike" or getVehicleType(v[1]) ~= "Plane" or getVehicleType(v[1]) ~="Helicopter" then local row = guiGridListAddRow(carGridList) local name = getVehicleNameFromModel(v[1]) guiGridListSetItemText(carGridList, row, columnName, name, false, false) guiGridListSetItemData(carGridList, row, columnName, name) guiGridListSetItemText(carGridList, row, columnPrice, v[2].." $", false, false) guiGridListSetItemData(carGridList, row, columnPrice, v[2]) end end end local buy = guiCreateButton(43, 407, 96, 49, "Buy", false, carShopwindow) local preview = guiCreateButton(224, 407, 96, 49, "Preview", false, carShopwindow) local cancel = guiCreateButton(373, 407, 96, 49, "Cancel", false, carShopwindow) end function showcarShopWindow() createcarShopwindow() if carShopwindow ~= nil then guiSetVisible(carShopwindow, true) else outputChatBox("An error has been ocupited!", 255, 0 , 0) end showCursor(true) end addEventHandler("onClientMarkerHit", root, showcarShopWindow) function carshop_buyvehicle() if not carShopwindow or not guiGetVisible(carShopwindow) then return end if source == buy then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local price = tonumber(guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 2)) triggerServerEvent("buyCar", root, localPlayer, modelID, price) guiSetVisible(carShopwindow, false) showCursor(false) elseif source == preview then if guiGridListGetSelectedItem(carGridList) == -1 then outputChatBox("Select one vehicle!", 255, 0, 0) return end local modelID = guiGridListGetItemData(carGridList, guiGridListGetSelectedItem(carGridList), 1) local ptimer = setTimer(function() local x, y, z = getElementPosition(localPlayer) local vehicle = createVehicle(modelID, x, y, z - 10) end, 5000, 1) if isTimer(ptimer) then destoryElement(vehicle) elseif source == cancel then guiSetVisible(carShopwindow,false) showCursor(false) end end addEventHandler("onClientGUIClick", root, carshop_buyvehicle) function resourceStart() createBlipAttachedTo(lsapcarShop, 55, 2) createBlipAttachedTo(sfapcarShop, 55, 2) createBlipAttachedTo(lvapcarShop, 55, 2) createBlipAttachedTo(lscarShop, 55, 2) createBlipAttachedTo(sfcarShop, 55, 2) createBlipAttachedTo(lvcarShop, 55, 2) createBlipAttachedTo(baysidecarShop, 55, 2) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) the window show up put say the chat An error has been ocuiped please help me also appear they vehicle types i don't want to apear in that markers
  18. Ty I don't believe I made such mistake
  19. local xmlFileName = "account.xml" function appendSavedData(parameter, value) local xmlFile = xmlLoadFile(xmlFileName) if not (xmlFile) then xmlFile = xmlCreateFile(xmlFileName, "gang") end local xmlNode = xmlFindChild(xmlFile, parameter, 0) if not (xmlNode) then xmlNode = xmlCreateChild(xmlFile, parameter) end xmlNodeSetValue(xmlNode, value) xmlSaveFile(xmlFile) xmlUnloadFile(xmlFile) end function loadSavedData(parameter, value) local xmlRoot = xmlLoadFile(xmlFileName) if (xmlRoot) then local xmlNode = xmlFindChild(xmlRoot, parameter, 0) if (xmlNode) then return xmlNodeGetValue(xmlNode) end end end function createGang(player,name, r, g, b) local money = getPlayerMoney(player) local color = loadSavedData("Color", r..g..b) if money >= 250000 then if type(name) ~= "string" then if not color then if tonumber(r) >= 0 or <= 255 and tonumber(g) >= 0 or <=255 and tonumber(b) >= 0 or <= 255 then takePlayerMoney(player, 250000) gang = createTeam(name ,r ,g, b) setPlayerTeam(player gang) nick = getPlayerName(player) appendSavedData("Name", tostring(name)) appendSavedData("Color", r..g..b) appendSavedData("Rank", "Leader") appendSavedData("Founder", nick) appendSavedData("XP", 0) else outputChatBox("The r, g, b must be 0 to 255!", player, 255, 0, 0) end else outputChatBox("That color already exist to a gang choose another color!", player, 255,0, 0) end else outputChatBox("Use : /create name , r, g, b for create a gang!", player, 255, 0, 0) end else outputChatBox("You don't have enough money for this (250000$) required!", player, 255, 0, 0) end end addCommandHandler("create", createGang) the error is on line 32 unexpected simpole near <=
  20. no need that <meta> <script src="client.lua" type="client" cache="false"/> </meta
  21. if understand correctly you want to apear where are you on the radar?
  22. go close to that code and you see quite this press it and copy the code
×
×
  • Create New...