Jump to content

IIYAMA

Moderators
  • Posts

    6,058
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. With what resolution (math) do you draw your image?
  2. With: https://wiki.multitheftauto.com/wiki/SetCameraMatrix or https://wiki.multitheftauto.com/wiki/GetCamera + https://wiki.multitheftauto.com/wiki/SetElementPosition (https://wiki.multitheftauto.com/wiki/SetElementRotation) See also this useful function for getting the gender of a current skin/model or ped/player. https://wiki.multitheftauto.com/wiki/GetPedGender
  3. If you really want to improve performance, you should make use of callbacks. https://wiki.multitheftauto.com/wiki/DbQuery See 3e and 4e example. If not used, your MTA scripts will stop doing anything until there is response from the database. The database and MTA are running on different threads. Those shouldn't wait for each other. If the database thread takes too long, it will create lag in your MTA server, because the server is simply unable to process things.
  4. Database table or Lua table? In case of a database, the less data is in a single table, the faster it can find items. But when an index is applied. You probably wouldn't notice the difference for while.
  5. @Burak5312 @SinaAmp local SkinData = dbPoll(dbQuery(db,"SELECT * FROM SkinShop WHERE Account=?",accName), -1) if #SkinData > 0 then end The reason why this #SkinData > 0 is used, is because the database query is returning always a table on success. This table contains all results of that query. The # is used for get the length/item count of that table. For example if you have 2 accounts with the same account name. The SkinData table contains 2 items. #SkinData -- results in the value 2. You can add a safety/optimization keyword inside of the query to always return 1 items, which is LIMIT <max items to return>. But not having that inside of the code is not game breaking, but can reduce query execution time. Yet that does not change that SkinData will hold a table value on success. SELECT * FROM SkinShop WHERE Account=? LIMIT 1
  6. If the problem is indeed with the size of the marker as Burak said. And you want to keep your smaller marker,
  7. Does your code only take money when entering the marker1? And you want all markers to do the same thing? If yes, take a look at this tutorial: (If that is not the case, please be a bit more specific.)
  8. inside = createMarker( -1883.283203125, 865.4765625, 35.171875,56.0,"arrow",4.0,0,255,255) -- Removed local inhouse = createMarker( -1883.283203125, 865.4765625, 35.171875,56.0,"arrow",4.0,0,255,255) -- Moved to here. function createmymarker() local inhouse = createMarker( -1883.283203125, 865.4765625, 35.171875,56.0,"arrow",4.0,0,255,255) -- Moved from here. setElementPosition(theplayer,-1883.283203125, 865.4765625, 35.171875) setElementInterior(theplayer, 18) end addEventHandler("onMarkerHit", inhouse, createmymarker) -- Now is the inhouse variable available here and the warning shouldn't show up any more. @SinaAmp local inhouse = createMarker( -1883.283203125, 865.4765625, 35.171875,56.0,"arrow",4.0,0,255,255) function createmymarker() setElementPosition(theplayer,-1883.283203125, 865.4765625, 35.171875) setElementInterior(theplayer, 18) end addEventHandler("onMarkerHit", inhouse, createmymarker)
  9. For the overall synchronisation experience of your server, yes. Take a look at your network usage with and without the blink resource running. You know how to do that right? /shownetstat https://wiki.multitheftauto.com/wiki/Client_Commands#shownetstat
  10. You can do that, but you can also keep it a separated resource and include it in your core meta.xml. That way you can use it easier in multiple application-suited-resources.
  11. Doing it serverside would be a waste of your network usage. How about you use server time to solve your problem? local duration = 1000 local status = (serverTime % duration) > (duration / 2)
  12. It is weird that the default argument is set to true for ponds pools though. ? Maybe it is not real water, just drawn. As the note on wiki suggest (window is missing though).
  13. Please stick with Portuguese, your topic has already been moved to your section, because you couldn't decide which language to use.
  14. Airplane This resource adds ambient aircraft to your MTA map. As many as you want, as long as the MTA element stream engine likes it. The aircraft models can be modified in config_s.lua. The resource was pre-mentioned in the Server time sync resource, because it is was an example resource which made use of serverside time. (And still makes use of) But by posting updates there for a different resource is a bit confusing. It is beyond a test resource now. Note: you still need to download the server time sync resource for this resource to work. You will be given an option to download server time sync resource, when you the download the resource airplane. The resource doesn't only creates planes, but also helicopters. Which is confusing I know, since the resource name is 'airplane'. But it was already too late for that without losing my version archive. Version 1.2.0 / 1.1.1 video's Admin settings Quantity aircraft Developermode Displaying the airplanes and other useful information. Demomode true - Let the resource create the aircraft false - Fill in your own aircraft list manually in file: config_s.lua How the aircraft is adjusted according to the GTA map. The blue crosses are used to display the max ground height of that specific area(200x200). You see that the crosses are placed higher near trees and buildings. The resource will adjust the aircraft height according to this data. This view is visible when development mode is active and some adjustments in the config_s.lua for the ground height data. Dataset for the aircraft height is available here: https://wiki.multitheftauto.com/wiki/Dataset-map-height Pro's: Low CPU usage after initialization. No network usage after initialization. Only the dependency server time sync will use network usage after initialization. Not that many lines of code for you have to scan through, if you want to modify the resource. Simple to implement. If you find a bug, I will be here. Con's No AI implementation. Brain-dead AI. The 'time based driven (animations)' concept is used, not everybody is familiar with that concept. That makes it harder to edit. It basically means that the aircraft animations are unstoppable, since time doesn't stop either. Pro: Which nearly nullifies the need of constant network usage between the server and the client. All aircraft are indestructible (even if not set to damage proof). (Can also be a pro) But I might add something in the future to counter that... but I first must figure out how that is suppose to work. Does not work outside of the GTA map. Download link: Resource Airplane Other downloads: Resource Server time sync Dataset GTA map height
  15. @TiTawNdo you need more information on this subject? (Or maybe an alternative to XML, depending on the context of the data)
  16. @nogisza friendly reminder that your question has been answered.
  17. Future development of the airplane resource. Fixing the aircraft fly height according to the GTA landscape.

     

  18. See this meta.xml tag. https://wiki.multitheftauto.com/wiki/Meta.xml Set it to true in the gamemode which you are using: <sync_map_element_data>true</sync_map_element_data>
  19. It should be working now. @ozulus I have added the large update for the airplane resource. NOTE: Both resources must be updated to the latest version. As promised, high performance after initializing and nearly zero latency. - Added a last minute fix for an unexpected error. 1.1.0 > 1.1.1 Note: Not all bugs have been fixed. Like for example, aircraft can still fly through mountains. But you can adjust that by adding the aircraft manually.
  20. By the way, I fixed the download of the test resource, which seems to be bugged by the forum. But the community resource page also has some issues, hope the link works for you.
  21. An new version on the test resource is getting a little bit out of hand in my local server. ? Creating a 101 aircrafts With very very little network usage. With very little Lua performance impact because of the similar method of the test resource. (This sample resource will be available on the community if there are more people interested in it)
  22. Good observation. If it is an old resource. The shaking is probably created by createExplosion. The explosion was set to tiny, damage + sound disabled and placed behind the camera. Which is the old method for making the camera shake.
  23. I have moved your topic to your own language section. Which you can find here: https://forum.multitheftauto.com/forum/97-portuguese-português/
×
×
  • Create New...