Jump to content

xTravax

Members
  • Posts

    665
  • Joined

  • Last visited

Posts posted by xTravax

  1. 1 hour ago, Arran said:

    Is it just existing MTA internal functions that you want documenting? I thought that visual studio already has features which show you function lists and their parameters. The main thing that stopped me being able to contribute more was when it comes to doing something new, I wouldn't have the slightest clue where to start so for me the most useful documentation would be explaining how to do new things which I guess involves memory hacks.

    Like you said, this is something that is done over the long term so there's no reason why you can't get the ball rolling by getting a list of all functions and there parameters and starting some wiki pages with this basic information and then include stuff like "Please can a developer who understands this explain this" and then eventually some information might get added to it.

    Yes, you're right about this. I completely forgot about it. If i want an idea to get going, I should contribute as well. I'll take your idea of grabbing function names and their parameters to at least start the base of documenting the MTA code :)

    I just have to figure out how everything works on Wiki, to not mess it up. I'll post updates here when I add some stuff to Wiki.

  2. 5 minutes ago, Arran said:

    MTA is open source... What is stopping YOU from documenting this stuff?

    Here's some documentation: https://wiki.multitheftauto.com/wiki/Coding_info

    And guess who wrote that page? I did. Am I an MTA developer? No. I have managed to make documentation and contribute actual working source patches yet the C++ knowledge that I have could be learned within 1 day so what is your excuse for not looking at the source code and documenting it? Because you didn't make that source code? And you really think whoever wrote that is even around now to document it or anyone can even remember what exactly was written by who when some of this source is 10 years old?

    What is stopping me from documenting this stuff? Lack of knowledge perhaps? Great, so you did some documentation back there, that's pretty great, so since you feel proud for doing that page, why don't you document more stuff then? (Uh please don't get this sentence like I'm trying to personally fight with you, I'm not).
    The people who currently work/contribute to the project certaintly know lot of code of it what it does, or what it probably does, it's easier for someone who already has the knowledge to document a function, rather than telling someone of zero knowledge of it like me to do it.

    I am wondering if you guys are just trying to cause a fight in here to get this topic and idea thrown away just because you consider me some selfish bastard who wants other people to do stuff for me, while I'm not doing that, but I'm rather suggesting this topic idea to everyone so everyone could contribute.

  3. I have no idea what the hell is your problem, I see you've barely read my posts, you probably just read some sentences and took them out of context to look bad.

    6 hours ago, -ffs-Sniper said:

    Those who joined later definitely cannot be blamed for lack of documentation neither can they be held responsible/forced to start creating a massive documentation at this point.

    Where did I blame MTA Developers for lack of documentation, or even forced them to do any massive documentation? I have suggested that anyone could contribute to making documentation of MTA code, they don't have to be from MTA Team, they could be even random people.

    6 hours ago, -ffs-Sniper said:

    Implying MTA contributors are egoistic dickheads because Arran rejected your point is a very unfair thing to say - especially considering how this project is totally non-profit and yet requires almost full-time care by those who still are active to at least keep this thing stable, pretty much free of cheaters (kudos to ccw) and somewhat developing.

    I didn't say that they are egoistick dickheads, I said that Arran portrayed them that way, because many requests get denied just because they can be done by someone else or because they don't have time for it. I understand how much current active MTA Developers work to keep this project up to date, and also MTA Contributors. I have no idea where you're getting information that I'm not respecting their work.

    6 hours ago, -ffs-Sniper said:

    Question is: Why don't you take the chance and hook yourself up into this project to try solve the problem of documentation instead of complaining about well-known and obvious issues? In the end everyone involved nowadays had to work his way into this project from zero.

    Because it's really hard to get to know a code which isn't really too well documented, hence the reason why I made this topic in first place. I don't want documentation so just I could selfishly know how to code for MTA, I want the documentation so that everyone can get into contributing without spending months of testing and trying to understand how everything works in there since functions aren't really documented.

    Also, since you're so clearly bad at reading, keep in mind that I'm not making anyone to do this instantly, or forcing MTA Team to do this. I am suggesting that MTA code gets documented over time by any person. Function by function for instance, after a year or so the documentation could reach the half of MTA code perhaps, or even whole code, and make it easier for other people to learn how to contribute faster. With proper documentation, getting ready to contribute to MTA could take weeks or even days to learn, and at moment it takes months because of lack of documentation, and even after few months of testing and stuff, you still know very little. By this topic I am encouraging people to help out this project by documenting it, so that we would have more contributors in advance. I am not forcing anyone to do it.

  4. 24 minutes ago, Arran said:

    MTA developers shouldn't waste time documenting stuff

    I was just waiting for someone to say this.

    "We are MTA Team, we have a huge ego, you should oblige us, screw you if you have requests, your request can be done in a very harder way, so why should MTA Team make it easier for you?" - This is exact thing what you're portraying right now. If you'd have read my post, you'd have seen that I've said that it could be done over time, not instantly right now. Throughout time file by file, or document by document could be documented. Those 17 pull requests are mostly sitting there, some of them get included over time. There would be way more pull requests if there was more documentation about the code. Right now, to become good at contributing what you'd have to do is spend few months learning, testing, experimenting how everything works, all by yourself, and probably wait for hours/days/weeks for someone to even reply to you how to do certain thing to code when you have no idea how to accomplish something. Even with Discord this takes that long.

    What do you have now, like 3-4 contributors and 2-3 MTA Staff members working on code, you really find that number of people to be so great? With bigger documentation that number would easily be able to increase, perhaps even to 20-30. This game might be old as well but it's still being played by a lot of people, and more contributors could mean that complex stuff such as custom animations, custom IDs and such could be much easily and faster implemented. I'm waiting for someone's reply which will say how I'm wrong and that it's just a waste of time (again).

  5. Good to hear that there is already pretty enough documentation to get started. I've checked the source code for a bit, and found out like I thought that there are lots of files e.g related to animations, but you can't really guess which one does what just from looking at names, you need to take a look on the code as well to get more into it. It would be cool though if at least some important files which are big or are constantly used if they at least could be documented on Wiki since there are thousands of files back there. If someone did a little youtube series on coding for MTA that might even be easier than writing all those Wiki pages haha.
     

    4 hours ago, Jusonex said:

    However, I could imagine documenting some "basic patterns" like "How to implement a Lua function" or general guides like "How to learn reverse engineering for MTA".

    Definitely. Youtube came to my mind as I was writing this post, it might be even easier to do than create/code all those Wiki images. Some dev(s) when they get time could record at least basic stuff, how to compile, how to make your own Lua function in C++, and so on, it doesn't need to go into huge detail or series, but at least the basics, if the dev who records the videos wants to make more videos that's even better since people will more easily understand how stuff works. This youtube idea is like when you want to learn a new language and you start watching tutorials on that language, basically like that.

    I know my idea might be or sound exhausting but I just think that if this idea was partially or fully did one day, that in the future it would help out people who would like to contribute to MTA, and that is what I would like to see, more contributors, even I would like to learn how to contribute but it's a bit hard to start as I mentioned earlier

    Thank you for replying to my topic, if you want to say anything more related to this topic, feel free to do so as I'm interested what you guys back at MTA Team think of this :)

    • Like 1
  6. Oh god.

    @naser that is same code and it wouldn't work

    @dimos that's the same code with an error, using serverside function in client event (which also is unnecessary because the player is dead for sure)

    @dakilla i'm in a vehicle, i wouldn't make this topic if i weren't in a vehicle, why would i even want to destroy an un-existant vehicle anyway?

  7.   
    addEventHandler("onPlayerWasted",root, 
       function() 
          destroyElement(getPedOccupiedVehicle(source)) 
       end 
    ) 
    

    this doesn't work

    it says expected element at argument 1, got boolean

    can someone explain why this most easiest code in the universe doesn't work?

    i guess getPedOccupiedVehicle returns false when driver is dead, is there any workaround for this?

  8. They are in default race utils_client.lua I guess.

    Didn't find it there. I thought that this was in oop or something because of ':' stuff.

    I will keep digging because i'm not using the default race gamemode, and this allign function could help me a lot.

    Anyway, thanks. If I run into some kind of problem, i'll make a post below.

    edit: for anyone looking for that Vector3D function location, it's in _commons.lua file in race gamemode.

  9. Labivilla i'm using my own race.

    @Noki

    that rotation thing works sometimes and sometimes doesn't. The vehicle doesn't get front directioned and 'flipped' like in the video, that's probably because setElementRotation works in some cases, and in some not, and maybe that's why race uses matrices/vectors, but i don't know how to do those.

    also, the thing is that if car is in air, and currently rotated like it's on roof, it should rotate the vehicle to front and not on roof normally, but i dont' know how to achieve that.

    edit:

    i believe this is how it's done in race but i don't understand it

    function directionToRotation2D( x, y ) 
        return rem( math.atan2( y, x ) * (360/6.28) - 90, 360 ) 
    end 
      
    function alignVehicleWithUp() 
        local vehicle = g_Vehicle 
        if not vehicle then return end 
      
        local matrix = getElementMatrix( vehicle ) 
        local Right = Vector3D:new( matrix[1][1], matrix[1][2], matrix[1][3] ) 
        local Fwd   = Vector3D:new( matrix[2][1], matrix[2][2], matrix[2][3] ) 
        local Up    = Vector3D:new( matrix[3][1], matrix[3][2], matrix[3][3] ) 
      
        local Velocity = Vector3D:new( getElementVelocity( vehicle ) ) 
        local rz 
      
        if Velocity:Length() > 0.05 and Up.z < 0.001 then 
            -- If velocity is valid, and we are upside down, use it to determine rotation 
            rz = directionToRotation2D( Velocity.x, Velocity.y ) 
        else 
            -- Otherwise use facing direction to determine rotation 
            rz = directionToRotation2D( Fwd.x, Fwd.y ) 
        end 
      
        setElementRotation( vehicle, 0, 0, rz ) 
    end 
    

  10. hey guys how could i always flip a car in front direction? i mean look like here

    car is currently in certain rotation while at wallride, and when it hits the pickup it gets correct, and front direction rotation

    how could i achieve this front direction thing nevertheless of the vehicle state(whether its on roof, half on roof or not on roof at all) ?

    In race code it uses some vectors and/or element/camera matrix to calculate this, but i don't really understand it..

    Thanks in advance

  11. hi i got a problem guyz

    i am using this sort of function to load DM maps but it dont work, it load all other maps even DD and Race

    function LoadDMMaps() 
      
       for _,resource in pairs(getResources()) do 
           
          if getResourceInfo(resource,"type") == "map" then 
             if getResourceInfo(resource,"gamemodes") == "race" then 
                if string.find(getResourceInfo(resource,"name"),"[DM]",1) then 
                   local MapName = getMapName(resource); 
                   local MapAuthor = getMapAuthor(resource); 
                   table.insert(Maps.DM,{resource,MapName,MapAuthor}); 
                   outputDebugString("loading dm maps... count: "..(#Maps.DM),0,0,187,255); 
                end; 
             end; 
          end; 
       end; 
    end; 
    setTimer(LoadDMMaps,50,1) 
    

    why does this happen? it's suppose to put in table only maps which have [DM] in their names...

  12. hello, what would be easiest way to change value from e.g 0 to 20 (like goes up 0,1,2,3 to 20) and when it reaches 20 it goes to 0 like (20,19,28 to 0) and then starts doing this again over and over again(like a loop)

    thanks in advance

  13. Hi

    I've got this code:

    executeSQLQuery( 'CREATE TABLE IF NOT EXISTS SerialData ( serialPlayer TEXT, key STRING, value TEXT )' ) 
    aType = {["number"] = true,["string"] = true} 
      
    function setSerialData(serial,key,value)  
    outputDebugString("setSerialData '"..key.."', '"..tostring(value).."'") 
        if type(key) == "string" and aType[type(value)] then 
            if getSerialData( serial, key ) then 
                executeSQLQuery( 'UPDATE SerialData SET serialPlayer = ?, key = ?, value = ?', serial, key, value ) 
                return true 
            else 
                executeSQLQuery( 'INSERT INTO SerialData( serialPlayer, key, value ) VALUES( ?, ?, ? )', serial, key, value ) 
                return true 
            end 
        end 
    end 
      
    function getSerialData(serial,key) 
    outputDebugString("getSerialData") 
        if type(key) == "string" then 
            result = executeSQLQuery( 'SELECT value FROM SerialData WHERE key = ? AND serialPlayer = ?', key, serial ) 
        end 
        if result and type(result) == "table" and #result > 0 then 
            if result[1]["value"] then 
                return result[1]["value"] 
            else 
                return false 
            end 
        end 
        return false 
    end 
      
    function removeSerialData(serial,key) 
        if type(key) == "string" then 
            if getSerialData(serial,key) then 
                executeSQLQuery( 'DELETE FROM SerialData WHERE key = ? AND serialPlayer = ?', key, serial ) 
                return true 
            end 
        end 
    end 
    

    it works flawlessly, though there's one problem

    When i use those functions to store data on my serial, it works but if i log out and make completely new account and login to it, that data will get lost(returning false) for unknown reason

    Does anyone know why does this occur?it only occurs onPlayerLogin and this code above is not even executed when data gets corrupted

×
×
  • Create New...