iFoReX Posted February 25, 2013 Share Posted February 25, 2013 porque me da error ? D: cl GUIEditor = { button = {}, edit = {}, window = {}, gridlist = {}, label = {}, } GUIEditor.window[1] = guiCreateWindow(15, 244, 366, 516, "Extreme Gamers Fuzion - Venta de Autos", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(187, 34, 170, 473, false, GUIEditor.window[1]) col = guiGridListAddColumn(GUIEditor.gridlist[1], "Autos", 0.5) col2 = guiGridListAddColumn(GUIEditor.gridlist[1], "$", 0.3) GUIEditor.edit[1] = guiCreateEdit(14, 62, 150, 37, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(19, 31, 142, 28, "Color 1 - R,G,B", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") GUIEditor.edit[2] = guiCreateEdit(14, 133, 150, 37, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(18, 99, 142, 28, "Color 2 - R,G,B", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") GUIEditor.edit[3] = guiCreateEdit(14, 200, 150, 37, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(18, 172, 142, 28, "Paintjob ( 1 - 2 - 3 )", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[3], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[3], "center") GUIEditor.button[1] = guiCreateButton(15, 245, 148, 34, "Tuneado", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(15, 285, 147, 39, "Comprar", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(17, 332, 46, 19, "Precio :", false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(73, 332, 96, 20, "N/A", false, GUIEditor.window[1]) guiLabelSetHorizontalAlign(GUIEditor.label[5], "center", false) GUIEditor.button[3] = guiCreateButton(9, 456, 166, 46, "Salir", false, GUIEditor.window[1]) GUIEditor.window[2] = guiCreateWindow(413, 194, 342, 153, "Elije el Slot", false) guiWindowSetSizable(GUIEditor.window[2], false) GUIEditor.edit[4] = guiCreateEdit(168, 56, 86, 27, "", false, GUIEditor.window[2]) GUIEditor.label[6] = guiCreateLabel(76, 59, 82, 26, "Slots ( 1 - 5 )", false, GUIEditor.window[2]) GUIEditor.button[4] = guiCreateButton(213, 110, 120, 34, "Comprar", false, GUIEditor.window[2]) GUIEditor.button[5] = guiCreateButton(10, 109, 120, 34, "Salir", false, GUIEditor.window[2]) guiSetVisible(GUIEditor.window[1],false) guiSetVisible(GUIEditor.window[2],false) function grid() local row = guiGridListAddRow(GUIEditor.gridlist[1]) if row and col and col2 then local cars = {{579,60000},{400,60000},{404,28000},{489,65000},{505,65000},{479,45000},{442,45000},{458,45000},{602,50000},{496,42500},{401,41000},{518,60000},{527,75000},{589,75000},{419,45000},{533,75000},{526,50000},{474,55000},{545,50000},{517,45000},{410,41000},{600,50000},{436,41000},{580,50000},{439,75000},{549,75000},{491,45000},{445,45000},{507,45000},{585,45000},{587,75000},{466,55000},{492,50000},{546,45000},{551,45000},{516,45000},{467,45000},{426,47500},{547,45000},{405,55000},{409,75000},{550,45000},{566,45000},{540,45000},{421,50000},{529,45000},{402,120000},{542,65000},{603,120000},{475,75000},{562,120000},{565,95000},{559,120000},{561,50000},{560,120000},{558,100000},{429,120000},{541,120000},{415,120000},{480,95000},{434,100000},{494,120000},{502,120000},{503,120000},{411,120000},{506,120000},{451,120000},{555,95000},{477,95000},{499,25000},{498,25000},{578,50000},{486,70000},{455,75000},{588,50000},{403,75000},{414,50000},{443,75000},{515,75000},{514,75000},{531,12000},{456,45000},{422,45000},{482,95000},{530,12000},{418,45000},{572,12000},{582,50000},{413,50000},{440,50000},{543,65000},{583,12000},{478,35000},{554,50000},{536,75000},{575,75000},{534,75000},{567,75000},{535,75000},{576,75000},{412,75000},{568,75000},{457,12000},{483,45000},{508,40000},{571,10000},{500,55000},{444,120000},{556,120000},{557,120000},{471,20000},{495,100000},{539,75000},{481,2500},{509,2500},{581,45000},{462,12000},{521,60000},{463,50000},{522,75000},{448,12000},{468,45000},{586,45000},{485,12000},{431,60000},{438,45000},{437,60000},{574,12000},{420,45000},{525,75000},{408,50000},{428,65000}} for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1], row, col, carName, false, true) guiGridListSetItemText (GUIEditor.gridlist[1], row, col2, tostring(v[2]), false, true) auto = createVehicle(579, -1948.90039, 262.69537, 41.04708) setElementDimension(auto,getElementDimension(getLocalPlayer())) end end end addEventHandler("onClientResourceStart",resourceRoot,grid) setTimer(function() selectedCar = guiGridListGetItemText (GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),1) id = getVehicleModelFromName(selectedCar) setElementModel(auto,id) end,500,0) addEvent("carwindow",true) addEventHandler("carwindow",root,function() guiSetVisible(GUIEditor.window[1],true) showCursor(true) end ) addEventHandler("onClientGUIClick",root,function() if source == GUIEditor.button[3] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) -----panelusuario---- userp = guiCreateWindow(12, 68, 294, 683, "Panel de Usuario", false) guiWindowSetSizable(GUIEditor.window[1], false) slot1 = guiCreateButton(9, 28, 276, 31, "Slot 1 - Vacio", false, userp) slot2 = guiCreateButton(10, 67, 275, 31, "Slot 2 - Vacio", false, userp) slot3 = guiCreateButton(10, 112, 275, 31, "Slot 3 - Vacio", false, userp) slot4 = guiCreateButton(10, 151, 275, 31, "Slot 5 - Vacio", false, userp) slot5 = guiCreateButton(10, 190, 275, 31, "Slot 4 - Vacio", false, userp) slot6 = guiCreateButton(10, 229, 275, 31, "Slot 6 - Vacio", false, userp) slot7 = guiCreateButton(10, 268, 275, 31, "Slot 7 - Vacio", false, userp) slot8 = guiCreateButton(10, 307, 275, 31, "Slot 8 - Vacio", false, userp) slot9 = guiCreateButton(10, 346, 275, 31, "Slot 9 - Vacio", false, userp) slot10 = guiCreateButton(10, 385, 275, 31, "Slot 10 - Vacio", false, userp) slot11 = guiCreateButton(10, 424, 275, 31, "Slot 11 - Vacio", false, userp) deathwarp = guiCreateButton(56, 463, 178, 46, "Death Warp", false, userp) guiSetVisible(userp,false) bindKey("F2","down",function() guiSetVisible(userp,not guiGetVisible(userp)) showCursor(guiGetVisible(userp)) end ) sv lv_m = createMarker(1658.45068, 2199.99097, 10,"cylinder",1,0,255,0,140) sf_m = createMarker(-1956.29456, 278.89899, 34,"cylinder",1,0,255,0,140) createBlipAttachedTo(lv_m,55) createBlipAttachedTo(sf_m,55) addEventHandler("onMarkerHit",root,function(hitElement,MatchingDimension) if source == lv_m or source == sf_m then triggerClientEvent("carwindow",hitElement) local dims = math.random(100,65535) setElementDimension(source,dims) setCameraMatrix(source,-1953.01196, 274.52914, 43,-1948.90039, 262.69537, 41.04708) end end ) Link to comment
Plate Posted February 25, 2013 Share Posted February 25, 2013 selectedCar = guiGridListGetItemText (GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),1) proba asi local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then Link to comment
iFoReX Posted February 25, 2013 Author Share Posted February 25, 2013 Error en debug bad argument en setelementmodel Link to comment
Plate Posted February 26, 2013 Share Posted February 26, 2013 Te da error en el setElementModel por que estas usando mal el guiGridListGetItemText guiGridListGetSelectedItem y no estas obteniendo nada al no obtener nada el getVehicleModelFromName no obtiene el modelo y el setElementModel da error por que no tiene ningun model que poner proba asi local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1])) if ( row and col and row ~= -1 and col ~= -1 ) then local selectedcar = guiGridListGetItemText ( GUIEditor.gridlist[1]), row, col ) Link to comment
iFoReX Posted February 26, 2013 Author Share Posted February 26, 2013 Ok, ahora ya arregle todo eso y tengo funcionando todo, pero como hago para que el auto rote ? :l Link to comment
Castillo Posted February 26, 2013 Share Posted February 26, 2013 Con un timer o onClientRender, y: setElementRotation Link to comment
Plate Posted February 26, 2013 Share Posted February 26, 2013 local rotZ = 1 setElementRotation(elvehiculo, 0, 0, rotZ) setTimer(function() rotZ = rotZ + 1 setElementRotation(elvehiculo, 0, 0, rotZ) end,1000,200 ? Link to comment
iFoReX Posted February 26, 2013 Author Share Posted February 26, 2013 ya lo solucione rotation = 0 function rotateCar() rotatingCar = getElementData(localPlayer,"auto") if rotatingCar then if isElement(rotatingCar) then rotation = rotation + 1 if rotation > 359 then rotation = 0 end setElementRotation(rotatingCar,0,0,rotation) end end end addEventHandler ( "onClientRender", root, rotateCar) pero ahora como hago para obtener los account data de los jobs ?? :l me da error en getAccount cl GUIEditor = { button = {}, edit = {}, window = {}, gridlist = {}, label = {}, } upgradeCost = 0 rotation = 0 GUIEditor.window[1] = guiCreateWindow(15, 244, 366, 516, "Extreme Gamers Fuzion - Venta de Autos", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(187, 34, 170, 473, false, GUIEditor.window[1]) col = guiGridListAddColumn(GUIEditor.gridlist[1], "Autos", 0.5) col2 = guiGridListAddColumn(GUIEditor.gridlist[1], "$", 0.3) r = guiCreateEdit(14, 62, 45, 30, "", false, GUIEditor.window[1]) g = guiCreateEdit(60, 62, 45, 30, "", false, GUIEditor.window[1]) b = guiCreateEdit(106, 62, 45, 30, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(19, 31, 142, 28, "Color 1 - R,G,B", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") r2 = guiCreateEdit(14, 132, 45, 30, "", false, GUIEditor.window[1]) g2 = guiCreateEdit(60, 132, 45, 30, "", false, GUIEditor.window[1]) b2 = guiCreateEdit(106, 132, 45, 30, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(18, 99, 142, 28, "Color 2 - R,G,B", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") GUIEditor.edit[3] = guiCreateEdit(14, 200, 150, 37, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(18, 172, 142, 28, "Paintjob ( 1 - 2 - 3 )", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[3], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[3], "center") GUIEditor.button[1] = guiCreateButton(15, 245, 148, 34, "Tuneado", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(15, 285, 147, 39, "Comprar", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(17, 332, 46, 19, "Precio :", false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(73, 332, 96, 20, "N/A", false, GUIEditor.window[1]) guiLabelSetHorizontalAlign(GUIEditor.label[5], "center", false) GUIEditor.button[3] = guiCreateButton(9, 456, 166, 46, "Salir", false, GUIEditor.window[1]) GUIEditor.window[2] = guiCreateWindow(413, 194, 342, 153, "Elije el Slot", false) guiWindowSetSizable(GUIEditor.window[2], false) sedit = guiCreateEdit(168, 56, 86, 27, "", false, GUIEditor.window[2]) GUIEditor.label[6] = guiCreateLabel(76, 59, 82, 26, "Slots ( 1 - 5 )", false, GUIEditor.window[2]) GUIEditor.button[4] = guiCreateButton(213, 110, 120, 34, "Comprar", false, GUIEditor.window[2]) GUIEditor.button[5] = guiCreateButton(10, 109, 120, 34, "Salir", false, GUIEditor.window[2]) guiSetVisible(GUIEditor.window[1],false) guiSetVisible(GUIEditor.window[2],false) function grid() local row = guiGridListAddRow(GUIEditor.gridlist[1]) if row and col and col2 then local cars = {{579,60000},{400,60000},{404,28000},{489,65000},{505,65000},{479,45000},{442,45000},{458,45000},{602,50000},{496,42500},{401,41000},{518,60000},{527,75000},{589,75000},{419,45000},{533,75000},{526,50000},{474,55000},{545,50000},{517,45000},{410,41000},{600,50000},{436,41000},{580,50000},{439,75000},{549,75000},{491,45000},{445,45000},{507,45000},{585,45000},{587,75000},{466,55000},{492,50000},{546,45000},{551,45000},{516,45000},{467,45000},{426,47500},{547,45000},{405,55000},{409,75000},{550,45000},{566,45000},{540,45000},{421,50000},{529,45000},{402,120000},{542,65000},{603,120000},{475,75000},{562,120000},{565,95000},{559,120000},{561,50000},{560,120000},{558,100000},{429,120000},{541,120000},{415,120000},{480,95000},{434,100000},{494,120000},{502,120000},{503,120000},{411,120000},{506,120000},{451,120000},{555,95000},{477,95000},{499,25000},{498,25000},{578,50000},{486,70000},{455,75000},{588,50000},{403,75000},{414,50000},{443,75000},{515,75000},{514,75000},{531,12000},{456,45000},{422,45000},{482,95000},{530,12000},{418,45000},{572,12000},{582,50000},{413,50000},{440,50000},{543,65000},{583,12000},{478,35000},{554,50000},{536,75000},{575,75000},{534,75000},{567,75000},{535,75000},{576,75000},{412,75000},{568,75000},{457,12000},{483,45000},{508,40000},{571,10000},{500,55000},{444,120000},{556,120000},{557,120000},{471,20000},{495,100000},{539,75000},{481,2500},{509,2500},{581,45000},{462,12000},{521,60000},{463,50000},{522,75000},{448,12000},{468,45000},{586,45000},{485,12000},{431,60000},{438,45000},{437,60000},{574,12000},{420,45000},{525,75000},{408,50000},{428,65000}} for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1], row, col, carName, false, true) guiGridListSetItemText (GUIEditor.gridlist[1], row, col2, tostring(v[2]), false, true) end end end addEventHandler("onClientResourceStart",resourceRoot,grid) addEventHandler("onClientGUIClick",root,function() if source == GUIEditor.button[1] then addVehicleUpgrade ( getElementData(getLocalPlayer(),"auto"), 1010 ) upgradeCost = 50000 elseif source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) guiSetVisible(GUIEditor.window[2],true) elseif source == GUIEditor.button[5] then guiSetVisible(GUIEditor.window[2],false) guiSetVisible(GUIEditor.window[1],true) elseif source == GUIEditor.button[4] then local nslots = guiGetText(sedit) end end ) setTimer(function() local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then id = getVehicleModelFromName(guiGridListGetItemText(GUIEditor.gridlist[1],row,col)) if isElement(getElementData(getLocalPlayer(),"auto")) then setElementModel(getElementData(getLocalPlayer(),"auto"),id) end if (guiGridListGetSelectedItem (GUIEditor.gridlist[1])) then local carCost = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 2) guiSetText(GUIEditor.label[5],carCost+upgradeCost) if isElement(getElementData(getLocalPlayer(),"auto")) then setVehicleColor ( getElementData(getLocalPlayer(),"auto"), tonumber(guiGetText(r)),tonumber(guiGetText(g)),tonumber(guiGetText(b)),tonumber(guiGetText(r1)),tonumber(guiGetText(g1)),tonumber(guiGetText(b1)) ) end end end end,500,0) addEvent("carwindow",true) addEventHandler("carwindow",root,function() guiSetVisible(GUIEditor.window[1],true) showCursor(true) end ) function rotateCar() rotatingCar = getElementData(localPlayer,"auto") if rotatingCar then if isElement(rotatingCar) then rotation = rotation + 1 if rotation > 359 then rotation = 0 end setElementRotation(rotatingCar,0,0,rotation) end end end addEventHandler ( "onClientRender", root, rotateCar) addEventHandler("onClientGUIClick",root,function() if source == GUIEditor.button[3] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) setCameraTarget(getLocalPlayer()) setElementDimension(getLocalPlayer(),0) destroyElement(getElementData(getLocalPlayer(),"auto")) upgradeCost = 0 end end ) -----panelusuario---- userp = guiCreateWindow(12, 68, 294, 683, "Panel de Usuario", false) guiWindowSetSizable(GUIEditor.window[1], false) slot1 = guiCreateButton(9, 28, 276, 31, "Slot 1 - Vacio", false, userp) slot2 = guiCreateButton(10, 67, 276, 31, "Slot 2 - Bloqueado", false, userp) slot3 = guiCreateButton(10, 112, 276, 31, "Slot 3 - Bloqueado", false, userp) slot4 = guiCreateButton(10, 151, 276, 31, "Slot 5 - Bloqueado", false, userp) slot5 = guiCreateButton(10, 190, 276, 31, "Slot 4 - Bloqueado", false, userp) slot6 = guiCreateButton(10, 229, 276, 31, "Slot 6 - Bloqueado", false, userp) slot7 = guiCreateButton(10, 268, 276, 31, "Slot 7 - Bloqueado", false, userp) slot8 = guiCreateButton(10, 307, 276, 31, "Slot 8 - Bloqueado", false, userp) slot9 = guiCreateButton(10, 346, 276, 31, "Slot 9 - Bloqueado", false, userp) slot10 = guiCreateButton(10, 385, 276, 31, "Slot 10 - Bloqueado", false, userp) slot11 = guiCreateButton(10, 424, 276, 31, "Slot 11 - Bloqueado", false, userp) deathwarp = guiCreateButton(56, 463, 178, 46, "Death Warp", false, userp) guiSetVisible(userp,false) bindKey("F2","down",function() guiSetVisible(userp,not guiGetVisible(userp)) showCursor(guiGetVisible(userp)) end ) addEvent("button1",true) addEventhandler("button1",root,function() guiSetText(slot2,"Slot 2 - Vacio") end) addEvent("button2",true) addEventhandler("button2",root,function() guiSetText(slot3,"Slot 3 - Vacio") end) addEvent("button3",true) addEventhandler("button3",root,function() guiSetText(slot4,"Slot 4 - Vacio") end) addEvent("button4",true) addEventhandler("button4",root,function() guiSetText(slot5,"Slot 5 - Vacio") end) addEvent("button5",true) addEventhandler("button5",root,function() guiSetText(slot6,"Slot 6 - Vacio") end) addEvent("button6",true) addEventhandler("button6",root,function() guiSetText(slot7,"Slot 7 - Vacio") end) addEvent("button7",true) addEventhandler("button7",root,function() guiSetText(slot8,"Slot 8 - Vacio") end) addEvent("button8",true) addEventhandler("button8",root,function() guiSetText(slot9,"Slot 9 - Vacio") end) addEvent("button9",true) addEventhandler("button9",root,function() guiSetText(slot10,"Slot 10 - Vacio") end) addEvent("button10",true) addEventhandler("button10",root,function() guiSetText(slot11,"Slot 11 - Vacio") end) addEventHandler("onClientGUIClick",root,function() if source == slots2 and jobscount < 50 then outputChatBox("Slot Bloqueado, Necesitas 50 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots3 and jobscount < 100 then outputChatBox("Slot Bloqueado, Necesitas 100 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots4 and jobscount < 150 then outputChatBox("Slot Bloqueado, Necesitas 150 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots5 and jobscount < 200 then outputChatBox("Slot Bloqueado, Necesitas 200 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots6 and jobscount < 250 then outputChatBox("Slot Bloqueado, Necesitas 250 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots7 and jobscount < 300 then outputChatBox("Slot Bloqueado, Necesitas 300 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots8 and jobscount < 350 then outputChatBox("Slot Bloqueado, Necesitas 350 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots9 and jobscount < 400 then outputChatBox("Slot Bloqueado, Necesitas 400 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots10 and jobscount < 450 then outputChatBox("Slot Bloqueado, Necesitas 450 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) elseif source == slots11 and jobscount < 500 then outputChatBox("Slot Bloqueado, Necesitas 500 Jobs para desbloquearlo.",getLocalPlayer(),0,0,0) end end ) sv lv_m = createMarker(1658.45068, 2199.99097, 10,"cylinder",1,0,255,0,140) sf_m = createMarker(-1956.29456, 278.89899, 34.6,"cylinder",1,0,255,0,140) createBlipAttachedTo(lv_m,55) createBlipAttachedTo(sf_m,55) addEventHandler("onMarkerHit",root,function(hitElement,MatchingDimension) if source == lv_m or source == sf_m then triggerClientEvent(hitElement,"carwindow",hitElement) local dims = math.random(100,65535) setElementDimension(hitElement,dims) setCameraMatrix(hitElement,-1953.01196, 274.52914, 43,-1948.90039, 262.69537, 41.04708) auto = createVehicle(579, -1948.90039, 262.69537, 41.04708) setElementDimension(auto,getElementDimension(hitElement)) setElementData(hitElement,"auto",auto) end end ) setTimer(function() getJobs() end,500,0) function getJobs() for i,v in ipairs(getElementsByType"player") do acc = getAccount(v) local jobscount = getAccountData(acc,"jobs") if jobscount >= 50 then triggerClientEvent("button1",v) elseif jobscount >= 100 then triggerClientEvent("button2",v) elseif jobscount >= 150 then triggerClientEvent("button3",v) elseif jobscount >= 200 then triggerClientEvent("button4",v) elseif jobscount >= 250 then triggerClientEvent("button5",v) elseif jobscount >= 300 then triggerClientEvent("button6",v) elseif jobscount >= 350 then triggerClientEvent("button7",v) elseif jobscount >= 400 then triggerClientEvent("button8",v) elseif jobscount >= 450 then triggerClientEvent("button9",v) elseif jobscount >= 500 then triggerClientEvent("button10",v) end end end Link to comment
Recommended Posts