Jump to content

subenji99

Members
  • Posts

    264
  • Joined

  • Last visited

Everything posted by subenji99

  1. Just remember to also remove isPlayerMapForced and add a isPlayerMapShowing function as well.
  2. Just remember to also remove isPlayerMapForced and add a isPlayerMapShowing function as well.
  3. That's likely to be an error parsing the file, preventing any of the code from executing. Again, check Debugscript - it'll report an error if there is one, and on what line it ran into trouble.
  4. That's likely to be an error parsing the file, preventing any of the code from executing. Again, check Debugscript - it'll report an error if there is one, and on what line it ran into trouble.
  5. Actually, you may have a point. I may have misread your script. I'll re-read it and edit this post. OK, I did, Calling xmlFindChild twice confused me. Your xml lines look correct, but there are errors in your gridlist functions, and you haven't converted datatypes to match function requirements. Also, you should use outputDebugScript() and tostring() more to check contents of variables, to see if you are indeed getting the values you want. Remember you see the output with the command /debugscript 3, as admin. http://robhol.net/guide/basics/?p=13 ... local iCarIndex = 0; while ( xmlFindChild( oCarXML, "car", iCarIndex ) ~= false ) do outputChatBox( "Client: message 2" ) local oCar = xmlFindChild( oCarXML, "car", iCarIndex ) local iCarID = xmlNodeGetAttribute( oCar, "id" ) local iCarPrice = xmlNodeGetAttribute( oCar, "price" ) outputDebugString("index: "..tostring(iCarIndex).." id: "..tostring(iCarID).." - price: "..tostring(iCarPrice)) --example debug string line I would use --local sCarName = getVehicleNameFromModel( iCarID ) --requires a integer, not a string local sCarName = getVehicleNameFromModel( tonumber( iCarID ) ) local oCarListRow = guiGridListAddRow( oCarList ) guiGridListSetItemText( oCarList, oCarListRow, 1, ""..sCarName.."", false, false ) --guiGridListSetItemText( oCarList, oCarListRow, 2, ""..iCarPice.."", false, false ) --misspelled iCarPrice guiGridListSetItemText( oCarList, oCarListRow, 2, ""..iCarPrice.."", false, false ) iCarIndex = iCarIndex + 1 end outputChatBox( "Client: cars added to list." ) else outputChatBox( "Client: Fatal error while loading xml file." ) end
  6. Actually, you may have a point. I may have misread your script. I'll re-read it and edit this post. OK, I did, Calling xmlFindChild twice confused me. Your xml lines look correct, but there are errors in your gridlist functions, and you haven't converted datatypes to match function requirements. Also, you should use outputDebugScript() and tostring() more to check contents of variables, to see if you are indeed getting the values you want. Remember you see the output with the command /debugscript 3, as admin. http://robhol.net/guide/basics/?p=13 ... local iCarIndex = 0; while ( xmlFindChild( oCarXML, "car", iCarIndex ) ~= false ) do outputChatBox( "Client: message 2" ) local oCar = xmlFindChild( oCarXML, "car", iCarIndex ) local iCarID = xmlNodeGetAttribute( oCar, "id" ) local iCarPrice = xmlNodeGetAttribute( oCar, "price" ) outputDebugString("index: "..tostring(iCarIndex).." id: "..tostring(iCarID).." - price: "..tostring(iCarPrice)) --example debug string line I would use --local sCarName = getVehicleNameFromModel( iCarID ) --requires a integer, not a string local sCarName = getVehicleNameFromModel( tonumber( iCarID ) ) local oCarListRow = guiGridListAddRow( oCarList ) guiGridListSetItemText( oCarList, oCarListRow, 1, ""..sCarName.."", false, false ) --guiGridListSetItemText( oCarList, oCarListRow, 2, ""..iCarPice.."", false, false ) --misspelled iCarPrice guiGridListSetItemText( oCarList, oCarListRow, 2, ""..iCarPrice.."", false, false ) iCarIndex = iCarIndex + 1 end outputChatBox( "Client: cars added to list." ) else outputChatBox( "Client: Fatal error while loading xml file." ) end
  7. You went too deep through the nesting levels. xml file: ... your script: oCarXml = xmlLoadFile("data\\cars.xml") --loaded xml file, oCarXml is pointing at if ( oCarXml ) then ... local iCarIndex = 0; while ( xmlFindChild( oCarXML, "car", iCarIndex ) ~= false ) do --found element iCarIndex down the sequence --(0 is first in list, etc) - add xmlFindChid line above setting oCar and check for oCar variable validity here ... local oCar = xmlFindChild( oCarXML, "car", iCarIndex ) --does not exist, you've gone a nesting level too far --this would be looking for - delete this line ... --this code looks fine with the above changes at a glance
  8. You went too deep through the nesting levels. xml file: <cars> <car id="602" price="15000" /> ... </cars> your script: oCarXml = xmlLoadFile("data\\cars.xml") --loaded xml file, oCarXml is pointing at if ( oCarXml ) then ... local iCarIndex = 0; while ( xmlFindChild( oCarXML, "car", iCarIndex ) ~= false ) do --found element iCarIndex down the sequence --(0 is first in list, etc) - add xmlFindChid line above setting oCar and check for oCar variable validity here ... local oCar = xmlFindChild( oCarXML, "car", iCarIndex ) --does not exist, you've gone a nesting level too far --this would be looking for - delete this line ... --this code looks fine with the above changes at a glance
  9. I can't believe you cannot do basic rectangle coordinate maths. As 50p said, the x,y settings you feed in are your point #3 world co-ordinates. Let's call them 100,200. Then get the other extreme co-ordinates, point #2. I'll name them x2 and y2. Let's say they come out as 400,700. to get width, it's as simple as x2 - x (300). To get depth, y2 - y (500). Giving you: myCol = createColRectangle ( 100.0, 200.0, 300.0, 500.0 ) or local x, y, x2, y2 = 100.0, 200.0, 400.0, 700.0 myCol = createColRectangle ( x, y, x2 - x, y2 - y )
  10. I can't believe you cannot do basic rectangle coordinate maths. As 50p said, the x,y settings you feed in are your point #3 world co-ordinates. Let's call them 100,200. Then get the other extreme co-ordinates, point #2. I'll name them x2 and y2. Let's say they come out as 400,700. to get width, it's as simple as x2 - x (300). To get depth, y2 - y (500). Giving you: myCol = createColRectangle ( 100.0, 200.0, 300.0, 500.0 ) or local x, y, x2, y2 = 100.0, 200.0, 400.0, 700.0 myCol = createColRectangle ( x, y, x2 - x, y2 - y )
  11. https://wiki.multitheftauto.com/wiki/SetAccountData Syntax bool setAccountData ( account theAccount, string key, string value ) You're attempting to set (and later, compare to) an element not a string.
  12. https://wiki.multitheftauto.com/wiki/SetAccountData Syntax bool setAccountData ( account theAccount, string key, string value ) You're attempting to set (and later, compare to) an element not a string.
  13. Reading this thread. Or even, just the above reply by robhol, which specifically details the cause AND has a link to a fixed client.dll file.
  14. subenji99

    Menu Issues?

    This'll sound weird, and it is a shot in the dark, but try updating DirectX 9. Yes, I did see you are on Windows 7, do it anyway. MTA makes use of DirectX 9 quite a bit, and it seems to me that a misconfigured version could cause this. Also DirectX9 is still used for older games, and is updated separately from DirectX 10/11. Not to mention it still gets SDK runtime updates every 3 months. I don't have complete faith that this will fix it, but it's worth a try and won't do any harm.
  15. https://forum.multitheftauto.com/search.php
  16. It's a simple solution, and you'll kick yourself for this. local cities = getElementsByType ( "city" ) This is going to return an element table as you expect, but the values will not be the element ID's but the element objects: cities = { 1 = element:"memory pointer" 2 = element:"another memory pointer" ... } --the actual pointer memory address doesn't matter - you're getting element objects is all you need to concern yourself with All you need to do is fetch the "id" Element Data from that element object: for city, cityElem in ipairs ( cities ) do local row = guiGridListAddRow ( cityGridList ) local cityName = getElementData ( cityElem, "id" ) guiGridListSetItemText ( cityGridList, row, cityColumn, cityName, false, false ) end Have fun.
  17. Also, it looks like you've manually set your LAN IP in mtaserver.conf - this is usually unnecessary, as it'll work it out for itself. I'm unsure as to whether it could cause this problem, but nevertheless it is sound advice.
  18. Weather 2 has no heat waves and is still sunny with no clouds. The speed blur however is controlled by scripting. It depends what gamemode you are playing as to how to control it.
  19. Looks like the first file it tries to install fails, meaning either you don't have write permissions for the installation folder you chose or your HDD is full. It'll probably be the first one. Install MTA with an Administrator account.
  20. dxDrawImage onClientRender every frame, only 1 needle image that you rotate (assuming this speedo is analog) is the most efficient. There is a resource that already does this in the resource center though; you may just want to change the images on that.
  21. I had this problem with Debian etch too. I traced it to what I believe meant I needed a newer version of libstdc++, which was not provided for etch. We're therefore upgrading to lenny soon. Try updating your server to CentOS 5.4. Someone else may have more insight into this however.
  22. Read: https://wiki.multitheftauto.com/wiki/IsInsideRadarArea
  23. https://wiki.multitheftauto.com/wiki/AddEventHandler In the Element Tree, a GUI window's buttons are children of the GUI window. When you click on the GUI window, the event propagates down the tree, and finds the buttons. If their event handlers have "getPropagated = true" then they receive the event and react as though you clicked on them. Just set that final argument false on your button event handlers. And learn how the event system works.
  24. remove that space character from your .map filename, and don't include a space character in your resource folder name either.
  25. Seems you misunderstood me - I meant you should have the player you clicked on's name in your GUI window, so if you were clicking amongst a group of people you can make sure you got the right one. That's what I meant by feedback.
×
×
  • Create New...