
InDev
Members-
Posts
106 -
Joined
-
Last visited
Everything posted by InDev
-
Yes when you minimize GTA San Andreas while being in an interior like cloth shops, when you go back to the game there is this type of problem, i think it's a internal GTA:SA problem cause in normal GTA SA there is the same problem.
-
Oh I resolved the problem i post the whole function if you want: function displayServices( thePlayer, commandName, ... ) local textT = {...} local text = table.concat( textT, " " ) if( text == "taxi" or text == "taxi" )then local servicesPlayers = {} for k,i in ipairs( getElementsByType( "player" ) )do if( isMember( i, "Taxi" ) )then if( getElementData( i, "inService" ) == 1 )then servicesPlayers[k] = i outputChatBox( ""..getPlayerName( i ) ) end end end if( #servicesPlayers > 0 )then local x,y,z = getElementPosition( thePlayer ) local newCallsInd = #taxiCalls+1 for k,i in ipairs( servicesPlayers ) do outputChatBox( "A new call is avalaible ( Caller: "..getPlayerName(thePlayer).." Number: "..(newCallsInd-1)..". )", i, 255, 255, 255 ) end outputChatBox( "Your call has been send to all taxi drivers, please wait for an answer", thePlayer, 0, 175, 0 ) taxiCalls[newCallsInd] = {} taxiCalls[newCallsInd][1] = thePlayer taxiCalls[newCallsInd][2] = x taxiCalls[newCallsInd][3] = y taxiCalls[newCallsInd][4] = z end elseif( text == "" )then end end addCommandHandler( "services", displayServices ) Thank you for the help, The while loop didn't worked cause when he check for the table index, he didn't find it so the function stop, that's my opinion, I can be wrong.
-
"First question:" "What doesn't work? "Increase the variable to use as a new index for the table with a while What errors ? attempt to index field '?' (a nil value ) Where ? at the 'while' line "Second question:" "What is the point of the while loop ?" What do you mean by point ?
-
Sorry i don't understand the question i'm French and don't have a complete comprehension of what you are saying I need the " while " because when I use the function with only #taxiCalls as index the second call erase the first in the table and when I use #taxiCalls+1 I can't use the for loop to read the calls and I don't know why too, I'm a noob with the tables ^^
-
Does'nt work too, there is another way to make that ?
-
Here is the whole function: taxiCalls= {{[1]=Element,[2]=X,[3]=Y,[4]=Z}} function displayServices( thePlayer, commandName, ... ) local textT = {...} local text = table.concat( textT, " " ) if( text == "taxi" or text == "Taxi" )then local servicesPlayers = {} for k,i in ipairs( getElementsByType( "player" ) )do if( isMember( i, "Taxi" ) )then if( getElementData( i, "inService" ) == 1 )then servicesPlayers[k] = i outputChatBox( ""..getPlayerName( i ) ) end end end if( #servicesPlayers > 0 )then local x,y,z = getElementPosition( thePlayer ) local newCallsInd = #taxiCalls while( taxiCalls[newCallsInd][1] )do newCallsInd = newCallsInd+1 end for k,i in ipairs( servicesPlayers ) do outputChatBox( "A new call is available ( Caller: "..getPlayerName( thePlayer).." Number: "..newDemandeInd..". )", i, 255, 255, 255 ) end outputChatBox( "Your call has been send to all taxi drivers, please wait for an answer.", thePlayer, 0, 175, 0 ) taxiCalls[newCallsInd] = {} taxiCalls[newCallsInd][1] = thePlayer taxiCalls[newCallsInd][2] = X taxiCalls[newCallsInd][3] = Y taxiCalls[newCallsInd][4] = Z end elseif( text == "" )then end end addCommandHandler( "services", displayServices ) EDIT: Added the table init. EDIT2: Added the "taxiCalls[newCallsInd] = {}"
-
No, it does'nt works there is again the attempt blababla But the first time I call the function it works fine so i don't know why it does'nt work the second time i use it
-
You will pay for free scripting, rofl Why you won't script it yourself ? If you were asking that some 6 months before I would help you . But i'm already doing a script like that for french players and it's verry long to script and you must be really smart to pass through the difficulties and repair the bugs, my script is'nt finished but you'll see a lot of french players coming into a brand new real RP server soon I just want to say you good luck if you do that.
-
Hello, I'm here because i have a little problem in my script it's a table problem ( I'm always wrong with the tables ) Here is my code: Init the table: taxiCalls = {{Element,X,Y,Z}} Make a new table index for the new call: -- This is a part of a function who works perfectly just this don't work local newCallInd = #taxiCalls while( taxiCalls[newCallInd ]["Element"] ~= nil )do newCallInd = newCallInd +1 end My problem is that when the While is executed there is the following sentence who appears in the console when he don't find the index of the table: attempt to index field '?' (a nil value) --with a reference to the "While" line number I don't understand why it works fine the first time i call this function and not the second time... Thanks for the help.
-
Ok it works good, thanks you very much really helpful =)
-
Hi, I see that you can connect to servers by URL with " mtasa " prefix (example: mtasa//127.0.0.1:22003) so it launch your MTA with option to connect to this IP and i want to know what are these options cause you can't put the password or the nick before connect so i want to know: There is options to the launcher or am I totally wrong ? Thanks for the answers.
-
Awesome ! Good work !
-
Omg Thanks for the help, 4 months i script can't make a simple function lol Can lock the topic
-
Hi all, I have a problem in my script i just made this function but when i restart the resource it bug my script, all the functions after this one bugs and i don't know what's wrong in the function so i hope you'll see clearer than me Thanks for the help. Here is the function: function parkVeh( thePlayer, commandName ) local veh = getPedOccupiedVehicle( thePlayer ) if( veh )then local owner = getElementInfo( veh, "Owner" ) --"getElementInfo" -> personnal function, don't bug local plname = getPlayerName( thePlayer ) if( owner == plname )then local x, y, z = getElementPosition( thePlayer ) local a, b, c = getVehicleRotation( veh ) setElementInfo( veh, "X", x ) --"setElementInfo" -> personnal function, don't bug setElementInfo( veh, "Y", y ) setElementInfo( veh, "Z", z ) setElementInfo( veh, "A", c ) outputChatBox( "You have parked your vehicle, it will respawn here now", thePlayer, 0, 255, 0 ) end end end addCommandHanler( "park", parkVeh )
-
If synced the traffic lights are realistics but for RP too the traffic lights are'nt important. I had a RP server on SA:MP before this sync feature and never cared about the traffic lights. Moreover the time for traffic lights are not very realistic for the green light for example the time is very short and it's very boring to wait at the red light especially on this type of servers where the life must be dynamic and where the players must have a lot of fun playing (un)real life and not waiting two hours at traffic lights so it's not really important and it's more a bonus feature
-
I like the new design, good job !
-
Sorry but my internet didn't work ^^ Ok so it's work now but why you have make two butons if you doesn't show the cursor to click this butons ? Keep the two addEventHandler in the gui and the two functions which I maked and put the actions to buy the house And keep my function to hide the window and so you don't need the event onColShapeLeave because if he click in cancelar, he want to leave that. Do you understand what I mean ? But congratulation for the issue The Fama's brother
-
Hi I remake a big part of your system ! This code taken me a long time so try this please and keep side your system ! ------------------------------------------------------------------------------------------------------ ---------------------------------SCRIPT DE LOS BOTONES ( GUI ) CLIENT-SIDE --------------------------- casasnumclient = 1 ------------------- DETECTA SI EL JUGADOR ESTÁ EN EL COLSHAPE ---------------------------------------- function enterInColShapeOfHouse(thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then --Detect if the element in ColShape is a player for k,i in ipairs (posicionCasas)do --Get all the ColSpheres if k == source then --source it's the colshape so if a posicionCasas(of your table) coresponds to the source then: outputChatBox("House: #"..k,thePlayer)--Check if the good house windowCrCpCs(k)--create the window of the house number "k" end end end end addEventHandler ( "onColShapeHit", getRootElement(), enterInColShapeOfHouse) -------------------- create ColSpheres ----------------------------------------------- function createColSphereOfHouse() local casasxml = xmlLoadFile("casas.xml") for houses=0 , casasnumclient do local hEntrancex = { } local hEntrancey = { } local hEntrancez = { } posicionCasas = { } hEntrancex[houses] = xmlNodeGetAttribute ( casasxml, "hEntradax." .. houses ) hEntrancey[houses] = xmlNodeGetAttribute ( casasxml, "hEntraday." .. houses ) hEntrancez[houses] = xmlNodeGetAttribute ( casasxml, "hEntradaz." .. houses ) posicionCasas[houses] = createColSphere( hEntrancex[houses], hEntrancey[houses], hEntrancez[houses], 3.0) --The ColShpheres of all houses are created when the player spawn end end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), createColSphereOfHouse) --------------------------- CANCELAR ---------------------------------- function CancelarCasa() for k,i in ipairs (windowTituloCasa)do if(guiGetVisible (windowTituloCasa[k]) == true) then --if the WindowTituloCasa it's the WindowTituloCasa in the screen then: guiSetVisible(windowTituloCasa[k],false)--hide the windowTituloCasa in the screen showCursor(false)--hide the cursor end end end addEventHandler("onClientColShapeLeave",getRootElement(),onColShapeLeaveCrCpCs) ---------------------- COMPRAR LA CASA --------------------------------------------- function ComprarCasa() for k,i in ipairs (windowTituloCasa)do if(guiGetVisible (windowTituloCasa[k]) == true) then --if the WindowTituloCasa it's the WindowTituloCasa in the screen then: outputChatBox("ComprarCasa numero "..k)--to check if it's the good house --The actions for buy this house end end end --------------------------------- SE CREA LA VENTANA ------------------------------- function windowCrCpCs(house) local casasxml = xmlLoadFile("casas.xml") for houses=0 , casasnumclient do if houses == house then --if the house is the house's colshape where the player is in then create only one windowTituloCasa: local casasxml = xmlLoadFile("casas.xml") windowTituloCasa = { } labelDuenoCasa = { } labelDescripcionCasa = { } labelPreAlqCasa = { } botonComprarCasa = { } botonCancelarCasa = { } windowTituloCasa[houses] = guiCreateWindow(460,289,357,171,"Sistema de casas por CTCCoco",false) local hOwner = xmlNodeGetAttribute (casasxml, "hOwner." .. houses ) local hOwner = tostring(hOwner) labelDuenoCasa[houses] = guiCreateLabel(10,29,335,18,"Dueno: " .. hOwner ,false,windowTituloCasa[houses]) guiLabelSetColor(labelDuenoCasa[houses],255,255,255) guiLabelSetVerticalAlign(labelDuenoCasa[houses],"top") guiLabelSetHorizontalAlign(labelDuenoCasa[houses],"left",false) local hDesc = xmlNodeGetAttribute (casasxml, "hDesc." .. houses ) labelDescripcionCasa[houses] = guiCreateLabel(8,47,340,45,"Descripcion: ".. hDesc,false,windowTituloCasa[houses]) guiLabelSetColor(labelDescripcionCasa[houses],255,255,255) guiLabelSetVerticalAlign(labelDescripcionCasa[houses],"top") guiLabelSetHorizontalAlign(labelDescripcionCasa[houses],"left",false) local hValue = xmlNodeGetAttribute (casasxml, "hValue." .. houses ) labelPreAlqCasa[houses] = guiCreateLabel(8,94,334,34,"Precio: " .. hValue .. "$ Alquiler:",false,windowTituloCasa[houses]) guiLabelSetColor(labelPreAlqCasa,255,255,255) guiLabelSetVerticalAlign(labelPreAlqCasa[houses],"top") guiLabelSetHorizontalAlign(labelPreAlqCasa[houses],"left",false) botonComprarCasa[houses] = guiCreateButton(10,136,89,25,"Comprar",false,windowTituloCasa[houses]) botonCancelarCasa[houses] = guiCreateButton(259,136,89,25,"Cancelar",false,windowTituloCasa[houses]) addEventHandler("onClientGUIClick",botonComprarCasa[houses],ComprarCasa,false) addEventHandler("onClientGUIClick",botonCancelarCasa[houses],CancelarCasa,false) guiSetVisible(windowTituloCasa[houses], false) showCursor(true) break--Thanks 50p for the break I forget it ^^ end end end And try this please ! If you say that it's work but the last house, this script should work You don't have need the event onColShapeLeave because like the cursor is on, he don't can move !And when he click on buton Cancelar, the window and the cursor are hidden. If you have an other problem with the system or any questions of the system, I'm here! and 50p too I suppose You will tell me the result ! The Famas's brother
-
We aren't more very far now ! Give me an exemple of line of the casas.xml ! I don't know if you are define an ID for each house but you should make that . If you don't want put an exemple of your casas.xml in your post put it in PM The Famas's brother
-
Ok finally you left all in client-side. I read all and it's correct but you should take the casasnumclient with the number of houses in your xml file if it's possible and not define it yourself ! Do you understand what I mean ? So you have just to add a new house with the informations required and the casasnum will be defined automatically! Ok ? yesterday I made a thing of the same style but a part in the server-side and a part in the client-side I showed you in PM if you it desired ^^ PS: I answered your message The Fama's brother
-
50p rightly! Why you don't use onColShapeHit ? And create the gui only when the player enter in the colshape ? Because the client try to create the gui every 3 second and he continue to create this gui if a player is in colshape! So you should open the xml and take all the datas in server-side and create the colshape(s) in the same time and use the event onColShapeHit to create your gui and use some triggerServerEvent and triggerClientEvent to take the datas of the home This is what 50p thinks and try to say to you Can you show an exemple of an xml's houses ? that will be easier for us to help you I make for you a little code while using onColShapeHit EDIT: I almost finished the little code but it misses an example of your sasas.xml The Famas's brother
-
Ok good ! So now the problem is the player not detected. Mmmm Show me your setTimer and your command please and precise if the command and the setTimer are in Server-Side or Client-Side please because you have surely modified somethings Thanks The Famas's brother
-
And this script work in server-side ? Because I see that you are comment "if(posicionjug1) then " but you don't have comment this: else guiSetVisible(windowTituloCasa, false) outputChatBox("No",source) return 1 end Why ?? And if when you enter the command, the chatbox say "NO" that means that it's the else of "for houses=0 , casasnumclient do" so casasnumclient it's not defined in client-side ! Do you remember that you have say before that your are defined casasnumclient but in server-side ? Thats why in server-side he works and not in client-side ! Do you understand what I mean ? So you must transfered the variable casasnumclient to the client-side ! And I showed you how to make that ! But you didn't make ! So I repeat how to do: In server-side, just after that you have defined casasnumclient: triggerClientEvent("recibircasasnum", getRootElement(), casasnumclient) In client-side: At the top of your script: local casasnumclient before your "function windowCrCpCs(source)": addEvent( "recibircasasnum", true ) function recibircasanum(casasnum) casanumclient = casasnum end addEventHandler("recibircasasnum", getRootElement(),recibircasanum) And only after the casasnumclient is defined, you can called windowCrCpCs() and not before ! I'm wright or not?(50p, answer if I'm wrong ) The Famas's brother
-
In your console enter this: refresh all And wait that he finished to refresh and restart your server and retry If it's always NOT Loaded try this and I want you try this: Client-Side: --------------------------------- SE CREA LA VENTANA ---------------------------------------- addEvent( "setXMLFile", true ) function setXMLFile(casasxml2) local casasxml = casasxml2 outputChatBox("Client:"..casasxml) crearComprarCasasWindow(casasxml) outputChatBox("GoToCrearComprarCasasWindow") end addEventHandler("setXMLFile", getRootElement(),setXMLFile) addEvent( "getXMLFile2", true ) function getXMLFile2() outputChatBox("GetXMLFile2Begin") triggerServerEvent( "getXMLFile", getLocalPlayer()) outputChatBox("GetXMLFile2Finished") end addEventHandler("getXMLFile2", getRootElement(),getXMLFile2) function crearComprarCasasWindow(casasxml) outputChatBox("CrearComprarCasasWindowBegin") casasnum = 3 for houses=0 , casasnum do outputChatBox("casasnum:"..casasnum) local hEntrancex = xmlNodeGetAttribute ( casasxml, "hEntradax." .. houses ) outputChatBox(""..hEntrancex) local hEntrancey = xmlNodeGetAttribute ( casasxml, "hEntraday." .. houses ) outputChatBox(""..hEntrancey) local hEntrancez = xmlNodeGetAttribute ( casasxml, "hEntradaz." .. houses ) outputChatBox(""..hEntrancez) local posicionjugS1 = createColSphere( hEntrancex, hEntrancey, hEntrancez, 3.0) outputChatBox("ColSphereCreated") local posicionjug1 = isElementWithinColShape ( thePlayer, posicionjugS1 ) outputChatBox("posicionjug1") if(posicionjug1) then outputChatBox("PassedIf") windowTituloCasa = guiCreateWindow(460,289,357,171,"Sistema de casas por CTCCoco",false) local hOwner = xmlNodeGetAttribute (casasxml, "hOwner." .. houses ) outputChatBox("Owner"..hOwner) 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 ) outputChatBox("Desc"..hDesc) 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 ) outputChatBox("Value".. hValue) 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("La ventana se creado bien!") return 1 outputChatBox("IfFinished") else outputChatBox("ElsePosicionjug1") guiSetVisible(windowTituloCasa, false) return 1 end outputChatBox("AfterIf (posicionjug1)") end outputChatBox("CrearComprarCasasWindowFinished") end outputChatBox("You can tape the command (/crear)") function crearLaVentana() getXMLFile2() outputChatBox("GoToFunctionGetXMLFile2") end addCommandHandler("crear", crearLaVentana) Server-Side: addEvent("getXMLFile" , true ) function getXMLFile() outputChatBox("GetXMLFileBegin") local casasxml2 = xmlLoadFile(":RLC/casas.xml") outputChatBox("Server:"..casasxml2) triggerClientEvent( "setXMLFile", getRootElement(), casasxml2) outputChatBox("GetXMLFileFinished") end addEventHandler( "getXMLFile", getRootElement(), getXMLFile ) restart your server and enter /crear Aswer me ALL the outputChatBox, the outputs of console (if there are) and all the clientscript.log !! The Famas's brother