iFoReX Posted July 23, 2012 Posted July 23, 2012 porque cuando clickeo no me aparece el camera ? cl-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0,0.135,0.2575,0.6017,"Elige un Misil",true) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,23,188,243,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) col = guiGridListAddColumn(GUIEditor_Grid[1],"Misiles",0.2) GUIEditor_Button[1] = guiCreateButton(9,271,188,38,"Elegir",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,312,188,38,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0,0.135,0.1912,0.5217,"Opciones",true) GUIEditor_Button[4] = guiCreateButton(9,29,128,34,"Zoom +",false,GUIEditor_Window[2]) GUIEditor_Button[5] = guiCreateButton(9,70,128,34,"Zoom -",false,GUIEditor_Window[2]) GUIEditor_Button[6] = guiCreateButton(9,158,43,41,"<",false,GUIEditor_Window[2]) GUIEditor_Button[7] = guiCreateButton(49,121,43,41,"^",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(89,157,43,41,">",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(50,196,43,41,"v",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(9,264,133,34,"Cancelar",false,GUIEditor_Window[2]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) showCursor(false) local marker = createMarker(213.9440612793, 1818.9245605469, 5.9,"cylinder",1,0,120,0,140) addEventHandler("onClientMarkerHit",root,function(hitPlayer, matchingDimension) if hitPlayer == getLocalPlayer() then if source == marker then guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end end end ) addEventHandler("onClientResourceStart",resourceRoot,function() local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1],row,col,"LanzaMisil 1",false,false) end ) addEventHandler("onClientClick",root,function() if source == GUIEditor_Grid[1] then local rx,cx = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if guiGridListGetItemText(GUIEditor_Grid[1],rx,cx) == "LanzaMisil 1" then triggerServerEvent("CameraM1",getLocalPlayer()) end end end ) addEventHandler("onClientGUIClick",root,function() if source == GUIEditor_Button[3] then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) elseif source == GUIEditor_Button[1] then guiSetVisible(GUIEditor_Window[2],true) guiSetVisible(GUIEditor_Window[1],false) elseif source == GUIEditor_Button[10] then setCameraTarget(getLocalPlayer()) guiSetVisible(GUIEditor_Window[1],true) guiSetVisible(GUIEditor_Window[2],false) end end ) sv-side addEvent("CameraM1",true) addEventHandler("CameraM1",root,function() setCameraMatrix(source,226.38482666016, 2045.6298828125, 32.410900115967,189.95697021484, 2081.3354492188, 22.640625) end )
Soren Posted July 23, 2012 Posted July 23, 2012 function cameram1function() setCameraMatrix(source,226.38482666016, 2045.6298828125, 32.410900115967,189.95697021484, 2081.3354492188, 22.640625) end addEvent("CameraM1",true) addEventHandler("CameraM1",root,cameram1function) Prueva asi el sv side
iFoReX Posted July 23, 2012 Author Posted July 23, 2012 mm Ok aunque no creo que sea el error, ya que antes me habia equivocado y lo habia puesto con el boton y si funcionaba ahora no funciona
Soren Posted July 23, 2012 Posted July 23, 2012 mm Ok aunque no creo que sea el error, ya que antes me habia equivocado y lo habia puesto con el boton y si funcionaba ahora no funciona prueba aun asi
iFoReX Posted July 23, 2012 Author Posted July 23, 2012 probe y no funciona, ahora probe con esto : addEventHandler( 'onClientGUIClick', GUIEditor_Grid[1], function( ) local nRow, nColumn = guiGridListGetSelectedItem( source ) if nRow == 0 and nColumn == 0 then triggerServerEvent(getLocalPlayer(),"CameraM1",getLocalPlayer()) end end ) pero sigue sin funcionar
Castillo Posted July 23, 2012 Posted July 23, 2012 addEventHandler( 'onClientGUIClick', GUIEditor_Grid[1], function( ) local nRow, nColumn = guiGridListGetSelectedItem( source ) if nRow == 0 and nColumn == 0 then triggerServerEvent("CameraM1",getLocalPlayer()) end end ) El primer argumento es el nombre del evento.
Alexs Posted July 23, 2012 Posted July 23, 2012 addEventHandler( 'onClientGUIClick', GUIEditor_Grid[1], function( ) local nRow,nColumn = guiGridListGetSelectedItem( source ) if nRow == 0 and nColumn == 0 then triggerServerEvent("CameraM1",getLocalPlayer()) end end ) Creo que no se pueden usar espacios en las variables
iFoReX Posted July 23, 2012 Author Posted July 23, 2012 ya arregle ese problema, ahora me podrian ayudar con esto ? el misil no se dispara cl-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0,0.135,0.2575,0.6017,"Elige un Misil",true) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,23,188,243,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) col = guiGridListAddColumn(GUIEditor_Grid[1],"Misiles",0.-- s8) --> GUIEditor_Button[1] = guiCreateButton(9,271,188,38,"Elegir",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,312,188,38,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0,0.135,0.1912,0.5217,"Opciones",true) GUIEditor_Button[6] = guiCreateButton(9,158,43,41,"<",false,GUIEditor_Window[2]) GUIEditor_Button[7] = guiCreateButton(49,121,43,41,"^",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(89,157,43,41,">",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(50,196,43,41,"v",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(9,264,133,34,"Cancelar",false,GUIEditor_Window[2]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) showCursor(false) local marker = createMarker(213.9440612793, 1818.9245605469, 5.9,"cylinder",1,0,120,0,140) addEventHandler("onClientMarkerHit",root,function(hitPlayer, matchingDimension) if hitPlayer == getLocalPlayer() then if source == marker then guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end end end ) addEventHandler("onClientResourceStart",resourceRoot,function() local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1],row,col,"LanzaMisil 1",false,false) end ) addEventHandler("onClientGUIClick",root,function() if source == GUIEditor_Button[3] then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) elseif source == GUIEditor_Button[1] then local xr,xc = guiGridListGetSelectedItem(GUIEditor_Grid[1]) local item = guiGridListGetItemText(GUIEditor_Grid[1],xr,xc) if item == 'LanzaMisil 1' then triggerServerEvent("CameraM1",getLocalPlayer()) guiSetVisible(GUIEditor_Window[2],true) guiSetVisible(GUIEditor_Window[1],false) addEventHandler("onClientClick",root,tirar) end elseif source == GUIEditor_Button[10] then setCameraTarget(getLocalPlayer()) guiSetVisible(GUIEditor_Window[1],true) guiSetVisible(GUIEditor_Window[2],false) elseif source == GUIEditor_Button[6] then triggerServerEvent("moveLeft",getLocalPlayer()) elseif source == GUIEditor_Button[7] then triggerServerEvent("moveUp",getLocalPlayer()) elseif source == GUIEditor_Button[8] then triggerServerEvent("moveRight",getLocalPlayer()) elseif source == GUIEditor_Button[9] then triggerServerEvent("moveDown",getLocalPlayer()) end end ) function tirar(CursorX,CursorY,CursorZ) local cursorX,cursorY,cursorZ,worldX,worldY,worldZ = getCursorPosition() if not createProjectile(getLocalPlayer(),19,CursorX,CursorY,CursorZ) then outputChatBox("el misil no se pudo crear",getLocalPlayer()) end end sv-side addEvent("CameraM1",true) addEventHandler("CameraM1",root,function() local camera = setCameraMatrix(source,189.95697021484, 2081.3354492188, 26,226.38482666016, 2045.6298828125, 32.410900115967) end ) addEvent("moveLeft",true) addEventHandler("moveLeft",root,function() local x,y,z,lx,ly,lz = getCameraMatrix(source) setCameraMatrix(source,x,y,z,lx,ly+5,lz) end ) addEvent("moveUp",true) addEventHandler("moveUp",root,function() local x,y,z,lx,ly,lz = getCameraMatrix(source) setCameraMatrix(source,x,y,z,lx,ly,lz+5) end ) addEvent("moveRight",true) addEventHandler("moveRight",root,function() local x,y,z,lx,ly,lz = getCameraMatrix(source) setCameraMatrix(source,x,y,z,lx,ly-5,lz) end ) addEvent("moveDown",true) addEventHandler("moveDown",root,function() local x,y,z,lx,ly,lz = getCameraMatrix(source) setCameraMatrix(source,x,y,z,lx,ly,lz-5) end )
Recommended Posts