-
Posts
6,089 -
Joined
-
Last visited
-
Days Won
216
Everything posted by IIYAMA
-
You can increase the lock wait timeout: https://stackoverflow.com/questions/6000336/how-to-debug-lock-wait-timeout-exceeded-on-mysql There are multiple reasons why this error can occur, so maybe that will not be enough. Also consider to index your most used columns, like Account: https://www.w3resource.com/mysql/creating-table-advance/create-index.php This will speed up your search queries. But de-increase the speed of removal queries. (which you probably only use when removing accounts)
-
@Vestorn There is a build in method as far as I can remember. But never used it myself. (Maybe somebody else knows) But this is the custom(isable) resource method you can use: https://wiki.multitheftauto.com/wiki/Resource_Web_Access https://wiki.multitheftauto.com/wiki/HttpWrite
-
Account data is a database interface and manager for ONLY account-bounded-data. dbConnect + all other db functions, allows you to create your own database interface and manager. This gives you a lot of freedom, but it also means that you have to write a lot yourself.
-
I updated Burak his example. But I have not refactored the variable names. function AccDatacallback(AccData, player, account, AccName) local result = dbPoll( AccData, 0 ) if AccData and #AccData > 0 then return end local ID = getFreeID() local SetData = dbExec(db,"INSERT INTO stats (ID,Account) VALUES (?, ?)", ID, AccName) end function getpaccount (_,account) local AccName = getAccountName(account) setPlayerName(source,tostring(AccName)) dbQuery(AccDatacallback, {source, account, AccName}, db, "SELECT * FROM stats WHERE Account=? LIMIT 1", AccName) end addEventHandler("onPlayerLogin",root, getpaccount) The function was called instead of provided as function. local AccData = dbQuery(AccDatacallback(), db,"SELECT * FROM stats WHERE Account=? LIMIT 1", AccName) This is now moved inside of the call back function. Since the data is not immediately available. if(AccData) then if(#AccData > 0) then return end end local ID = getFreeID() local SetData = dbExec(db,"INSERT INTO stats (ID,Account) VALUES (?, ?)",ID, AccName)
-
That might be indeed the case. That 5000ms timer is a bit hacky in my opinion. Just listen in the resource (that has the hashCheck function) to the event: "onClientReceivePermissions" (you can cross listen to events of another resources, as long as the element you are listen to is a parent or the source) The predefined variables of that event will be enough to figure out which resource is ready and which is not. See list of predefined variables: https://wiki.multitheftauto.com/wiki/AddEventHandler
-
It might be a ppi issue. (I am not a shader expert) but let me speculate a bit. Afaik: When playing with border less settings and window mode, the same resolution is returned on https://wiki.multitheftauto.com/wiki/GuiGetScreenSize Not sure if you used that one to create your render target. This might put a difference between the resolution the shader is placing the texture on the screen and the resolution delivered by the texture. If this situation is matching yours, what if you do not scale the texture? But placing it with the exact size. Either by the texture size or by the pixels the shader is about to draw. Anyway, those artifacts are most of the time caused by some sort of scaling.
-
With what resolution (math) do you draw your image?
-
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
-
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.
-
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.
-
@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
-
If the problem is indeed with the size of the marker as Burak said. And you want to keep your smaller marker,
-
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.)
-
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)
-
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
-
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.
-
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)
-
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).
-
Please stick with Portuguese, your topic has already been moved to your section, because you couldn't decide which language to use.
-
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
-
Airplane 1.2.0 is released.
https://community.multitheftauto.com/index.php?p=resources&s=details&id=18644
-
-
@TiTawNdo you need more information on this subject? (Or maybe an alternative to XML, depending on the context of the data)
-
Future development of the airplane resource. Fixing the aircraft fly height according to the GTA landscape.
