Jump to content

ixjf

Members
  • Posts

    647
  • Joined

  • Last visited

Everything posted by ixjf

  1. Your code is wrong, as you said, it's a spelling error (you wrote setElementDimension with a capital 's'). And please use local variables WHEREVER you can. There may be other errors but I haven't checked the whole code.
  2. ixjf

    Server Trouble

    Obviously.
  3. Definitely a great mod, too bad it's too buggy. Come on people, leave SA alone for a while and come play 0.5 These shotgun wars on Phil's place are awesome
  4. It may be better to add the link to Town's thread.
  5. It seems like the cause of the unhandled exception @ address: 00000000 while loading the game is due to a graphic setting, not sure if any of you have noticed that already. The fix is having settings get back to defaults by deleting the file in 'Grand Theft Auto Vice City User Files'.
  6. example callServerFunction("getServerMaps",getLocalPlayer()) end,500,1) function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end This is actually wrong because you are trying to call a function that hasn't been declared yet. Plus, the functions "callServerFunction" and "callClientFunction" cannot (but isn't hard to implement) return the value that is returned by the function called. The only thing in which these functions are good is that you don't need to add multiple events to do each thing.
  7. Wrong, no way you could ever be right.
  8. Sure, you do but since the table is indexed you can use # to get its length, turning things flexible.
  9. That one worked, thanks
  10. Why are you declaring a variable and initializing it with the table's length? What's it for?
  11. I have the MTA 0.5.1r2, does it make any difference?
  12. I must have some problem with my client then, it doesn't connect..
  13. Is the server up right now?
  14. ixjf

    mysql problem

    It clearly doesn't connect if it's giving error. And obviously he has the module installed otherwise it would throw the error "attempt to call global 'mysql_connect' (a nil value)", unless he has custom MySQL functions (but I doubt it).
  15. Metatables/metamethods are far from what you want. Your code has nothing to do with metatables either.
  16. Client-side vehicles aren't synced with the server.
  17. A função getRootElement não é chamada sempre que um recurso é iniciado, não tem nada haver. Quando você atribui um evento a uma função, você pode escolher a que elemento o evento será chamado. Como getRootElement retorna o elemento mais alto da árvore (https://wiki.multitheftauto.com/wiki/Element_tree), o evento é atribuído a todos os elementos "filhos" deste.
  18. ixjf

    Is this possible?

    You are welcome.
  19. ixjf

    Is this possible?

    You can remove them from the 'meta.xml' (not totally sure, but I guess only client-side file functions need them added to the 'meta.xml' file to be able to load them). In case it doesn't work removing them, add them again and use the download attribute with value false in each script. By the way, I added an example in my last reply.
  20. ixjf

    Is this possible?

    How does it work? It opens the file and sends the bytes of the file (content of the file, in an "easier" English) to the client by parts (sending big files in one time would lag and probably give the very known "Network trouble" error infinitely). Then the client saves the bytes into a new file with the same name and extension in the cache. How can I do that? Use the function downloadFile from that resource. I showed you the syntax in a reply above. Create a new script file (client side) and (optionally)add the cache attribute in the 'meta.xml' file for it (search the wiki about that attribute if you don't know where to put it or what it does). Inside the file, write for example: downloadFile ( "infernus.dff", "infernus.dff", 1000 ) --first argument passed is the path to the file in the server, second argument is the path to where the file is going to be saved in the client's cache, the third argument is the interval between each event triggering (where it passes the data to the client). Here is an example: addEventHandler ( "onClientResourceStart", resourceRoot, function() downloadFile ( "infernus.dff", "infernus.dff", 500 ) downloadFile ( "infernus.txd", "infernus.txd", 500 ) end ) addEventHandler ( "onClientDownloadComplete", root, function( strFile ) if( ( strFile == "infernus.dff" ) or ( strFile == "infernus.txd" ) )then --load model end end ) I guess this was clear now, tell me if you're getting any problems.
  21. If it's supposed to be a copy of TG/FFS, no, startResource is not used.
  22. ixjf

    Is this possible?

    Can you please try to explain better? I didn't understand what are you trying to ask.
  23. ixjf

    Is this possible?

    As I said, that is only for files like models, pictures, sounds, not for script files.. For script files, use the cache attribute in the 'meta.xml' file. So yes, the resource is started.
  24. Sure, as I said above, '0x000010' is a hexadecimal value (its the HEX value of 16).
  25. Lua assumes 0x000010 is a number (it's the hexadecimal value of 16). I don't know if there is any other way to use 0x000010 in a table without converting it to a string, sorry for not helping much.
×
×
  • Create New...