Jump to content

DynamicBan

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by DynamicBan

  1. Nope everything works fine, thnx.
  2. Works fine, thnx once again.
  3. Same debug I removed (), but what do you mean by placing it under the robMarker.
  4. Done that but now im getting this debug
  5. Uh ye 1 more. When the player enters the robmarker he gets an object attached to him. Atleast that how it should work but im getting this error Line 44 @ ss, the code below line 19 function createBlips ( ) local vehicle = getElementModel ( source ) if ( getElementModel ( source ) == 498 ) then loc = math.random ( #locations ) robMarker = createMarker ( locations[loc][1], locations[loc][2], locations[loc][3], "cylinder", 1.5, 255, 255, 255, 150 ) setElementInterior ( robMarker, locations[loc][7] ) startBlip = createBlip ( locations[loc][4], locations[loc][5], locations[loc][6], 32 ) end end addEventHandler ("onClientVehicleEnter", getRootElement (), createBlips ) function hitElement ( hitPlayer, matchingDimension ) if ( hitPlayer ) then local x, y, z = getElementPosition ( hitPlayer ) local object = createObject ( 1429, x, y, z-5 ) attachElements ( object, hitPlayer, 0, 0.5, 0 ) end end addEventHandler ( "onClientMarkerHit", robMarker (), hitElement )
  6. Thanks again, its working now.
  7. getting those debug messages again local locations = { -- rob markers for EastLosSantos house --House EastLosSantos blip { 2341.66602, -1186.37573, 1026.97656, 5, 2351.9699707031, -1169.8599853516, 28.035507202148 }, { 2348.66870, -1186.74658, 1026.97656, 5, 2351.9699707031, -1169.8599853516, 28.035507202148 }, { 2322.23877, -1183.75879, 1026.97656, 5, 2351.9699707031, -1169.8599853516, 28.035507202148 }, -- rob markers for IdleWood house --House IdleWood blip { 326.66299, 1116.79797, 1082.88281, 5, 2166.1999511719, -1671.4699707031, 15.073687553406 }, { 316.13690, 1117.17993, 1082.88281, 5, 2166.1999511719, -1671.4699707031, 15.073687553406 }, { 309.62006, 1124.17896, 1082.88281, 5, 2166.1999511719, -1671.4699707031, 15.073687553406 }, -- rob markers for WilloField house --House WilloField blip { 2282.04590, -1135.85901, 1049.89844, 11, 2483.3798828125, -1996.1899414063, 13.834323883057 }, { 2282.36694, -1137.74646, 1049.89844, 11, 2483.3798828125, -1996.1899414063, 13.834323883057 }, { 2285.44629, -1136.67346, 1049.89844, 11, 2483.3798828125, -1996.1899414063, 13.834323883057 }, -- rob markers for Ganton house --House Ganton blip { 248.23495, 301.60382, 998.14844, 1, 2402.5183105469, -1715.6148681641, 14.1328125 }, { 243.82597, 301.51428, 998.14844, 1, 2402.5183105469, -1715.6148681641, 14.1328125 }, { 248.83932, 305.45200, 998.14844, 1, 2402.5183105469, -1715.6148681641, 14.1328125 }, -- rob markers for CJ house --house CJ blip { 2491.69287, -1694.92102, 1013.74792, 3, 2495.330078125, -1690.75, 14.765625 }, { 2500.01343, -1711.35229, 1013.74219, 3, 2495.330078125, -1690.75, 14.765625 }, { 2494.01831, -1700.84949, 1017.34375, 3, 2495.330078125, -1690.75, 14.765625 } function createBlips ( ) local vehicle = getElementModel ( source ) if ( getElementModel ( source ) == 498 ) then loc = math.random ( #locations ) robMarker = createMarker (locations[loc][1], locations[loc][2], locations[loc][3], locations[loc][4], "cylinder", 1.5, 255, 255, 255, 150) setElementInterior ( robMarker, 1 ) setElementInterior ( robMarker, 3 ) setElementInterior ( robMarker, 5 ) setElementInterior ( robMarker, 11 ) startBlip = createBlip (locations[loc][5], locations[loc][6], locations[loc][7], 32) end end addEventHandler ("onClientVehicleEnter", getRootElement (), createBlips )
  8. local locations = { -- rob markers for EastLosSantos house --House EastLosSantos blip { 2341.66602, -1186.37573, 1026.97656, 2351.9699707031, -1169.8599853516, 28.035507202148 }, { 2348.66870, -1186.74658, 1026.97656, 2351.9699707031, -1169.8599853516, 28.035507202148 }, { 2322.23877, -1183.75879, 1026.97656, 2351.9699707031, -1169.8599853516, 28.035507202148 }, -- rob markers for IdleWood house --House IdleWood blip { 326.66299, 1116.79797, 1082.88281, 2166.1999511719, -1671.4699707031, 15.073687553406 }, { 316.13690, 1117.17993, 1082.88281, 2166.1999511719, -1671.4699707031, 15.073687553406 }, { 309.62006, 1124.17896, 1082.88281, 2166.1999511719, -1671.4699707031, 15.073687553406 }, -- rob markers for WilloField house --House WilloField blip { 2282.04590, -1135.85901, 1049.89844, 2483.3798828125, -1996.1899414063, 13.834323883057 }, { 2282.36694, -1137.74646, 1049.89844, 2483.3798828125, -1996.1899414063, 13.834323883057 }, { 2285.44629, -1136.67346, 1049.89844, 2483.3798828125, -1996.1899414063, 13.834323883057 }, -- rob markers for Ganton house --House Ganton blip { 248.23495, 301.60382, 998.14844, 2402.5183105469, -1715.6148681641, 14.1328125 }, { 243.82597, 301.51428, 998.14844, 2402.5183105469, -1715.6148681641, 14.1328125 }, { 248.83932, 305.45200, 998.14844, 2402.5183105469, -1715.6148681641, 14.1328125 }, -- rob markers for CJ house --house CJ blip { 2491.69287, -1694.92102, 1013.74792, 2495.330078125, -1690.75, 14.765625 }, { 2500.01343, -1711.35229, 1013.74219, 2495.330078125, -1690.75, 14.765625 }, { 2494.01831, -1700.84949, 1017.34375, 2495.330078125, -1690.75, 14.765625 } } function createBlips ( ) local vehicle = getElementModel ( source ) if ( getElementModel ( source ) == 498 ) then loc = math.random ( #locations ) robMarker = createMarker (locations[loc][1], locations[loc][2], locations[loc][3], "cylinder", 1.5, 255, 255, 255, 150) setElementInterior ( robMarker, 1 ) setElementInterior ( robMarker, 3 ) setElementInterior ( robMarker, 5 ) setElementInterior ( robMarker, 11 ) startBlip = createBlip (locations[loc][4], locations[loc][5], locations[loc][6], 32) end end addEventHandler ("onClientVehicleEnter", getRootElement (), createBlips )
  9. Works, thanks alot. But the marker is a checkpoint right now, I tried robMarker = createMarker (locations[loc][1], locations[loc][2], locations[loc][3], "cylinder", 1.5, 255, 255, 255, 150) to change it into a cylinder but then the marker doesn't show up. The markers still don't spawn at the blip, they spawn in a different house than they should. I took your table and changed it in a useful table. If so then you gave me incorrect marker locations. Reinsert the marker locations till those are correct. Those locations are correct. Its working now. Thanks for your help anyway,
  10. I did that local locations = { -- rob markers for EastLosSantos house { 2341.66602, -1186.37573, 1026.97656, 0, 5, 2351.9699707031, -1169.8599853516, 28.035507202148 }, { 2348.66870, -1186.74658, 1026.97656, 0, 5, 2351.9699707031, -1169.8599853516, 28.035507202148 }, { 2322.23877, -1183.75879, 1026.97656, 0, 5, 2351.9699707031, -1169.8599853516, 28.035507202148 }, -- rob markers for IdleWood house { 326.66299, 1116.79797, 1082.88281, 0, 5, 2166.1999511719, -1671.4699707031, 15.073687553406 }, { 316.13690, 1117.17993, 1082.88281, 0, 5, 2166.1999511719, -1671.4699707031, 15.073687553406 }, { 309.62006, 1124.17896, 1082.88281, 0, 5, 2166.1999511719, -1671.4699707031, 15.073687553406 }, -- rob markers for WilloField house { 2282.04590, -1135.85901, 1049.89844, 1, 11, 2483.3798828125, -1996.1899414063, 13.834323883057 }, { 2282.36694, -1137.74646, 1049.89844, 1, 11, 2483.3798828125, -1996.1899414063, 13.834323883057 }, { 2285.44629, -1136.67346, 1049.89844, 1, 11, 2483.3798828125, -1996.1899414063, 13.834323883057 }, -- rob markers for Ganton house { 248.23495, 301.60382, 998.14844, 0, 1, 2402.5183105469, -1715.6148681641, 14.1328125 }, { 243.82597, 301.51428, 998.14844, 0, 1, 2402.5183105469, -1715.6148681641, 14.1328125 }, { 248.83932, 305.45200, 998.14844, 0, 1, 2402.5183105469, -1715.6148681641, 14.1328125 }, -- rob markers for CJ house { 2491.69287, -1694.92102, 1013.74792, 0, 3, 2495.330078125, -1690.75, 14.765625 }, { 2500.01343, -1711.35229, 1013.74219, 0, 3, 2495.330078125, -1690.75, 14.765625 }, { 2494.01831, -1700.84949, 1017.34375, 0, 3, 2495.330078125, -1690.75, 14.765625 } } function createBlips ( ) local vehicle = getElementModel ( source ) if ( getElementModel ( source ) == 498 ) then loc = math.random ( #locations ) robMarker = createMarker (locations[loc][1], locations[loc][2], locations[loc][3], locations[loc][4], locations[loc][5]) setElementInterior ( robMarker, 3 ) setElementInterior ( robMarker, 1 ) setElementInterior ( robMarker, 11 ) setElementInterior ( robMarker, 5 ) startBlip = createBlip(locations[loc][6], locations[loc][7], locations[loc][8]) end end addEventHandler ("onClientVehicleEnter", getRootElement (), createBlips )
  11. That aint going to work, because the markers are inside in an int. The markers still don't spawn at the blip, they spawn in a different house than they should.
  12. I did that. ( check first post )
  13. It creates the blip at random places around the map. It's not creating the blip at the house, but instead at the markers.
  14. local locations = { { 2351.9699707031, -1169.8599853516, 28.035507202148 }, --EastLosSantos { 2166.1999511719, -1671.4699707031, 15.073687553406 }, --house IdleWood { 2483.3798828125, -1996.1899414063, 13.834323883057 }, --house WilloField { 2402.5183105469, -1715.6148681641, 14.1328125 }, --house Ganton { 2495.330078125, -1690.75, 14.765625 }, --house CJ -- rob markers for EastLosSantos house { 2341.66602, -1186.37573, 1026.97656, 0, 5 }, { 2348.66870, -1186.74658, 1026.97656, 0, 5 }, { 2322.23877, -1183.75879, 1026.97656, 0, 5 }, -- rob markers for IdleWood house { 326.66299, 1116.79797, 1082.88281, 0, 5 }, { 316.13690, 1117.17993, 1082.88281, 0, 5 }, { 309.62006, 1124.17896, 1082.88281, 0, 5 }, -- rob markers for WilloField house { 2282.04590, -1135.85901, 1049.89844, 1, 11 }, { 2282.36694, -1137.74646, 1049.89844, 1, 11 }, { 2285.44629, -1136.67346, 1049.89844, 1, 11 }, -- rob markers for Ganton house { 248.23495, 301.60382, 998.14844, 0, 1 }, { 243.82597, 301.51428, 998.14844, 0, 1 }, { 248.83932, 305.45200, 998.14844, 0, 1 }, -- rob markers for CJ house { 2491.69287, -1694.92102, 1013.74792, 0, 3 }, { 2500.01343, -1711.35229, 1013.74219, 0, 3 }, { 2494.01831, -1700.84949, 1017.34375, 0, 3 } } function createBlips ( ) local vehicle = getElementModel ( source ) if ( getElementModel ( source ) == 498 ) then loc = math.random ( #locations ) robMarker = createMarker ( locations[loc][1], locations[loc][2], locations[loc][3], locations[loc][4], locations[loc][5] ) setElementInterior ( robMarker, 3 ) setElementInterior ( robMarker, 1 ) setElementInterior ( robMarker, 11 ) setElementInterior ( robMarker, 5 ) startBlip = createBlip ( locations[loc][1], locations[loc][2], locations[loc][3] ) end end addEventHandler ("onClientVehicleEnter", getRootElement (), createBlips ) Im getting this debug
  15. You mean making 1 table instead of 2?
  16. All of that aint going to work ^ Example, you got house a, b, c. The blip comes at house a, but the marker comes at house b. How do I make it that both of them comes at the same house. I know about createBlipAttachedTo, but thats not going to work out since those markers are inside an interior.
  17. Im trying to make a robbery script but, I got a problem with math.random. It creates the blip like it should. But the markers should be created in the house where the blip is. The blip shows where you need to go to rob the house, there should be 3 markers created at the int of the house. But how to make it so that it all spawns at the same place ( the blip and the rob markers ). I tried this, but it gives me an error local locations = { { 2351.9699707031, -1169.8599853516, 28.035507202148 }, --EastLosSantos { 2166.1999511719, -1671.4699707031, 15.073687553406 }, --house IdleWood { 2483.3798828125, -1996.1899414063, 13.834323883057 }, --house WilloField { 2402.5183105469, -1715.6148681641, 14.1328125 }, --house Ganton { 2495.330078125, -1690.75, 14.765625 } --house CJ } local markers = { -- rob markers for EastLosSantos house { 2341.66602, -1186.37573, 1027.97656, 0, 5 }, { 2348.66870, -1186.74658, 1027.97656, 0, 5 }, { 2322.23877, -1183.75879, 1027.97656, 0, 5 }, -- rob markers for IdleWood house { 326.66299, 1116.79797, 1083.88281, 0, 5 }, { 316.13690, 1117.17993, 1083.88281, 0, 5 }, { 309.62006, 1124.17896, 1083.88281, 0, 5 }, -- rob markers for WilloField house { 2282.04590, -1135.85901, 1050.89844, 1, 11 }, { 2282.36694, -1137.74646, 1050.89844, 1, 11 }, { 2285.44629, -1136.67346, 1050.89844, 1, 11 }, -- rob markers for Ganton house { 248.23495, 301.60382, 999.14844, 0, 1 }, { 243.82597, 301.51428, 999.14844, 0, 1 }, { 248.83932, 305.45200, 999.14844, 0, 1 }, -- rob markers for CJ house { 2491.69287, -1694.92102, 1014.74792, 0, 3 }, { 2500.01343, -1711.35229, 1014.74219, 0, 3 }, { 2494.01831, -1700.84949, 1018.34375, 0, 3 } } function createBlips ( ) local vehicle = getElementModel ( source ) if ( getElementModel ( source ) == 498 ) then loc = math.random ( #locations ) loc2 = math.random ( #markers ) markerX, markerY, markerZ, dim, int = markers[loc2][1], markers[loc2][2], markers[loc2][3], markers[loc2][4], markers[loc2][5] blipX, blipY, blipZ = locations[loc][1], locations[loc][2], locations[loc][3] robMarker = createMarker (markerX, markerY, markerZ, "cylinder", 1.5, 255, 255, 255, 255, getRootElement () ) setElementInterior ( robMarker, 3 ) setElementInterior ( robMarker, 1 ) setElementInterior ( robMarker, 11 ) setElementInterior ( robMarker, 5 ) startBlip = createBlip ( blipX, blipY, blipZ, 32 ) end end addEventHandler ("onClientVehicleEnter", getRootElement (), createBlips ) Error:houserobbery/robbery_c.lua:35 attempt to index field '?' (a nil value)
  18. vehicles = { {515}, {514}, {403} } function createVehicleGUI ( ) local sWidth, sHeight, X, Y = guiGetScreenSize ( ) local Width, Height = 250, 350 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) vehicleWindow = guiCreateWindow ( X, Y, Width, Height, "Trucker Vehicle Spawner", false ) takeVehicleGrid = guiCreateGridList ( 0, 20, 250, 275, false, vehicleWindow ) guiGridListAddColumn (takeVehicleGrid, "Vehicle", 0.9 ) spawnCar = guiCreateButton ( 0, 300, 230, 40, "Spawn Truck", false, vehicleWindow ) for i,v in ipairs ( vehicles ) do local carName = getVehicleNameFromModel ( v[1] ) local row = guiGridListAddRow ( takeVehicleGrid ) guiGridListSetItemText ( takeVehicleGrid, row, 1, carName, false, true ) guiGridListSetItemText ( takeVehicleGrid, row, 2, tostring ( v[2] ), false, true ) guiSetVisible ( vehicleWindow, false ) end end addEventHandler ( "onClientResourceStart", getResourceRootElement (), createVehicleGUI ) function loadSkinsintoGrid ( ) for i,v in ipairs ( Skins ) do local row = guiGridListAddRow ( takeSkinGrid ) guiGridListSetItemText ( takeSkinGrid, row, 1, v[1], false, true ) guiGridListSetItemText ( takeSkinGrid, row, 2, v[2], false, true ) end end addEventHandler ("onClientResourceStart", root, loadSkinsintoGrid ) addEventHandler ("onClientGUIClick", root, function ( ) if ( source == jobButton ) then local row, Column = guiGridListGetSelectedItem ( takeSkinGrid ) local id = tostring ( guiGridListGetItemText ( takeSkinGrid, row, 2 ) ) if ( row and Column and row ~= -1 and Column ~= -1 ) then triggerServerEvent ("giveSkin", localPlayer, id ) end end end ) function closeGUI ( ) if ( source == cancelButton ) then guiSetVisible ( takeJobWindow, false ) showCursor ( false,false ) end end addEventHandler ("onClientGUIClick", root, closeGUI ) function MarkerGUIShoww ( hitPlayer, matchingDimension ) if ( hitPlayer ) then guiSetVisible ( vehicleWindow, true ) showCursor ( true, true ) end end addEventHandler ( "onClientMarkerHit", vehicleMarker, MarkerGUIShoww ) function spawnCar ( button, state, absoluteX, absoluteYe ) if ( source == spawnCar ) then guiSetVisible ( vehicleWindow, false ) showCursor ( false ) if (guiGridListGetSelectedItem ( takeVehicleGrid ) ) then local carName = guiGridListGetItemText ( takeVehicleGrid, guiGridListGetSelectedItem ( takeVehicleGrid ), 1 ) local carID = getVehicleModelFromName ( carName ) triggerServerEvent ("spawnCar", getLocalPlayer ( ), carID, carName ) end end end addEventHandler ("onClientGUIClick", root, spawnCar ) destinationCoords = { {-2524.92871, -618.60449, 132.56250}, {-1048.03088, -657.40356, 32.01260}, {259.51086, 1384.65955, 10.58594}, {-2254.77466, 2359.49536, 4.97963}, {2753.75195, -2473.34351, 13.64844} } function startBlips ( button ) if ( button == spawnCar ) then local markerTableData = destinationCoords[math.random ( #destinationCoords )] local x = markerTableData[1] local y = markerTableData[2] local z = markerTableData[3] startMarker = createMarker ( x, y, z, "cylinder", 3, 255, 255, 51 ) startBlip = createBlipAttachedTo ( startMarker, 51 ) setElementVisibleTo( startBlip, root, false ) setElementVisibleTo( startBlip, source, true ) end end addEventHandler ("onClientPlayerVehicleEnter", getRootElement (), startBlips ) Full script, except the trucker job gui.
  19. Once I remove this line it works, but every car I enter does create a blip. if ( button == spawnCar ) then If I add that line back it doesn't work anymore.
  20. Tried it out, but didn't work, so I used onClientPlayerVehicleEnter which didn't work either, so I removed if ( button == spawnCar ) then to test out if it would work. It did work without that line. But everyone who would enter a car would create a blip. How can I make it work so only the player who spawned the truck would create a destination blip. function startBlips ( button ) if ( button == spawnCar ) then local markerTableData = destinationCoords[math.random ( #destinationCoords )] local x = markerTableData[1] local y = markerTableData[2] local z = markerTableData[3] startMarker = createMarker ( x, y, z, "cylinder", 3, 255, 255, 51 ) startBlip = createBlipAttachedTo ( startMarker, 51 ) end end addEventHandler ("onClientPlayerVehicleEnter", getRootElement (), startBlips ) It looks like this atm, right now it doesn't work because if ( button == spawnCar ) then
  21. What about the addEventHandler, when I click on a truck on the gui it shows the blip instead of showing it when I spawn one.
  22. When I try to add markers for the destination the markers nor the blip show up when I spawn the truck destinationCoords = { {-2524.92871, -618.60449, 132.56250}, {-1048.03088, -657.40356, 32.01260}, {259.51086, 1384.65955, 10.58594}, {-2254.77466, 2359.49536, 4.97963}, {2753.75195, -2473.34351, 13.64844} } function startBlips ( button ) if ( button == spawnCar ) then local marker = math.random ( destinationCoords ) startMarker = createMarker ( destinationCoords, x, y, z, "cylinder", 3, 255, 255, 51 ) startBlip = createBlipAttachedTo ( startMarker, 51 ) end end addEventHandler ("onClientGUIClick", root, startBlips )
×
×
  • Create New...