Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    40

Everything posted by myonlake

  1. fromJSON already returns a table. You are wrapping the table with a table, which means the whole structure gets corrupted. Try removing the table wrap { ... } around the fromJSON and you should be fine.
  2. It means it cannot access an account with the name vehicleManager and password ds4f9$. The resource seems to create the account automatically if not found. However, it might not be able to, if the resource doesn't have required permissions (make sure you give it the ACL permissions in the acl.xml file).
  3. No. This has also been asked before:
  4. Well, if you want to run it as a screen or do something else while at it, that's why he's not running the server directly.
  5. Hey, I am not able to join my local server. This problem started today. I did not have this problem yesterday (so, latest MTA:SA patch may have broken something too.) MTADiag: https://pastebin.mtasa.com/203464849 I have done a full virus check in Malwarebytes and results were zero. I also reset the networks with a batch file offered in another post. I also cleared out some firewall rules and reset them. I have port forwarded all of the ports correctly and shows up as open on the server console. MTA master server is able to detect my IPv4 address correctly. I have tried using my public and private IP addresses to join the server. I have downloaded the latest server configurations from GitHub. I have no other programs (best to my knowledge) that would be causing a conflict with the ports or so. I closed Steam, Chrome and Spotify as well. I have also tried changing the ports on the server and port forwarding those, but with no luck. I have not completely uninstalled and installed Multi Theft Auto because I feel that would be unnecessary? I however ran the installer while still having MTA installed on my PC, so I guess a soft-reinstall. I have restarted my computer and router. I have just one resource on my server and it is not running. I have cleared my resources folder (both public and private) and the resources cache folder and cleared out everything else that the server and client auto-creates if not found (including log files, backups, keys, databases). I am able to join other servers. All servers list correctly, including my local server which I cannot join (both internet and local tabs). I have tried changing my nickname and other settings, including deleting the config file and therefore having reset the settings. Entering the server: Error after a while: To be honest, I have absolutely no idea why it is not working. Could this be a bug in the code? Thanks.
  6. You can have cutscenes too, just takes a bit more effort
  7. You have to script it all from ground up, basically.
  8. DELETE https://community.multitheftauto.com/index.php?p ... ls&id=4994 https://community.multitheftauto.com/index.php?p ... ls&id=7999 If possible, please also delete the account. DONE
  9. You are probably looking for https://wiki.multitheftauto.com/wiki/Se ... Streamable
  10. Network encryption is no longer an option, as it is enabled by default. You can delete that line from your configuration file.
  11. There is no performance drop with that, only a few more calls, that's all.
  12. A lot of things you can learn from just the internet, really. And I never took any classes on any programming language, or an assembler or whatever, I've learnt it all by doing and experimenting, and ultimately just hacking. No, it doesn't fix anything, it's just a different way to do the whole process. Regardless of what you have running in your runtime you can dump it out regardless of where you got the code from originally. As long as you're running it on your PC, you can get the original code.
  13. Actually, in international English standards, you use (modern) British English (–ise), not American English (–ize). Besides, I only expressed my view but you called me an idiot which I find quite offensive. Your opinion? Then why is your opinion to scold me for pointing out the issues of MTA that could have been easily avoided. It's not like I didn't try to help. And even if I was implying to remove the built-in decrypt function, it could still work. They could've still sent the request from the server to luac.multitheftauto.com and receive the bytecode for runtime. It's not like the server is not going to be connected to the Internet. And as of realize/realise issue, it is actually fine to write it both ways. I just corrected you because you're using British spelling to sound smart, when obviously you are not. Doesn't fix anything. Sniffing is way easier than you think... at least for those who already know how to get the decrypted code.
  14. Why all this arrogance? Ok, i made a mistake, this is normal, you could have just explained why my code wouldn't work without 'disrespecting' me, You don't even know who am i. Also my English isn't perfect, this is a fact, But I have the same right as you to post here, Have a great day . Because you were replying as if you knew exactly what you were doing. Apparently you didn't, but there you go.
  15. It's a bit advanced, really, not a simple task since you want to have some custom rendering and camera movement and so on...
  16. Test it. Explaining it is a bit difficult since you probably have no idea what velocity really does to a element. Simple examples without much effort for the velocity intensity part: -- Wind towards north setWindVelocity( 0, 1, 0 ) -- Wind towards south setWindVelocity( 0, -1, 0 ) -- Wind towards west setWindVelocity( -1, 0, 0 ) -- Wind towards east setWindVelocity( 1, 0, 0 ) -- Wind towards north-west setWindVelocity( -1, 1, 0 ) -- Wind towards north-east setWindVelocity( 1, 1, 0 ) -- Wind towards south-west setWindVelocity( -1, -1, 0 ) -- Wind towards south-east setWindVelocity( 1, -1, 0 )
  17. Sorry, wrong code in the first post, updated now with proper formatting. The first anchor is there for a reason, anyway (compare step count as well). https://regex101.com/r/tB1pL7/1
  18. That would be a problem if the keys were strings or everything else, with numbers the hashtag works very well. returns = { -- getVehicleOccupants returns [0] = "a", [1] = "b", [2] = "c", [3] = "d" } print ( #returns ) Prints: +1 = the amount of occupants. That's what we call a hack. You should learn Lua and English before throwing crap like that here. If there is no occupant in a seat, it will have no index, meaning your hashtag method will not work since it cannot count non-index tables. It is called a key table when it's not purely indexed, having 0, 2, 5, 10 instead of 1, 2, 3, 4, etc. Wish to see it in action? 0 from print( #{ [ 0 ] = true, [ 2 ] = true } ) You can mind blow with this code addEventHandler( "onResourceStart", resourceRoot, function( ) setTimer( function( ) local function count( table ) local count = 0 for _ in pairs( table ) do count = count + 1 end return count end local vehicle = createVehicle( getVehicleModelFromName( "Premier" ), 0, 0, 3 ) if ( isElement( vehicle ) ) then print( "vehicle created <" .. tostring( vehicle ) .. ">" ) local peds = 10 for i = 0, peds - 1, 2 do local ped = createPed( 0, 0 + i, 0, 3 ) if ( isElement( ped ) ) then print( "ped created <" .. tostring( ped ) .. ">" ) if ( not warpPedIntoVehicle( ped, vehicle, i ) ) then print( "ped <" .. tostring( ped ) .. "> NOT warped to vehicle <" .. tostring( vehicle ) .. "> at slot " .. i ) local occupants = getVehicleOccupants( vehicle ) print( ">> vehicle occupants: #occupants => " .. #occupants ) print( ">> vehicle occupants: count( occupants ) => " .. count( occupants ) ) print( " begin" ) for i, v in ipairs( occupants ) do print( " vehicle occupant: " .. i .. ": " .. tostring( v ) ) end print( " end" ) print( " begin" ) for i, v in pairs( occupants ) do print( " vehicle occupant: " .. i .. ": " .. tostring( v ) ) end print( " end" ) local elements = { "ped", "vehicle" } for i = 1, #elements do local elements = getElementsByType( elements[ i ], resourceRoot ) for i = 1, #elements do destroyElement( elements[ i ] ) end end break else print( "ped <" .. tostring( ped ) .. "> warped to vehicle <" .. tostring( vehicle ) .. "> at slot " .. i ) end end end end end, 50, 1 ) end )
  19. Holy crap, don't do that. Use https://wiki.multitheftauto.com/wiki/OnConsole and call showChat whenever someone tries to show it. Not sure if MTA's internal command system is considered as "existing command handler" in this case, but test it at least.
  20. No. getVehicleOccupants returns a key table, not an index table. Your hashtag will not work.
  21. Like AlvarO said, you can't. Only by replacing existing models.
  22. You are using it wrong. carPartsTable has three elements (1-3). You are iterating through each one and using value[ x ], but the values are not tables, they are some other data type (string, integer, etc.) So, don't loop it. Remove the for loop and just use carPartsTable[ 1 ] etc.
  23. Hey, The pcrecpp library MTA uses for regular expressions is unknown to me. The syntax is for whatever reason different from what PHP and JavaScript uses, even though as far as I know PHP uses the exact same library? Can someone lend me a hand figuring out the right syntax for this, as it seems this gives zero results when using pregFind/match. ^[^local ]function (.*?)\( Flags: mi Everywhere else: /^[^local ]function (.*?)\(/gmi local function testing1( ) end function testing2( ) -- matches on regex101, but not via MTA's pregs end addEventHandler( "test", function( ) end ) To those who don't know what this is, don't bother replying. MTA devs didn't know anything on irc today, so hoping someone knows here...
×
×
  • Create New...