-
Posts
1,708 -
Joined
-
Last visited
Everything posted by iFoReX
-
"BryaaanLOL usa hack" descripcionR="bueno amigos BryaanLOL usa hack." creadorR="ElMota" estadoR="no leido"> it name is a random name for the motivoR
-
solid bad argument lines 21,22,23,24,25 sv-side
-
no creo que sea tan dificil, con addCommandHandler, setElementFrozen, getPlayerFromName, setElementPosition, setTimer, outputChatBox
-
, si no sabes nada, entonces empieza por cosas mas faciles :3, yo empeze con rejas, un GUI Spawn con teams privados no es como algo para empezar, aqui unos links : para hacer la GUI : https://wiki.multitheftauto.com/wiki/GuiCreateWindow para hacer los botones : https://wiki.multitheftauto.com/wiki/GuiCreateButton para hacer visible la GUI : https://wiki.multitheftauto.com/wiki/GuiSetVisible evento onClientResourceStart ( si quieres que se muestre cuando se inicie el resource ) : https://wiki.multitheftauto.com/wiki/OnC ... ourceStart para que los players aparescan : https://wiki.multitheftauto.com/wiki/SpawnPlayer evento para cuando presiones el boton : https://wiki.multitheftauto.com/wiki/OnClientGUIClick triggear el evento server-side a la funcion del evento onClientGUIClick para que cuando se presione el boton se trigge esta : https://wiki.multitheftauto.com/wiki/TriggerServerEvent para crear el team : https://wiki.multitheftauto.com/wiki/CreateTeam para asignarle al player el team : https://wiki.multitheftauto.com/wiki/SetPlayerTeam para asignarle un skin al player : https://wiki.multitheftauto.com/wiki/SetElementModel para asignarle armas : https://wiki.multitheftauto.com/wiki/GiveWeapon para ver si el Player es del team Admin ( le haces con un if ) en esta pagina hay un ejemplo : https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup espero averte ayudado, cuando termines tu script, lo pones aqui cualquier duda
-
now I have bad arguments in 4-5-6-7-8-9 lines XML, ( the child and attributes lines )
-
Ok , here is it motivoTest.xml "motivoTest" descripcionR="descripcionTest" creadorR="ElMota" estadoR="no leido">
-
local contenido = xmlCreateChild( reporteXML, "reporte:" ) yeh it is with ':' local contenido = xmlFindChild( reporte, "reporte:" )
-
now what is bad in it ? I have bad argument in lines : 21, 22, 23, 24, 25 server-side script codes cl-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} numeroR = 0 GUIEditor_Window[1] = guiCreateWindow(290,102,773,586,"Reportes GUI",false) GUIEditor_Label[1] = guiCreateLabel(21,39,514,21,"Bueno amigos esta GUI esta echa para que pongan sus reportes y pedidos acerca del server",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(18,66,406,22,"Tu numero de reportes es .. xmlNodeGetAttribute( reportes, \"numero\" )",false,GUIEditor_Window[1]) GUIEditor_Grid[1] = guiCreateGridList(13,100,743,417,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) CNumero = guiGridListAddColumn(GUIEditor_Grid[1],"#",0.1) CMotivo = guiGridListAddColumn(GUIEditor_Grid[1],"Motivo",0.4) CEstado = guiGridListAddColumn(GUIEditor_Grid[1],"Estado",0.1) CCreador = guiGridListAddColumn(GUIEditor_Grid[1],"Creador",0.3) GUIEditor_Button[1] = guiCreateButton(471,527,135,47,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(610,527,135,47,"Crear nuevo reporte",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(12,522,139,55,"Leer Reporte",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(445,252,493,344,"Creacion del reporte",false) GUIEditor_Label[3] = guiCreateLabel(220,32,37,18,"Motivo",false,GUIEditor_Window[2]) GUIEditor_Edit[1] = guiCreateEdit(25,59,436,31,"",false,GUIEditor_Window[2]) GUIEditor_Label[4] = guiCreateLabel(209,106,61,20,"Descripcion",false,GUIEditor_Window[2]) GUIEditor_Memo[1] = guiCreateMemo(24,139,437,125,"",false,GUIEditor_Window[2]) GUIEditor_Button[4] = guiCreateButton(333,275,121,49,"Crear !",false,GUIEditor_Window[2]) GUIEditor_Button[5] = guiCreateButton(205,275,121,49,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(456,228,482,353,"xmlNodeGetAttribute( reportes, 'motivo' )",false) GUIEditor_Memo[2] = guiCreateMemo(18,105,442,192,"",false,GUIEditor_Window[3]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Button[6] = guiCreateButton(311,305,142,32,"Volver",false,GUIEditor_Window[3]) GUIEditor_Button[7] = guiCreateButton(169,309,131,26,"Borrar",false,GUIEditor_Window[3]) GUIEditor_Edit[3] = guiCreateEdit(20,48,436,33,"",false,GUIEditor_Window[3]) guiEditSetReadOnly(GUIEditor_Edit[3],true) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) guiSetVisible(GUIEditor_Window[3],false) guiSetVisible(GUIEditor_Button[3],false) showCursor(false) addCommandHandler("reportar", function() guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) elseif source == GUIEditor_Button[2] then guiSetVisible(GUIEditor_Window[2],true) guiSetVisible(GUIEditor_Window[1],false) elseif source == GUIEditor_Button[4] then local motivo = guiGetText(GUIEditor_Edit[1]) local descripcion = guiGetText(GUIEditor_Memo[1]) local yo = getLocalPlayer() if motivo ~= '' or descripcion ~= '' then triggerServerEvent("crear:Report", localPlayer, motivo, descripcion, yo) addEventHandler("onClientGUIClick",root,crearReporte) elseif motivo == '' or descripcion == '' then outputChatBox("porfavor completa todos los espacios", yo) end elseif source == GUIEditor_Button[5] then guiSetVisible(GUIEditor_Window[1],true) guiSetVisible(GUIEditor_Window[2],false) end end ) function crearReporte() local motivo = guiGetText(GUIEditor_Edit[1]) local descripcion = guiGetText(GUIEditor_Memo[1]) if source == GUIEditor_Button[4] and motivo ~= '' and descripcion ~= '' then triggerServerEvent("crearRow", localPlayer, motivo) addEventHandler("crear:Reporte:",root, obtenerXML) end end addEvent("crear:Reporte:",true) function obtenerXML(motivoXML,creadorXML,estadoXML) if ( triggerServerEvent("crearRow", localPlayer,motivoXML,creadorXML,estadoXML) ) then local row = guiGridListAddRow( GUIEditor_Grid[1] ) local setText1 = guiGridListSetItemText(GUIEditor_Grid[1], row, CNumero, numeroR+1, false, false) local setText2 = guiGridListSetItemText(GUIEditor_Grid[1], row, CMotivo, motivoXML, false, false) local setText3 = guiGridListSetItemText(GUIEditor_Grid[1], row, CCreador, creadorXML, false, false) local setText4 = guiGridListSetItemText(GUIEditor_Grid[1], row, CEstado, estadoXML, false, false) if setText1 and setText2 and setText3 and setText4 then outputChatBox("el Row se ha creado exitosamente", getLocalPlayer()) end end end sv-side addEvent("crear:Report",true) addEventHandler("crear:Report",root,function( motivo, descripcion, yo) local reporteXML = xmlCreateFile( ":reportGUI/reportes/"..motivo..".xml", "reporte" ) local contenido = xmlCreateChild( reporteXML, "reporte:" ) local motivoXML = xmlNodeSetAttribute( contenido, "motivoR", motivo ) local descripcionXML = xmlNodeSetAttribute( contenido, "descripcionR", descripcion ) local creadorXML = xmlNodeSetAttribute( contenido, "creadorR", getPlayerName( yo ) ) local estadoXML = xmlNodeSetAttribute( contenido, "estadoR", 'no leido' ) xmlSaveFile(reporteXML) if ( reporteXML ) then outputChatBox("Reporte Creado Exitosamente, poniendolo en la lista de reportes...",source) addEventHandler("crearRow", root, crearRowF) end end ) addEvent("crearRow",true) function crearRowF(motivo) local reporte = xmlLoadFile( ":reportGUI/reportes/"..motivo..".xml") if ( reporte ) then local contenido = xmlFindChild( reporte, "reporte:" ) local motivoXML = xmlNodeGetAttribute( contenido, "motivoR" ) local descripcionXML = xmlNodeGetAttribute( contenido, "descripcionR" ) local creadorXML = xmlNodeGetAttribute( contenido, "creadorR" ) local estadoXML = xmlNodeGetAttribute( contenido, "estadoR" ) end end
-
Work , very thank Solid and Edikosh
-
ok. Then I need use root ? or what ?
-
tostring, work ?
-
Im starting to use XML Functions , and I want do a report GUI system XML, but I have a problem in debugging, the XML File doesnt create, and in debugscript appear triggerServerEvent bad argument 2 , expected element, got string 'the text of the Edit 1' here the codes cl-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(290,102,773,586,"Reportes GUI",false) GUIEditor_Label[1] = guiCreateLabel(21,39,514,21,"Bueno amigos esta GUI esta echa para que pongan sus reportes y pedidos acerca del server",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(18,66,406,22,"Tu numero de reportes es .. xmlNodeGetAttribute( reportes, \"numero\" )",false,GUIEditor_Window[1]) GUIEditor_Grid[1] = guiCreateGridList(13,100,743,417,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"#",0.1) guiGridListAddColumn(GUIEditor_Grid[1],"Motivo",0.4) guiGridListAddColumn(GUIEditor_Grid[1],"Estado",0.1) guiGridListAddColumn(GUIEditor_Grid[1],"Creador",0.3) GUIEditor_Button[1] = guiCreateButton(471,527,135,47,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(610,527,135,47,"Crear nuevo reporte",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(12,522,139,55,"Leer Reporte",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(445,252,493,344,"Creacion del reporte",false) GUIEditor_Label[3] = guiCreateLabel(220,32,37,18,"Motivo",false,GUIEditor_Window[2]) GUIEditor_Edit[1] = guiCreateEdit(25,59,436,31,"",false,GUIEditor_Window[2]) GUIEditor_Label[4] = guiCreateLabel(209,106,61,20,"Descripcion",false,GUIEditor_Window[2]) GUIEditor_Memo[1] = guiCreateMemo(24,139,437,125,"",false,GUIEditor_Window[2]) GUIEditor_Button[4] = guiCreateButton(333,275,121,49,"Crear !",false,GUIEditor_Window[2]) GUIEditor_Button[5] = guiCreateButton(205,275,121,49,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(456,228,482,353,"xmlNodeGetAttribute( reportes, 'motivo' )",false) GUIEditor_Memo[2] = guiCreateMemo(18,105,442,192,"",false,GUIEditor_Window[3]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Button[6] = guiCreateButton(311,305,142,32,"Volver",false,GUIEditor_Window[3]) GUIEditor_Button[7] = guiCreateButton(169,309,131,26,"Borrar",false,GUIEditor_Window[3]) GUIEditor_Edit[3] = guiCreateEdit(20,48,436,33,"",false,GUIEditor_Window[3]) guiEditSetReadOnly(GUIEditor_Edit[3],true) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) guiSetVisible(GUIEditor_Window[3],false) guiSetVisible(GUIEditor_Button[3],false) showCursor(false) addCommandHandler("reportar", function() guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) elseif source == GUIEditor_Button[2] then guiSetVisible(GUIEditor_Window[2],true) guiSetVisible(GUIEditor_Window[1],false) elseif source == GUIEditor_Button[4] then local motivo = guiGetText(GUIEditor_Edit[1]) local descripcion = guiGetText(GUIEditor_Memo[1]) local yo = getLocalPlayer() triggerServerEvent("crear:Report", motivo, descripcion, yo) elseif source == GUIEditor_Button[5] then guiSetVisible(GUIEditor_Window[1],true) guiSetVisible(GUIEditor_Window[2],false) end end ) sv-side addEvent("crear:Report",true) addEventHandler("crear:Report",root,function( motivo, descripcion, yo) local reporteXML = xmlCreateFile( ":reportGUI/reportes/"..motivo..".xml", "reporte" ) local contenido = xmlCreateChild( reporteXML, "reporte:" ) local motivoXML = xmlNodeSetAttribute( contenido, "motivoR", motivo ) local descripcionXML = xmlNodeSetAttribute( contenido, "descripcionR", descripcion ) local creadorXML = xmlNodeSetAttribute( contenido, "creadorR", getPlayerName( yo ) ) local estadoXML = xmlNodeSetAttribute( contenido, "estadoR", 'no leido' ) xmlSaveFile(reporteXML) if ( reporteXML ) then outputChatBox("Reporte Creado Exitosamente",source) end end )
-
Yo hize uno de 0, y la verdad es mucho mas facil hacer spawns protejidos haciendo uno propio, solo tienes que usar los GUI Elements onClientGUIClick, spawnPlayer, setPlayerTeam, isObjectinACLGroup, aclGetGroup, setWeapon, y eventos de onPlayerSpawn, y de onClientResourceStart, o como yo hize triggie un evento client-side a server-side, y le puse un evento de onPlayerLogin.
-
no , motivo Test era el motivoR y la descripcion era descripcion Test pero no se obtuvo en el archivo xml
-
Solid ya lo arregle lo de los argumentos , sigue quedando asi ( espacio .xml ) y asi queda el archivo xml "" descripcionR="motivo Test" creadorR="ElMota" estadoR="no leido">
-
amigo, creo que HTML no tiene nada que ver con funciones/eventos .lua, para juntarlos tienes que saber de lua lo puedes aprender en la wiki
-
que en descripcionR aparece el nombre del Cliente ( del creador del reporte/pedido ), en creadorR aparece el motivo, y en descripcionR no aparece la descripcion
-
Bueno amigos, como ya sabran estoy empezando a ocupar funciones XML, y queria hacer un sistema de reportes/pedidos XML con gridLists ya voy en la mitad, pero tengo un problema, cuando ya le pongo el motivo y la descripcion de este reporte/pedido, me aparece que se a creado satisfactoriamente, pero esto pasa : -.se me crea un archivo llamado .xml ( espacio .xml ) -. me aparece esto dentro : "" descripcionR="ElMota" creadorR="Teeeesteando" estadoR="leido"> aqui los codigos cl-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(290,102,773,586,"Reportes GUI",false) GUIEditor_Label[1] = guiCreateLabel(21,39,514,21,"Bueno amigos esta GUI esta echa para que pongan sus reportes y pedidos acerca del server",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(18,66,406,22,"Tu numero de reportes es .. xmlNodeGetAttribute( reportes, \"numero\" )",false,GUIEditor_Window[1]) GUIEditor_Grid[1] = guiCreateGridList(13,100,743,417,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"#",0.1) guiGridListAddColumn(GUIEditor_Grid[1],"Motivo",0.4) guiGridListAddColumn(GUIEditor_Grid[1],"Estado",0.1) guiGridListAddColumn(GUIEditor_Grid[1],"Creador",0.3) GUIEditor_Button[1] = guiCreateButton(471,527,135,47,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(610,527,135,47,"Crear nuevo reporte",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(12,522,139,55,"Leer Reporte",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(445,252,493,344,"Creacion del reporte",false) GUIEditor_Label[3] = guiCreateLabel(220,32,37,18,"Motivo",false,GUIEditor_Window[2]) GUIEditor_Edit[1] = guiCreateEdit(237,-1025,5,680,"",false,GUIEditor_Window[2]) GUIEditor_Edit[2] = guiCreateEdit(25,59,436,31,"",false,GUIEditor_Window[2]) GUIEditor_Label[4] = guiCreateLabel(209,106,61,20,"Descripcion",false,GUIEditor_Window[2]) GUIEditor_Memo[1] = guiCreateMemo(24,139,437,125,"",false,GUIEditor_Window[2]) GUIEditor_Button[4] = guiCreateButton(333,275,121,49,"Crear !",false,GUIEditor_Window[2]) GUIEditor_Button[5] = guiCreateButton(205,275,121,49,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(456,228,482,353,"xmlNodeGetAttribute( reportes, 'motivo' )",false) GUIEditor_Memo[2] = guiCreateMemo(18,105,442,192,"",false,GUIEditor_Window[3]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) GUIEditor_Button[6] = guiCreateButton(311,305,142,32,"Volver",false,GUIEditor_Window[3]) GUIEditor_Button[7] = guiCreateButton(169,309,131,26,"Borrar",false,GUIEditor_Window[3]) GUIEditor_Edit[3] = guiCreateEdit(20,48,436,33,"",false,GUIEditor_Window[3]) guiEditSetReadOnly(GUIEditor_Edit[3],true) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) guiSetVisible(GUIEditor_Window[3],false) guiSetVisible(GUIEditor_Button[3],false) showCursor(false) addCommandHandler("report", function() guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) elseif source == GUIEditor_Button[2] then guiSetVisible(GUIEditor_Window[2],true) guiSetVisible(GUIEditor_Window[1],false) elseif source == GUIEditor_Button[4] then local motivo = guiGetText(GUIEditor_Edit[1]) local descripcion = guiGetText(GUIEditor_Edit[2]) local creador = getPlayerName(getLocalPlayer()) triggerServerEvent("crear:Report", localPlayer, motivo, creador, descripcion) elseif source == GUIEditor_Button[5] then guiSetVisible(GUIEditor_Window[1],true) guiSetVisible(GUIEditor_Window[2],false) end end ) sv-side addEvent("crear:Report",true) addEventHandler("crear:Report",root,function(motivo,descripcion,creador) local reporteXML = xmlCreateFile( ":reportGUI/reportes/"..motivo..".xml", "reporte" ) local contenido = xmlCreateChild( reporteXML, "reporte:" ) local motivoXML = xmlNodeSetAttribute( contenido, "motivoR", motivo ) local descripcionXML = xmlNodeSetAttribute( contenido, "descripcionR", descripcion ) local creadorXML = xmlNodeSetAttribute( contenido, "creadorR", creador ) local estadoXML = xmlNodeSetAttribute( contenido, "estadoR", 'leido' ) xmlSaveFile(reporteXML) if ( reporteXML ) then outputChatBox("Reporte Creado Exitosamente",source) end end ) gracias de antemano u.u
-
aah Ok, otra cosa, cuando pongo una imagen .png en MTA con fondo blanco , ( para que este transparente el fondo ), el fondo no es transparente es blanco, como podria solucionar esto ?
-
Solid pero esa funcion sirve digamos poner una imagen .gif, o es para poner imagenes .png ?
-
Si no puedes aprender, no te dediques a esto, simple.
-
ya habia tratado eso edikosh, pero con bindKey y me aparece sin resultados :c
-
tal vez onPlayerFire onClientRender, y la construccion de la imagen ( dxDrawImage ), removeEventHandler, algo asi
-
bueno amigos, queria ver si alguien sabe como cambiar el bindkey del guieditor, ya que en mi antiguo notebook esta tecla no sirve ( el click derecho ), asi que porfavor el que sepa digame en cual de todos los archivos aparece esto. gracias de antemano