InDev
Members-
Posts
106 -
Joined
-
Last visited
Everything posted by InDev
-
Try this: --Put this: local casasxml = xmlLoadFile(":RLC/casas.xml") if casasxml then outputChatBox("xmlFile Loaded !") else outputChatBox("xmlFile NOT Loaded !") end --Before this: for houses=0 , casasnum do EDIT:: And tell me what appears when the gui is called (Loaded or NOT Loaded ?) The Famas's brother
-
Your welcome ! I can't sleep if the problem aren't solved Are you change the place of: local casasxml = xmlLoadFile(":RLC/casas.xml") like I you said ?? Here for houses=0 , casasnum do local casasxml = xmlLoadFile(":RLC/casas.xml")--It's here that the casasxml.xml must to be open !! And when you enter your command, the gui works ? or not ? The Famas's brother
-
you try like this: xmlLoadFile(":RLC/casas.xml") ? And I edit my precede reply. Read it and answer me please The Famas's brother
-
where you are put the casas.xml ? (give me the root directory) EDIT: And in your guibotones.lua you must to open this file before the xmls functions like this: for houses=0 , casasnum do local casasxml = xmlLoadFile(":RLC/casas.xml")--It's here that the casasxml.xml must to be open !! local hEntrancex = xmlNodeGetAttribute ( casasxml, "hEntradax." .. houses ) ... The Famas's brother
-
The console writes only server-side errors ! Your guibotones.lua is a client so the errors are write in clientscript.log root: c:\Program Files\MTA San Andreas\MTA\ And I send to you in a mail the guibotones.lua repaired If not, I put it here to you and try this: guibotones.lua: ------------------------------------------------------------------------------------------- -------------------------------- SCRIPT DE LOS BOTONES ( GUI ) CLIENT-SIDE ---------------- ------------------------------------------------------------------------------------------- ------------------------------------ Recibir casanum -------------------------------------- addEvent( "recibircasanum", true ) function recibircasanum(casasnum) casasnum = casasnum end addEventHandler("recibircasanum", getRootElement(),recibircasanum) --------------------------------- SE CREA LA VENTANA ---------------------------------------- function crearComprarCasasWindow() for houses=0 , casasnum do local casasxml = xmlLoadFile("casas.xml")--It's here that the casasxml.xml must to be open !! local hEntrancex = xmlNodeGetAttribute ( casasxml, "hEntradax." .. houses ) local hEntrancey = xmlNodeGetAttribute ( casasxml, "hEntraday." .. houses ) local hEntrancez = xmlNodeGetAttribute ( casasxml, "hEntradaz." .. houses ) local posicionjugS1 = createColSphere( hEntrancex, hEntrancey, hEntrancez, 3.0) local posicionjug1 = isElementWithinColShape ( thePlayer, posicionjugS1 ) if(posicionjug1) then windowTituloCasa = guiCreateWindow(460,289,357,171,"Sistema de casas por CTCCoco",false) local hOwner = xmlNodeGetAttribute (casasxml, "hOwner." .. houses ) labelDuenoCasa = guiCreateLabel(10,29,335,18,"Dueno:" .. hOwner,false,windowTituloCasa) guiLabelSetColor(labelDuenoCasa,255,255,255) guiLabelSetVerticalAlign(labelDuenoCasa,"top") guiLabelSetHorizontalAlign(labelDuenoCasa,"left",false) local hDesc = xmlNodeGetAttribute (casasxml, "hDesc." .. houses ) labelDescripcionCasa = guiCreateLabel(8,47,340,45,"Descripcion: " .. hDesc,false,windowTituloCasa) guiLabelSetColor(labelDescripcionCasa,255,255,255) guiLabelSetVerticalAlign(labelDescripcionCasa,"top") guiLabelSetHorizontalAlign(labelDescripcionCasa,"left",false) local hValue = xmlNodeGetAttribute (casasxml, "hValue." .. houses ) labelPreAlqCasa = guiCreateLabel(8,94,334,34,"Precio: " .. hValue .. "$ Alquiler:",false,windowTituloCasa) guiLabelSetColor(labelPreAlqCasa,255,255,255) guiLabelSetVerticalAlign(labelPreAlqCasa,"top") guiLabelSetHorizontalAlign(labelPreAlqCasa,"left",false) botonComprarCasa = guiCreateButton(10,136,89,25,"Comprar",false,windowTituloCasa) botonCancelarCasa = guiCreateButton(259,136,89,25,"Cancelar",false,windowTituloCasa) guiSetVisible(windowTituloCasa, true) outputChatBox("Se creó la ventana !") return 1 else outputChatBox("casasnum not defined !") guiSetVisible(windowTituloCasa, false) return 1 end end end server-side: function remotePlayerJoin() outputChatBox("* " .. getPlayerName(source) .. " se a conectado") outputDebugString("* " .. getPlayerName(source) .. " se a conectado.") triggerClientEvent("recibircasanum", getRootElement(), casasnum)) setTimer(triggerClientEvent,3000, 0, source, "crearComprarCasasWindow", getRootElement()) end addEventHandler("onPlayerJoin", getRootElement(), remotePlayerJoin) The Famas's brother
-
Indeed in your gui there are: after local hEntrancex = xmlNodeGetAttribute ( casasxml, "hEntradax." .. houses ) local hEntrancey = xmlNodeGetAttribute ( casasxml, "hEntraday." .. houses ) local hEntrancez = xmlNodeGetAttribute ( casasxml, "hEntradaz." .. houses ) whereas you must be placed before! Here your 3 xml functions get "hEntrada" of casaxml but casaxml isn't yet defined I search other errors (if there is still ^^) The Famas's brother
-
Yes but it's always an idea No I didn't test yet with an other player and I see very well that you want to say. The peds and trains are create in serverside so evrybody see. But like setPedControlState is placed in clienside, I see the train accelerated but other players see the train always at station ? Maybe if you use setElementStreamable(yourped,false) in server-side (after that you are created the ped of course) that will not arrive ! The Famas's brother
-
No, I think you don't need include it. I know how to use XML fuctions, the system works fine in a command but I mean that doesn't works the GUI Thanks men. The GUI works with a command ? or just the xml functions ? the server-side and client-side are separate and you must used triggerClientEvent to send variable (here casanum) to your client-side (guibotones.lua). Possible issue: Server-side: function enviarcasanum() triggerClientEvent("recibircasanum", getRootElement(), casanum) end Client-side before "function crearComprarCasasWindow()": addEvent( "recibircasanum", true ) function recibircasanum(casanum) casanum = casanum end addEventHandler("recibircasanum", getRootElement(),recibircasanum) that should work if your xml functions work The Famas's brother
-
Hi Gamesnert, If I understand good you tell me that he must to comment my setTimer because the clientside is not debug and so It's spam because it's repeat every 3 second ? And CTCCoco, If I say REGM does that say something to you ? Sorry if I not speak English very well The Famas's brother
-
Hy, CTCCoco No your setTimer is correct but like the function crearComprarCasasWindow() doesn't work, all the rest in guibotones.lua is locked and they can't work! Do you understand ? I never used the xml's function but I try to help you Do you read the example and the description of XmlNodeGetAttribute on MTA Wiki =>https://wiki.multitheftauto.com/wiki/XmlNodeGetAttribute And if you look at well you need to open the xml file and other things and In your code I don't see where you open the casas.xml and to open this file you must include this file in meta.xml. Are you agree ? The Famas's brother
-
I use peds who driving the trailer ! The peds in freights trailers make the same action that the ped in train at the same time (setPedControlState...) The peds are invisible with the function setElementAlpha(..., 0) All freights trailers and the peds and the train can't to be stream (setElementStreamable(..., false )) And if the freights trailers deviate compared to the train, the freights trailers will be replaced with setElementPosition I'm agree that with 90 players the system will lag so maybe I will make the same system with setTrainSpeed or simplified this system But I didn't understand: The Famas's brother
-
Hy CTCCoco ! maybe there are an error in the function crearComprarCasasWindow() because you can't use the xml functions on xmls files which are in the server, you must put the .xml file as client in the meta. So all the remainder of your guibotones.lua doesn't work ! I propose to you to put this for PlayerJoin: In your server: function remotePlayerJoin() outputChatBox("* " .. getPlayerName(source) .. " has joined the server") outputDebugString("* " .. getPlayerName(source) .. " se a conectado.") setTimer(triggerClientEvent,3000, 0, source, "crearComprarCasasWindow", getRootElement()) end addEventHandler("onPlayerJoin", getRootElement(), remotePlayerJoin) Normaly it will work except the setTimer because of error in guibotones.lua ! And for your GUI I can't help you (maybe Famas knows how work xml functions ) The Famas's brother
-
I'm on forum MTA but with the account of Famas because I no idea of username ^^ After this topic of Famas: It's me who aswered Because I didn't think that you would like to speak to me! So I will have an account soon and I will identify me by "(Brother)" at the end of my reply while waiting. (Brother)
-
No sorry karlys is specificated to our server because this is not finished and there are many useless things (for tests) and that my brother must remove and it can still simplify it !But he will think of it. But maybe he will say to you how to make.
-
Hi guys. My brother have found a solution to attach a freight trailer to a train and this is the most that he can do. The result of this solution: Video
-
I tryed to sync vehicles when they are stream. I thought the vehicles pos sync was not good... My question was: Does the server sync the vehicles for all the players ?
-
I want know some things about the stream of the elements: -Does, when an element is stream for a player, the server as the true position of the element if he move ? ( i suppose yes ) -Does, If it's true, this script working? : For the moment i only take care of the vehicles elements ( it's the most important ) Clientside: addEventHandler( "onClientElementStreamIn", getRootElement( ), function ( ) if getElementType( source ) == "vehicle" then triggerServerEvent( "streamIn", source, source, getLocalPlayer() ) end end ) addEventHandler( "onClientElementStreamOut", getRootElement( ), function ( ) if getElementType( source ) == "vehicle" then triggerServerEvent( "streamOut", source, source, getLocalPlayer() ) end end ) addEvent( "setElementPosForPl", true ) function setElementPosForPl( element, x, y, z, r, lights ) setElementPosition( element, x, y, z ) setVehicleRotation( element, (360-r) ) setVehicleLightState( element, lights ) end addEventHandler( "setElementPosForPl", getRootElement(), setElementPosForPl ) Serverside: function streamIn( element, forpl ) element = element or source if ( not getVehicleOccupant(element, 0) and not getVehicleOccupant( element, 1 ) and not getVehicleOccupant( element, 2 ) and not getVehicleOccupant( element, 3 ) and not getVehicleOccupant( element, 4 ) ) then local x = getElementData( element, "Xs" ) local y = getElementData( element, "Ys" ) local z = getElementData( element, "Zs" ) local r = getElementData( element, "Rots" ) setElementPosition( element, x, y, z ) setVehicleRotation( element, 0, 0, (r-360) ) setVehicleOverrideLights( element, getElementData( element, "lights" ) ) else local x, y, z = getElementPosition( element ) local rx, ry, r = getVehicleRotation( element ) local lights = getElementData( element, "lights" ) triggerClientEvent( forpl, "setElementPosForPl", forpl, element, x, y , z, r, lights ) end end addEvent( "streamIn", true ) addEventHandler( "streamIn", getRootElement(), streamIn ) function streamOut( element, forpl ) element = element or source if ( not getVehicleOccupant(element, 0) and not getVehicleOccupant( element, 1 ) and not getVehicleOccupant( element, 2 ) and not getVehicleOccupant( element, 3 ) and not getVehicleOccupant( element, 4 ) ) then local x, y, z = getElementPosition( element ) local rx,ry,r = getVehicleRotation( element ) setElementData( element, "Xs", x ) setElementData( element, "Ys", y ) setElementData( element, "Zs", z ) setElementData( element, "Rots", r ) local li = getVehicleOverrideLights( element ) setElementData( element, "lights", li ) end end addEvent( "streamOut", true ) addEventHandler( "streamOut", getRootElement(), streamOut ) Thanx for (futures) answers
-
Ok thanx for all guys i will try to getTrainSpeed on the train and apply it with setTrainSpeed on the trailers i think it's gonna work... PS: setElementSyncer will be good
-
Mmm, attachElements is good but the trailer bug: he disappear and appear with the angle of the camera and has no collision and he get out of the rails in the turnings so if there is more than one trailer it will make some problems... In the GTA:SA the trailers are attached by a function i think, there is probably a way to make it ?
-
Does anyone know how to attach freights trailers to a train? Because i can't do it with attachTrailerToVehicle( train , trailer ) Thanx for answers
-
Ok thx it's helping me, after this error i had an other but it's ok i used string.format i like this function >< Thanks for all Edit: I don't want people, except me, to understand my script, unfortunately i need help sometimes and must show my french script
-
Yes, again SQL... I have a probleme with an executeSQLUpdate i made, i tried many solutions but all of them can't repaired the error The script: executeSQLUpdate( "MTA_players"," Level="..tonumber(level)..", Membre="..tonumber(membre)..", Rang="..tonumber(rang)..", HeuresJ='"..tonumber(heuresj).."', Morts="..tonumber(morts)..", Meurtres="..tonumber(meurtres)..", Money="..tonumber(money)..", Car='"..tonumber(car).."', House="..tonumber(house)..", Biz="..tonumber(biz)..", Admin="..tonumber(admin)..", Age="..tonumber(age)..", Banque="..tonumber(banque)..", Sexe="..tonumber(sexe)..", Activated="..tonumber(sexe)..", Skin="..tonumber(skin)..", Job="..tonumber(job)..", Respect="..tonumber(respect)..", Crimes="..tonumber(crimes)..", PermisV="..tonumber(PermisV)..", PermisAv="..tonumber(PermisAv).."', PermisAr="..tonumber(PermisAr)..", PermisB="..tonumber(PermisB)..", PermisM="..tonumber(PermisM)..", PermisCa="..tonumber(PermisCa)..", PermisCe='"..tonumber(PermisCe).." ","Password='"..pass.."'" ) This is a french one so if you don't understand the whole thing it's normal The error message is: If someone can help...
-
Hmm, not helping me... If it can be repaired that'll be cool
-
Hi, I seen that all the skins have the same walk, CJ's walk, so i want to know if the MTA developpment team can add a function to change the walking anim , there is already a function to change the Fighting Style and i think it's not really different so i want to know if it's possible because seen ladies walking like gangstas is really freaky Video for proof ^^
-
Ithink notepad ++ with the lua mta plugin is the best but it not say you the errors whereas MTA script editor does but you can wrote your script in notepad ++ then copy it ans paste it into MTA Script Editor then you can see the errors but it's just a personnal thing
