Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. group "Export MTA:SA map:" ( button showGTAMap "Set map location..." width: 120; --edittext resourceName "Resource name:" labelOnTop:true; checkBox exportMetaXMLBox "Generate meta.xml" checked:true checkBox exportLuaScriptBox "Generate .lua script" checked:true checkBox exportDFF "Export DFF files" checked:true button exportBtn "Export to .map" width: 120; ) on showGTAMap pressed do ( createDialog gtaMapCanvas 600 635; gtaMapCanvas.mapMarker.pos = selectedLocation; )
  2. Delete only these: on resourceName entered newPath do ( setResourcesFolder( newPath ); )
  3. It should be getElementsByType. It's hard to type long code in browser without syntax highlighter. Updated the code in the previous post.
  4. You can remove these 4 lines completely. I added it for map resource creation but I decided to leave it the old way and didn't remove the code. So, if you remove these 4 lines, it will still work and will not give you error. I'll upload the updated version soon, just let me know if you get more errors.
  5. 50p

    delete sql rows

    varez, you're wrong again. Check what executeSQLQuery returns. SolidSnake14, there is no need to select the rows from table to delete them. 2nd parameter for executeSQLDelete is condition. If you put just "deaths" in there, you will delete all the rows. executeSQLDelete( "playerstbl", "deaths < 100" ); -- OR executeSQLQuery( "DELETE FROM playerstbl WHERE deaths < 100" ); Either way, both of these do the same thing. Learn more about SQL queries and you won't even need to use any SQLite functions but executeSQLQuery.
  6. All UV coordinates are saved inside the .dff and so are the name of textures. When you import a .dff to 3DS Max (you check what image extension you want to use, png, tga or bmp), it already has data that tells 3DS Max what texture name the model uses. What you have to do is extract the textures from .txd to regular image file (png, tga or bmp) and then you have to create material in 3DS Max which uses this texture. I don't know if you have any idea what I mean by that.. But that's how it works. 3DS Max can't use .txd as textures because these are game texture archives, not popular image files. So you have to extract images from .txd and use them in 3DS Max. If you make a new texture with different name than original name then you have to update .txd file to let GTA know that this specific texture name is inside .txd. Remember, texture archive means it can contain more than 1 texture.
  7. 50p

    delete sql rows

    WTF??!! you are checking if this is NOT 100, any other value = good (true) value!! re<100 is this what you need? can't you use? DELETE FROM table_name WHERE deaths<100 huh? i dont understand , if i remplace "if ( re ~= 100 ) then" with "if ( re<100 ) then" just says "attempt to compare table with number" Obviously, because result is a table not a number
  8. OK, now I get it. All you need to do is change the string from this: @"\MapExporter\gtasa-map-small.jpg" and @"\MapExporter\marker.tga" to "/MapExporter/gtasa-map-small.jpg" and "/MapExporter/marker.tga" The reason for it is because @ was added in 3DS Max 2008, so the script will work in 2008 and newer versions of 3DS Max. Let me know if this solves the issue.
  9. https://wiki.multitheftauto.com/wiki/DxGetTextWidth https://wiki.multitheftauto.com/wiki/DxGetFontHeight
  10. Your question is void.
  11. Make sure you extracted files into proper location. As you can see the images should be in <3ds max>/Scripts/MapExporter/ folder.
  12. 50p

    char ids

    I guess you haven't read this: https://forum.multitheftauto.com/viewtop ... 91&t=27027
  13. If you want infinite number of combos then I'd suggest you make a table of all the keys and change its value when key is pressed. Basically, make your own isKeyDown function. Something like this: local keysList = { "a", "b", "c", "d", "e", "f", } -- etc., list of the keys you want to check local playerKeyState = { }; -- every player's key state local function changeKeyState( player, key, keyState ) if not playerKeyState[ player ] then playerKeyState[ player ] = { }; -- remember to nil this table when player leaves the server!!! end playerKeyState[ player ][ key ] = ( keyState == "down" ) and true or false; end -- bind the keys for every player online for i, plr in ipairs( getElementsByType( "player" ) ) do for j, key in ipairs( keysList ) do bindKey( plr, key, "both", changeKeyState ); end end function isKeyDown( player, key ) return ( playerKeyState[ player ] ) and playerKeyState[ player ][ key ] or false; end After you've set everything up, you can now use isKeyDown anywhere in your code to check if the specific key is down. -- for instance: if isKeyDown( player, "a" ) and isKeyDown( player, "lshift" ) then -- do something when left shift and a are down end Or you can even make an event which will be triggered when a key is down... -- This is the same function that I showed you above but added triggerEvent local function changeKeyState( player, key, keyState ) if not playerKeyState[ player ] then playerKeyState[ player ] = { }; -- remember to nil this table when player leaves the server!!! end playerKeyState[ player ][ key ] = ( keyState == "down" ) and true or false; triggerEvent( "onPlayerKeyStateChange", player, key, keyState ); end -- Then you can attach handlers to the event and detect key press addEvent( "onPlayerKeyStateChange" ); addEventHandler( "onPlayerKeyStateChange", rootElement, function( key, keyState ) -- 1st way: if isKeyDown( source, "lshift" ) and ( key == "a" ) and ( keyState == "down" ) then -- do something here... end -- 2nd way: if isKeyDown( source, "lshift" ) and isKeyDown( source, "a" ) then -- do something here... end end ) Well, well.. I just gave you entire code for a new function and event that will make your life easier...
  14. 1. You don't need player element for isCursorShowing in client-side script. 2. getElementType returns string or boolean value. What your if statement shows is that you try to check if the returned value is nil and it will never pass the check because: 1. there is no vehicle variable anywhere in the script. It should be "vehicle" not vehicle. 2. because you already checked if the clicked element isn't false or nil in the first statement. NOTE: You should check if the account is guest account before you get its data in server-side script because guest accounts aren't saved.
  15. You have to understand what is Element Tree. Once you know what element tree is, you can fix your problem easily. It doesn't need to be player, it has to be an element. It shouldn't matter if it's player or team but it matters how they are located in the element tree. If you setPlayerTeam then player is assigned to that team but in element tree, team is not player's parent. Understanding element tree is very important because MTA is built on it and every element has its location on the tree. There are functions which let you do same thing for children of specific element, like outputChatBox, lets you print message to 1 player, whole server or team (if the element tree is laid out properly). What you can do Ride1234 is use setElementParent so that player is team's child. For instance: local team = getTeamFromName( "Terrorists" ); setPlayerTeam( player, team ); setElementParent( player, team ); --[[ Element tree would look like this: +Terrorists +Player1 +Player2 +Cops +Player3 +Player4 ]] This way, if you outputChatBox to Terrorists team, it will print the message to Player1 and Player2 only. At least it should because that's how MTA is meant to work.
  16. If you look at the wiki https://wiki.multitheftauto.com/wiki/AddCommandHandler You will notice that addCommandHandler has optional parameters.. Check out the last one which is caseSensitive. If you disable it, you will be able to use 1 command with different variations (/tEsT will work the same as /TEST, etc.).
  17. There is no way to check it but you can make a request on http://bugs.mtasa.com/main_page.php
  18. I'll tell you straight away that your script will not work... Why? Look at setTimer parameters on wiki and your arguments.
  19. You have to export the textures from .txd to .tga, .png or .bmp. Then you have to apply a material (can be Standard) and load the textures into that material.
  20. Great to see some work being done by the script! I'm not a fan of racing games/gamemodes but I'm glad it helped you a lot. I wish I could find out how to export collision files as well.. That would speed everything up even more. Keep exporting I may improve it in the future somehow but before I do it, please give suggestions, what would you like to see and/or what needs change in your opinion?
  21. No, you can't extend the loop maximum execution time.
  22. Yeah Me too, I want to know how to edit the skins lol I hope we will find answer https://forum.multitheftauto.com/viewtop ... 15#p315672
  23. OK. You had errors in your script. Use this code: function replaceModel() local skin = engineLoadTXD ( "skins/80.txd" ) engineImportTXD ( skin, 80 ) skin = engineLoadTXD ( "skins/81.txd" ) engineImportTXD ( skin, 81 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(), replaceModel)
  24. I'm not completely clueless. lol. Yes there is skins in the "skins" folder, they are called 80.txd and 81.txd as in the meta and lua files. I'm not saying you are clueless but even experienced scripters can get such stupid errors. Attach your skin replacer in your next message. I'll try to figure out what is wrong but before you do it. Try to replace skin textures with a delay (setTimer).
  25. Do you have skins folder in the resource?
×
×
  • Create New...