Jump to content

iFoReX

Members
  • Posts

    1,708
  • Joined

  • Last visited

Everything posted by iFoReX

  1. Para que leer eso .__________. xDD si no aparece ningun error >:c en el debuscript3
  2. iFoReX

    how

    how i can get the lenght of players on colshape ? i try it but it doesnt work :l and how i can make a countdown start on 10:00 with tickcounts ? :l cl : hour = "10" minutes = "00" addEvent("features",true) addEventHandler("features",root,function() addEventHandler("onClientRender",root,features) end ) ultimavezdeejecucion= getTickCount() despues = getTickCount() function features() sWidth,sHeight = guiGetScreenSize() for i,v in ipairs(getElementsByType"player") do if getElementData(v,"enbase") == "dentro" then if minutes == "00" then hour = hour-1 minutes = 60 elseif hour == "00" then triggerServerEvent("basefinished",root) end if (getTickCount()-ultimavezdeejecucion) > 1000 then minutes = getTickCount()-ultimavezdeejecucion minutes = minutes-1 end dxDrawText(hour..":"..tostring(minutes),sWidth*0.900, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1,"default-bold","left","top",false,false,false) for i,v in ipairs(getElementsByType"player") do local estatus = getElementData(v,"enbase") if estatus == "dentro" then if #v == 1 then dxDrawText(getPlayerName ( v ):gsub ( "#%x%x%x%x%x%x", "" ),sWidth*0.900, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1,"default-bold","left","top",false,false,false) elseif #v == 2 then dxDrawText(getPlayerName ( v[1] ):gsub ( "#%x%x%x%x%x%x", "" ),sWidth*0.900, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1,"default-bold","left","top",false,false,false) dxDrawText(getPlayerName ( v[2] ):gsub ( "#%x%x%x%x%x%x", "" ),sWidth*0.900, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1,"default-bold","left","top",false,false,false) end end end end end end ultimavezdeejecucion = getTickCount() sv reward = math.random(10000,30000) addCommandHandler("startbase",function(playerSource) x,y,z = getElementPosition(playerSource) local zona = getElementZoneName(playerSource) outputChatBox("#ffffff"..getPlayerName(playerSource).."#00D111, Ha Iniciado Una Base",root,0,0,0,true) outputChatBox("#00D111Base Localizada en #FFFFFF"..zona.."",root,0,0,0,true) outputChatBox("#00D111Iniciara en 3 segundos..",root,0,0,0,true) setTimer( function() outputChatBox("#00D111Base Iniciada",root,0,0,0,true) area = createRadarArea ( x-50, y+50, 80, -80, 255, 0, 0, 175 ) safecol = createColCuboid ( x-50, y-30, z-2, 70, 70, 20 ) createBlipAttachedTo(area,25) setTimer(function() for i,v in ipairs(getElementsByType"player") do if isElementWithinColShape(v,safecol) then setElementData(v,"enbase","dentro",true) end end end ,500,1) for i,v in ipairs(getElementsByType"player") do if getElementData(v,"enbase") == "dentro" then outputChatBox("#FFFFFFRecompensa por matarte : "..reward.."",v,0,0,0,true) triggerClientEvent("features",root) end end end ,3000,1) end ) addEventHandler("onColShapeHit",root,function(hitElement,matchingDimension) if source == safecol then setElementData(hitElement,"bando","enemigo") for i,v in ipairs(getElementsByType"player") do if getElementData(v,"enbase") == "dentro" and not getElementData(hitElement,"enbase") == "dentro" then outputChatBox(getPlayerName(hitElement):gsub ( "#%x%x%x%x%x%x", "" ).." Ha entrado a la base",v,255,0,0) elseif getElementData(hitElement,"enbase") == "dentro" then outputChatBox("Haz vuelto a la base",hitElement,0,255,0) end end end end ) addEventHandler("onColShapeLeave",root,function(leaveElement,matchingDimension) if source == safecol then if getElementData(leaveElement,"enbase") == "dentro" then outputChatBox("Vuelve a la base en 15 segundos o perderas",leaveElement,255,0,0) end end end )
  3. el jugador no spawnea al aprietar enter, no hay errores en el debug ni nada, solo aparece en las posiciones 0,0,0 :l cl addEventHandler("onClientResourceStart",resourceRoot,function() triggerServerEvent("camaras",getLocalPlayer()) bindKey ("enter", "down", Spawn ) bindKey ("arrow_l", "down", Next_team) bindKey ("arrow_r", "down", Previous_team) bindKey ("space", "down", ciudades) addEventHandler("onClientRender",root,texto) setElementData(getLocalPlayer(),"team","army",true) setElementData(getLocalPlayer(),"ciudades","ls",true) end ) addEventHandler("onClientPlayerWasted",root,function() triggerServerEvent("camaras",getLocalPlayer()) bindKey ("enter", "down", Spawn ) bindKey ("arrow_l", "down", Next_team) bindKey ("arrow_r", "down", Previous_team) bindKey ("space", "down", ciudades) texto() end ) addEvent("trigger",true) addEventHandler("trigger",root,function(ped) ped2 = ped end ) function ciudades() if getElementData(getLocalPlayer(),"ciudades") == "ls" then setElementData(getLocalPlayer(),"ciudades","lv",true) elseif getElementData(getLocalPlayer(),"ciudades") == "lv" then setElementData(getLocalPlayer(),"ciudades","sf",true) elseif getElementData(getLocalPlayer(),"ciudades") == "sf" then setElementData(getLocalPlayer(),"ciudades","ls",true) end end function Spawn() triggerServerEvent("spawn",getLocalPlayer()) setCameraTarget(getLocalPlayer()) unbindKey ("enter", "down", Spawn ) unbindKey ("arrow_l", "down", Next_team) unbindKey ("arrow_r", "down", Previous_team) unbindKey ("space", "down", ciudades) removeEventHandler("onClientRender",root,texto) end function Next_team() if getElementData(getLocalPlayer(),"team") == "army" then setElementData(getLocalPlayer(),"team","robber",true) setElementModel(ped2,105) elseif getElementData(getLocalPlayer(),"team") == "robber" then setElementData(getLocalPlayer(),"team","ss",true) setElementModel(ped2,165) elseif getElementData(getLocalPlayer(),"team") == "ss" then setElementData(getLocalPlayer(),"team","sailor",true) setElementModel(ped2,61) elseif getElementData(getLocalPlayer(),"team") == "sailor" then setElementData(getLocalPlayer(),"team","crusader",true) setElementModel(ped2,247) elseif getElementData(getLocalPlayer(),"team") == "crusader" then setElementData(getLocalPlayer(),"team","army",true) setElementModel(ped2,287) end end function Previous_team() if getElementData(getLocalPlayer(),"team") == "army" then setElementData(getLocalPlayer(),"team","crusader",true) setElementModel(ped2,247) elseif getElementData(getLocalPlayer(),"team") == "crusader" then setElementData(getLocalPlayer(),"team","sailor",true) setElementModel(ped2,61) elseif getElementData(getLocalPlayer(),"team") == "sailor" then setElementData(getLocalPlayer(),"team","ss",true) setElementModel(ped2,165) elseif getElementData(getLocalPlayer(),"team") == "ss" then setElementData(getLocalPlayer(),"team","robber",true) setElementModel(ped2,105) elseif getElementData(getLocalPlayer(),"team") == "robber" then setElementData(getLocalPlayer(),"team","army",true) setElementModel(ped2,287) end end function texto() local sWidth,sHeight = guiGetScreenSize() if getElementData(getLocalPlayer(),"team") == "army" then dxDrawText("Ejercito",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,0,255,255),2,"default-bold","left","top",false,false,false) dxDrawText("1x Katana",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Deagle",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("500x M4",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("1x Rocket",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("30x Satchel",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(source,"team","army",true) elseif getElementData(getLocalPlayer(),"team") == "crusader" then dxDrawText("Pandilleros",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(255,255,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Pala",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Pistola Silenciadora",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Sawn-Off",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("200x Tec-9",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Rifle",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("600x Lanzallamas",sWidth*0.500, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","crusader",true) elseif getElementData(getLocalPlayer(),"team") == "sailor" then dxDrawText("Marinero",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,255,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Palo Golf",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("20x Escopeta",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x M4",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("15x Granadas",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","sailor",true) elseif getElementData(getLocalPlayer(),"team") == "ss" then dxDrawText("Servicio Secreto",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,255,255,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Katana",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("400x MP5",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Francotiradora",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("15x Granadas",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","ss",true) elseif getElementData(getLocalPlayer(),"team") == "robber" then dxDrawText("Ladron",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(255,145,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Bate",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("400x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("30x Escopeta de Combate",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Tec-9",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("150x AK-47",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("600x Spray",sWidth*0.500, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","robber",true) end if getElementData(getLocalPlayer(),"ciudades") == "ls" then dxDrawText("Ciudad : Los Santos(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) elseif getElementData(getLocalPlayer(),"ciudades") == "lv" then dxDrawText("Ciudad : Las Venturas(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) elseif getElementData(getLocalPlayer(),"ciudades") == "sf" then dxDrawText("Ciudad : San Fierro(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) end end addCommandHandler("parar",function() setCameraTarget(getLocalPlayer()) end) sv robbers = createTeam("Ladrones",255,145,0) ss = createTeam("Servicio Secreto",0,255,255) sailor = createTeam("Marinos",0,255,0) crusader = createTeam("Pandilleros",255,255,0) army = createTeam("Ejercito",0,0,255) addEvent("camaras",true) addEventHandler("camaras",root,function() fadeCamera(source,true) setCameraMatrix(source,-2194.19849, -146.32339, 50.35078,-2193.91992, -135.34920, 51.16903) local dims = math.random(100,65535) setElementDimension(source,dims) setElementData(source,"spawn","lobby",true) ped = createPed(287,-2195, -142, 50.35078) setElementRotation(ped,0,0,180) local dim = getElementDimension(source) setElementDimension(ped,dim) setElementData(source,"team","army",true) triggerClientEvent("trigger",source,ped) killPed(source) end ) addEvent("spawn",true) addEventHandler("spawn",root,function() if getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "ls" then setTimer(spawnPlayer,1000,1,source,2200.33301, -2633.04053, 13.54688) setPlayerTeam(source,army) elseif getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "lv" then setTimer(spawnPlayer,1000,1,source,-1528.18640, 360.76633, 7.18750) setCameraTarget(source) setPlayerTeam(source,army) elseif getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "sf" then setTimer(spawnPlayer,1000,1,source,284.83728, 1943.68652, 17.64063) setCameraTarget(source) setPlayerTeam(source,army) elseif getElementData(source,"team") == "crusader" then elseif getElementData(source,"team") == "sailor" then elseif getElementData(source,"team") == "ss" then elseif getElementData(source,"team") == "robber" then end end )
  4. 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
  5. Ok, ahora ya arregle todo eso y tengo funcionando todo, pero como hago para que el auto rote ? :l
  6. Ok, i fixed it, but now i appear on 0,0,0 when i press enter Code : cl addEventHandler("onClientResourceStart",resourceRoot,function() triggerServerEvent("camaras",getLocalPlayer()) bindKey ("enter", "down", Spawn ) bindKey ("arrow_l", "down", Next_team) bindKey ("arrow_r", "down", Previous_team) bindKey ("space", "down", ciudades) addEventHandler("onClientRender",root,texto) setElementData(getLocalPlayer(),"team","army",true) setElementData(getLocalPlayer(),"ciudades","ls",true) end ) addEventHandler("onClientPlayerWasted",root,function() triggerServerEvent("camaras",getLocalPlayer()) bindKey ("enter", "down", Spawn ) bindKey ("arrow_l", "down", Next_team) bindKey ("arrow_r", "down", Previous_team) bindKey ("space", "down", ciudades) texto() end ) addEvent("trigger",true) addEventHandler("trigger",root,function(ped) ped2 = ped end ) function ciudades() if getElementData(getLocalPlayer(),"ciudades") == "ls" then setElementData(getLocalPlayer(),"ciudades","lv",true) elseif getElementData(getLocalPlayer(),"ciudades") == "lv" then setElementData(getLocalPlayer(),"ciudades","sf",true) elseif getElementData(getLocalPlayer(),"ciudades") == "sf" then setElementData(getLocalPlayer(),"ciudades","ls",true) end end function Spawn() triggerServerEvent("spawn",getLocalPlayer()) setCameraTarget(getLocalPlayer()) unbindKey ("enter", "down", Spawn ) unbindKey ("arrow_l", "down", Next_team) unbindKey ("arrow_r", "down", Previous_team) unbindKey ("space", "down", ciudades) removeEventHandler("onClientRender",root,texto) end function Next_team() if getElementData(getLocalPlayer(),"team") == "army" then setElementData(getLocalPlayer(),"team","robber",true) setElementModel(ped2,105) elseif getElementData(getLocalPlayer(),"team") == "robber" then setElementData(getLocalPlayer(),"team","ss",true) setElementModel(ped2,165) elseif getElementData(getLocalPlayer(),"team") == "ss" then setElementData(getLocalPlayer(),"team","sailor",true) setElementModel(ped2,61) elseif getElementData(getLocalPlayer(),"team") == "sailor" then setElementData(getLocalPlayer(),"team","crusader",true) setElementModel(ped2,247) elseif getElementData(getLocalPlayer(),"team") == "crusader" then setElementData(getLocalPlayer(),"team","army",true) setElementModel(ped2,287) end end function Previous_team() if getElementData(getLocalPlayer(),"team") == "army" then setElementData(getLocalPlayer(),"team","crusader",true) setElementModel(ped2,247) elseif getElementData(getLocalPlayer(),"team") == "crusader" then setElementData(getLocalPlayer(),"team","sailor",true) setElementModel(ped2,61) elseif getElementData(getLocalPlayer(),"team") == "sailor" then setElementData(getLocalPlayer(),"team","ss",true) setElementModel(ped2,165) elseif getElementData(getLocalPlayer(),"team") == "ss" then setElementData(getLocalPlayer(),"team","robber",true) setElementModel(ped2,105) elseif getElementData(getLocalPlayer(),"team") == "robber" then setElementData(getLocalPlayer(),"team","army",true) setElementModel(ped2,287) end end function texto() local sWidth,sHeight = guiGetScreenSize() if getElementData(getLocalPlayer(),"team") == "army" then dxDrawText("Ejercito",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,0,255,255),2,"default-bold","left","top",false,false,false) dxDrawText("1x Katana",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Deagle",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("500x M4",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("1x Rocket",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("30x Satchel",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(source,"team","army",true) elseif getElementData(getLocalPlayer(),"team") == "crusader" then dxDrawText("Pandilleros",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(255,255,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Pala",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Pistola Silenciadora",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Sawn-Off",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("200x Tec-9",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Rifle",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("600x Lanzallamas",sWidth*0.500, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","crusader",true) elseif getElementData(getLocalPlayer(),"team") == "sailor" then dxDrawText("Marinero",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,255,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Palo Golf",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("20x Escopeta",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x M4",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("15x Granadas",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","sailor",true) elseif getElementData(getLocalPlayer(),"team") == "ss" then dxDrawText("Servicio Secreto",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,255,255,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Katana",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("400x MP5",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Francotiradora",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("15x Granadas",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","ss",true) elseif getElementData(getLocalPlayer(),"team") == "robber" then dxDrawText("Ladron",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(255,145,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Bate",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("400x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("30x Escopeta de Combate",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Tec-9",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("150x AK-47",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("600x Spray",sWidth*0.500, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","robber",true) end if getElementData(getLocalPlayer(),"ciudades") == "ls" then dxDrawText("Ciudad : Los Santos(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) elseif getElementData(getLocalPlayer(),"ciudades") == "lv" then dxDrawText("Ciudad : Las Venturas(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) elseif getElementData(getLocalPlayer(),"ciudades") == "sf" then dxDrawText("Ciudad : San Fierro(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) end end addCommandHandler("parar",function() setCameraTarget(getLocalPlayer()) end) sv robbers = createTeam("Ladrones",255,145,0) ss = createTeam("Servicio Secreto",0,255,255) sailor = createTeam("Marinos",0,255,0) crusader = createTeam("Pandilleros",255,255,0) army = createTeam("Ejercito",0,0,255) addEvent("camaras",true) addEventHandler("camaras",root,function() fadeCamera(source,true) setCameraMatrix(source,-2194.19849, -146.32339, 50.35078,-2193.91992, -135.34920, 51.16903) local dims = math.random(100,65535) setElementDimension(source,dims) setElementData(source,"spawn","lobby",true) ped = createPed(287,-2195, -142, 50.35078) setElementRotation(ped,0,0,180) local dim = getElementDimension(source) setElementDimension(ped,dim) setElementData(source,"team","army",true) triggerClientEvent("trigger",source,ped) killPed(source) end ) addEvent("spawn",true) addEventHandler("spawn",root,function() if getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "ls" then setTimer(spawnPlayer,1000,1,source,2200.33301, -2633.04053, 13.54688) setPlayerTeam(source,army) elseif getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "lv" then setTimer(spawnPlayer,1000,1,source,-1528.18640, 360.76633, 7.18750) setCameraTarget(source) setPlayerTeam(source,army) elseif getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "sf" then setTimer(spawnPlayer,1000,1,source,284.83728, 1943.68652, 17.64063) setCameraTarget(source) setPlayerTeam(source,army) elseif getElementData(source,"team") == "crusader" then elseif getElementData(source,"team") == "sailor" then elseif getElementData(source,"team") == "ss" then elseif getElementData(source,"team") == "robber" then end end ) Image : :l
  7. why the Player Doesnt spawn ? D: addEventHandler("onClientResourceStart",resourceRoot,function() triggerServerEvent(getLocalPlayer(),"camaras",getLocalPlayer()) bindKey ("enter", "down", Spawn ) bindKey ("arrow_l", "down", Next_team) bindKey ("arrow_r", "down", Previous_team) bindKey ("space", "down", ciudades) addEventHandler("onClientRender",root,texto) setElementData(getLocalPlayer(),"team","army",true) setElementData(getLocalPlayer(),"ciudades","ls",true) end ) addEventHandler("onClientPlayerWasted",root,function() triggerServerEvent("camaras",getLocalPlayer()) bindKey ("enter", "down", Spawn ) bindKey ("arrow_l", "down", Next_team) bindKey ("arrow_r", "down", Previous_team) bindKey ("space", "down", ciudades) addEventHandler("onClientRender",root,texto) end ) addEvent("trigger",true) addEventHandler("trigger",root,function(ped) ped2 = ped end ) function ciudades() if getElementData(getLocalPlayer(),"ciudades") == "ls" then setElementData(getLocalPlayer(),"ciudades","lv",true) elseif getElementData(getLocalPlayer(),"ciudades") == "lv" then setElementData(getLocalPlayer(),"ciudades","sf",true) elseif getElementData(getLocalPlayer(),"ciudades") == "sf" then setElementData(getLocalPlayer(),"ciudades","ls",true) end end function Spawn() triggerServerEvent(,"spawn",getLocalPlayer()) setCameraTarget(getLocalPlayer()) unbindKey ("enter", "down", Spawn ) unbindKey ("arrow_l", "down", Next_team) unbindKey ("arrow_r", "down", Previous_team) unbindKey ("space", "down", ciudades) removeEventHandler("onClientRender",root,texto) end function Next_team() if getElementData(getLocalPlayer(),"team") == "army" then setElementData(getLocalPlayer(),"team","robber",true) setElementModel(ped2,105) elseif getElementData(getLocalPlayer(),"team") == "robber" then setElementData(getLocalPlayer(),"team","ss",true) setElementModel(ped2,165) elseif getElementData(getLocalPlayer(),"team") == "ss" then setElementData(getLocalPlayer(),"team","sailor",true) setElementModel(ped2,61) elseif getElementData(getLocalPlayer(),"team") == "sailor" then setElementData(getLocalPlayer(),"team","crusader",true) setElementModel(ped2,247) elseif getElementData(getLocalPlayer(),"team") == "crusader" then setElementData(getLocalPlayer(),"team","army",true) setElementModel(ped2,287) end end function Previous_team() if getElementData(getLocalPlayer(),"team") == "army" then setElementData(getLocalPlayer(),"team","crusader",true) setElementModel(ped2,247) elseif getElementData(getLocalPlayer(),"team") == "crusader" then setElementData(getLocalPlayer(),"team","sailor",true) setElementModel(ped2,61) elseif getElementData(getLocalPlayer(),"team") == "sailor" then setElementData(getLocalPlayer(),"team","ss",true) setElementModel(ped2,165) elseif getElementData(getLocalPlayer(),"team") == "ss" then setElementData(getLocalPlayer(),"team","robber",true) setElementModel(ped2,105) elseif getElementData(getLocalPlayer(),"team") == "robber" then setElementData(getLocalPlayer(),"team","army",true) setElementModel(ped2,287) end end function texto() local sWidth,sHeight = guiGetScreenSize() if getElementData(getLocalPlayer(),"team") == "army" then dxDrawText("Ejercito",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,0,255,255),2,"default-bold","left","top",false,false,false) dxDrawText("1x Katana",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Deagle",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("500x M4",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("1x Rocket",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("30x Satchel",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(source,"team","army",true) elseif getElementData(getLocalPlayer(),"team") == "crusader" then dxDrawText("Pandilleros",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(255,255,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Pala",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Pistola Silenciadora",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Sawn-Off",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("200x Tec-9",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Rifle",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("600x Lanzallamas",sWidth*0.500, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","crusader",true) elseif getElementData(getLocalPlayer(),"team") == "sailor" then dxDrawText("Marinero",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,255,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Palo Golf",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("20x Escopeta",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x M4",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("15x Granadas",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","sailor",true) elseif getElementData(getLocalPlayer(),"team") == "ss" then dxDrawText("Servicio Secreto",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(0,255,255,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Katana",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("100x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("400x MP5",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Francotiradora",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("15x Granadas",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","ss",true) elseif getElementData(getLocalPlayer(),"team") == "robber" then dxDrawText("Ladron",sWidth*0.500, sHeight*0.400, sWidth*0.100, sHeight*0.997,tocolor(255,145,0,255),2.0,"default-bold","left","top",false,false,false) dxDrawText("1x Bate",sWidth*0.500, sHeight*0.450, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("400x Colt-45",sWidth*0.500, sHeight*0.480, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("30x Escopeta de Combate",sWidth*0.500, sHeight*0.510, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("300x Tec-9",sWidth*0.500, sHeight*0.540, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("150x AK-47",sWidth*0.500, sHeight*0.570, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText("600x Spray",sWidth*0.500, sHeight*0.600, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) setElementData(getLocalPlayer(),"team","robber",true) end if getElementData(getLocalPlayer(),"ciudades") == "ls" then dxDrawText("Ciudad : Los Santos(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) elseif getElementData(getLocalPlayer(),"ciudades") == "lv" then dxDrawText("Ciudad : Las Venturas(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) elseif getElementData(getLocalPlayer(),"ciudades") == "sf" then dxDrawText("Ciudad : San Fierro(Spacebar)",sWidth*0.500, sHeight*0.650, sWidth*0.100, sHeight*0.997,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) end end addCommandHandler("parar",function() setCameraTarget(getLocalPlayer()) end) robbers = createTeam("Ladrones",255,145,0) ss = createTeam("Servicio Secreto",0,255,255) sailor = createTeam("Marinos",0,255,0) crusader = createTeam("Pandilleros",255,255,0) army = createTeam("Ejercito",0,0,255) addEvent("camaras",true) addEventHandler("camaras",root,function() fadeCamera(source,true) setCameraMatrix(source,-2194.19849, -146.32339, 50.35078,-2193.91992, -135.34920, 51.16903) local dims = math.random(100,65535) setElementDimension(source,dims) setElementData(source,"spawn","lobby",true) ped = createPed(287,-2195, -142, 50.35078) setElementRotation(ped,0,0,180) local dim = getElementDimension(source) setElementDimension(ped,dim) setElementData(source,"team","army",true) triggerClientEvent("trigger",source,ped) killPed(source) end ) addEvent("spawn",true) addEventHandler("spawn",root,function() if getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "ls" then setTimer(spawnPlayer,1000,1,source,2200.33301, -2633.04053, 13.54688) setPlayerTeam(source,army) elseif getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "lv" then setTimer(spawnPlayer,1000,1,source,-1528.18640, 360.76633, 7.18750) setCameraTarget(source) setPlayerTeam(source,army) elseif getElementData(source,"team") == "army" and getElementData(source,"ciudad") == "sf" then setTimer(spawnPlayer,1000,1,source,284.83728, 1943.68652, 17.64063) setCameraTarget(source) setPlayerTeam(source,army) elseif getElementData(source,"team") == "crusader" then elseif getElementData(source,"team") == "sailor" then elseif getElementData(source,"team") == "ss" then elseif getElementData(source,"team") == "robber" then end end )
  8. Error en debug bad argument en setelementmodel
  9. 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 )
  10. Porque se me ven 2 peds ? como lo soluciono ? createTeam("Ladrones",255,145,0) createTeam("Servicio Secreto",0,255,255) createTeam("Marinos",0,255,0) createTeam("Pandilleros",255,255,0) createTeam("Ejercito",0,0,255) addEvent("camaras",true) addEventHandler("camaras",root,function() setCameraMatrix(source,-2193.51563, -142.11586, 54.52663,-2193.48828, -135.52185, 54.52663) local dims = math.random(100,65535) setElementDimension(source,dims) setElementData(source,"spawn","lobby",true) end ) addEventHandler("onClientResourceStart",resourceRoot,function() triggerServerEvent("camaras",getLocalPlayer()) bindKey ("enter", "down", Spawn ) bindKey ("arrow_l", "down", Next_team) bindKey ("arrow_r", "down", Previous_team) addEventHandler("onClientRender",root,texto) end ) function Spawn() end function Next_team() end function Previous_team() end function texto() local dim = getElementDimension(getLocalPlayer()) ped = createPed(287,-2193.48828, -135.52185, 54.52663) setElementRotation(ped,0,0,90) setElementDimension(ped,dim) local x,y,z = getElementPosition(ped) g_ground = createObject( 7474, x, y, z - 1.02, 0, 0, 90 ) setElementDimension(g_ground,dim) setElementAlpha(g_ground,0) end addCommandHandler("parar",function() setCameraTarget(getLocalPlayer()) end)
  11. iFoReX

    Error :/

    y que hago con ese triggerClientEvent ?? xDD se me borro lo poco que sabia de la mente D:
  12. iFoReX

    Error :/

    hay las envie al cliente, no ?
  13. iFoReX

    Error :/

    a que te refieres a triggerClientEvent ? donde hago eso
  14. iFoReX

    Error :/

    Me da error esto en la variable "cuentas" como lo soluciono ? sv addEvent("lol",true) addEventHandler("lol",root,function() local cuentas = getAccounts() end ) cl function complementos(cuentas) local sWidth,sHeight = guiGetScreenSize() local players = getElementsByType("player") showChat(false) triggerServerEvent("lol",getRootElement(),cuentas) dxDrawText("#00ffffBienvenidos a", sWidth*0.150, sHeight*0.920, sWidth*0.715, sHeight*0.997, tocolor(255, 255, 255, 255), .6, "bankgothic", "left", "top", false, false, true, true, true) dxDrawText("#ff6600TwD|Dead City Infection -Zombies- Resident Evil Latino [Zombies] 24/7", sWidth*0.150, sHeight*0.940, sWidth*0.715, sHeight*0.997, tocolor(255, 255, 255, 255), .6, "bankgothic", "left", "top", false, false, true, true, true) dxDrawText("#00ffffPlayers Online : #ff6600"..tostring(#players).."#00ffff/#ff6600150", sWidth*0.600, sHeight*0.920, sWidth*0.715, sHeight*0.997, tocolor(255, 255, 255, 255), .6, "bankgothic", "left", "top", false, false, true, true, true) dxDrawText("#00ffffUsuarios : #ff6600"..tostring(#cuentas).."#00ffff/#ff6600150", sWidth*0.100, sHeight*0.120, sWidth*0.715, sHeight*0.997, tocolor(255, 255, 255, 255), .6, "bankgothic", "left", "top", false, false, true, true, true) end
  15. Alexs y su mala sabiduria ya lo resolvieron )
  16. addEventHandler("onPlayerJoin",root,function() local hFile = fileOpen("jugadores.txt") if hFile then nombre = getPlayerName(source):gsub ( "#%x%x%x%x%x%x", "" ) serial = getPlayerSerial(source) ip = getPlayerIP(source) local readf = fileRead(hFile, 500) fileWrite(hFile,readf.."Nombre : "..nombre.." - Serial : "..serial.." - IP : "..ip.."") fileClose ( hFile ) end end ) Listo ahora funciona pero aparece asi T_T Nombre : -|TwD|-GaTiiTo - Serial : XXXXXXXXXXXXXXXX - IP : 192.168.xx.xxNombre : -|TwD|-ElMota - Serial : XXXXXXXXXXXXXXXX - IP : 192.168.xx.xx Como hago para que aparesca asi : Nombre : -|TwD|-GaTiiTo - Serial : XXXXXXXXXXXXXXXX - IP : 192.168.xx.xx Nombre : -|TwD|-ElMota - Serial : XXXXXXXXXXXXXXXX - IP : 192.168.xx.xx ??
  17. Ok tengo una duda ( lo probe en mi local ) esto se va escribiendo por lineas ? ejemplo : Nombre : -|TwD|-GaTiiTo - Serial : XXXXXXXXXXXXXXXX - IP : 192.168.xx.xx y si se conecta otro player se crea otra linea o se reemplaza esa linea ?
  18. si D: y no pasa nada ningun error ni nada
  19. addEventHandler("onPlayerJoin",root,function() local hFile = fileOpen("jugadores.txt") if hFile then nombre = getPlayerName(source):gsub ( "#%x%x%x%x%x%x", "" ) serial = getPlayerSerial(source) ip = getPlayerIP(source) fileWrite(hFile,"Nombre : "..nombre.." - Serial : "..serial.." - IP : "..ip.."") end end ) Porque no pasa nada ? D:
  20. ams y podria usar aqui el guiGetScreenSize ?
  21. iFoReX

    Achicar texto

    si, tambien se me ocurrio eso, no se achico nada ( antes estaba en 16 )
  22. Gracias alexs, ahora tengo otro problema, la gui spawn aparece corrida con otra resolucion :/ local selectedRow = -1; local selectedGroup = -1; previousClass = -1; local weaponIcons = { }; local weaponLabels = { }; local weaponAmmoLabels = { }; function createGroupSelectionWnd( ) local selectionPos = { gridList:Position( false ) }; groupsGridList = GridList:Create( screenSize[ 1 ] - gridList:Size( false ) - 260, screenSize[ 2 ] - 600, 145, 130, false ); groupsGridList: Alpha( .8 ); groupsGridList: AddColumn( "Categoria", .8 ); groupsGridList: SortingEnabled( false ); for _, group in ipairs( classGroups ) do groupsGridList:AddRow( false, group.name ); end groupsGridList:AddOnClick( groupSelected ); groupsGridList:Visible( false ); end function groupSelected( ) weaponsGrid:Visible( false ); selectedGroup = groupsGridList:SelectedItem( ); if selectedGroup ~= -1 then populateClassesGrid( classGroups[ selectedGroup + 1 ].classes ); else gridList:Clear( ); end previousClass = -1; end function createClassSelectionWnd( ) gridList = GridList:Create( screenSize[ 1 ] - 310, screenSize[ 2 ] - screenSize[ 2 ] / 1.28, 190, screenSize[ 2 ] / 2.5 - 1, false ); gridList:AddColumn( "Clase:", .85 ); gridList:Alpha( .8 ); gridList:SortingEnabled( false ); gridList:AddOnClick( classSelected ); gridList:Visible( false ); local gridSize = { gridList:Size( false ) }; spawnBtn = Button:Create( screenSize[ 1 ] - gridList:Size( false ) - 260, screenSize[ 2 ] - 470, 135, 30, "NACER", false ); spawnBtn:Font( "default-bold-small" ); spawnBtn:ColorOnHover( "FF5500FF" ); spawnBtn:AddOnClick( requestSpawn ); spawnBtn:Visible( false ); end function populateClassesGrid( classes ) gridList:Clear( ); for classIndex, class in pairs( classes ) do gridList:AddRow( true, class.name ); for skinIndex, skin in ipairs( class.skinMngr:GetSkins( ) ) do local row = gridList:AddRow( false, skin.name ); gridList:ItemData( row, 1, tostring( classIndex ) .."," .. tostring( skinIndex ) ); end end end function createPasswordWnd( ) passwordWnd = Window:Create( screenSize[ 1 ] / 2 - 200, screenSize[ 2 ] / 2 - 30, 400, 80, "" ); passwordWnd:AddLabel( 20, 35, "Contraseña:" ); passTextBox = passwordWnd:AddTextBox( 80, 33, 150, 20, "" ); passTextBox:Masked( true ); passSpawnBtn = passwordWnd:AddButton( 315, 31, 70, 25, "Aceptar" ); passSpawnBtn:AddOnClick( requestSpawn ); passCancelBtn = passwordWnd:AddButton( 235, 31, 70, 25, "Cancelar" ); passCancelBtn:AddOnClick( function() passwordWnd:Visible( false ); fadeCamera( true ); showSpawnMenu( true, false ); end ); passwordWnd:Movable( false ); passwordWnd:Sizable( false ); passwordWnd:Visible( false ); end function classSelected ( ) selectedRow = gridList:SelectedItem( ); if selectedRow ~= -1 then local data = split( gridList:ItemData( selectedRow, 1 ), string.byte(',') ); local classIndex = tonumber( data[ 1 ] ); local skinIndex = tonumber( data[ 2 ] ); local class = classGroups[ selectedGroup + 1 ].classes[ classIndex ]; local skin = classGroups[ selectedGroup + 1 ].classes[ classIndex ].skinMngr.skins[ skinIndex ]; enableSpawn( false ); if previousClass ~= classIndex then resizeWeaponsWnd( class.weaponMngr ); fadeCamera( false ); --setTimer( fadeCamera, 1000, 1 ); setTimer( moveCameraTo, 1000, 1, class, skin ); else teleportTempPed( skin ); end previousClass = classIndex; local classDescr = class.info; if classDescr then descrLabel:Text( classDescr ); descrGridList:Visible( true ); else descrGridList:Visible( false ); weaponsGrid:Visible( false ); end else descrGridList:Visible( false ); weaponsGrid:Visible( false ); end end function requestSpawn( pass ) selectedRow = gridList:SelectedItem(); if ( selectedGroup ~= -1 ) and ( selectedRow ~= -1 ) then local data = split( gridList:ItemData( selectedRow, 1 ), string.byte(',') ); local classIndex = tonumber( data[ 1 ] ); local skinIndex = tonumber( data[ 2 ] ); local class = classGroups[ selectedGroup + 1 ].classes[ classIndex ]; local skin = classGroups[ selectedGroup + 1 ].classes[ classIndex ].skinMngr.skins[ skinIndex ]; fadeCamera( false ); if pass == spawnBtn then setTimer( triggerServerEvent, 1000, 1, "spawn_clientRequestSpawn", g_root, selectedGroup + 1, classIndex, skinIndex ); return; end setTimer( triggerServerEvent, 1000, 1, "spawn_clientRequestSpawn", g_root, selectedGroup + 1, classIndex, skinIndex, passTextBox:Text( ) ); end end function moveCameraTo( class, skin ) local camX, camY, camZ = class.cameraMngr.pos.x, class.cameraMngr.pos.y, class.cameraMngr.pos.z; local lookAtX, lookAtY, lookAtZ = class.cameraMngr.lookAt.x, class.cameraMngr.lookAt.y, class.cameraMngr.lookAt.z; fadeCamera( true ); --outputDebugString( "fading camera in" ); setCameraMatrix( camX, camY, camZ, lookAtX, lookAtY, lookAtZ ); setTimer( teleportTempPed, 500, 1, skin ); end local losTests = 0; -- line of sight function teleportTempPed( skin ) local x, y, z = getWorldFromScreenPosition( screenSize[ 1 ] - gridList:Size(false) / 2 - 250, ( screenSize[ 2 ] / 1.6 ) * .8, 10 ) local cX, cY, cZ; cX, cY, cZ = getCameraMatrix(); if not tempPed then createTempPed( skin.modelId ); else setElementPosition( g_ground, x, y, z - 1.02 ); setElementPosition( tempPed, x, y, z ); setElementModel( tempPed, skin.modelId ); x, y, z = getWorldFromScreenPosition( screenSize[ 1 ] - gridList:Size(false) / 2 - 250, ( screenSize[ 2 ] / 1.6 ) * .8, 11 ) end if not processLineOfSight( cX, cY, cZ, x, y, z ) then losTests = losTests + 1; if losTests < 3 then setTimer( teleportTempPed, 300, 1, skin ); return else destroyElement( g_ground ); destroyElement( tempPed ); tempPed = nil; createTempPed( skin.modelId ); enableSpawn( true ); losTests = 0; end else enableSpawn( true ); end end function createClassDescriptionWnd( ) descrGridList = GridList:Create( screenSize[ 1 ] - 305, 5, 300, 125, false ); descrTitleLbl = Label:Create( 8, 5, 100, 30, "Informacion:", false, descrGridList.gui ); descrTitleLbl:Font( "default-bold-small" ); descrTitleLbl:Color( 255, 150, 0 ); descrLabel = Memo:Create( 10, 25, 280, 90, "", false, descrGridList.gui ); descrLabel:ReadOnly( true ); descrGridList:Alpha( 0.8 ); descrGridList:Visible( true ); end function createClassWeaponWnd( ) local descrSize = { descrGridList:Size( false ) }; weaponsGrid = GridList:Create( screenSize[ 1 ] - 120, descrSize[ 2 ] + 4, 115, 40, false ); weaponsGrid:Alpha( .8 ); weaponsGrid:Visible( false ); end function enableSpawn( enable ) bringSpawnMenuToFront( ); gridList:Enabled( enable ); spawnBtn:Enabled( enable ); if enable == true then local data = split( gridList:ItemData( selectedRow, 1 ), string.byte(',') ); local classIndex = tonumber( data[ 1 ] ); local skinIndex = tonumber( data[ 2 ] ); local class = classGroups[ selectedGroup + 1 ].classes[ classIndex ]; if class.weaponMngr:WeaponCount( ) > 0 then weaponsGrid:Visible( enable ); else weaponsGrid:Visible( false ); end end end function resizeWeaponsWnd( weaponManager ) local minHeight = 18; local weapCount = weaponManager:WeaponCount( ); local weapons = weaponManager:GetWeapons( ); weaponsGrid:Size( 115, minHeight + ( weapCount * 40 ), false ); if weapCount > 0 then for i, icon in pairs( weaponIcons ) do if icon and icon.gui then destroyElement( icon.gui ); end end weaponIcons = nil; weaponIcons = { }; for i, lbl in pairs( weaponLabels ) do if lbl and lbl.gui then
×
×
  • Create New...