-
Posts
103 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AleksCore
-
As MTA SA should be run as administrator nowadays to work correctly my AutoIt script solution require some changes to work. (otherwise it won't work) I use this currently: #pragma compile(ExecLevel, requireAdministrator) #RequireAdmin While 1 WinWaitActive("[CLASS:Grand theft auto San Andreas]") Send("{CTRLDOWN}") Send("{ALTDOWN}") Send("{NUMPAD9 down}") Send("{CTRLUP}") Send("{ALTUP}") WinWaitNotActive("[CLASS:Grand theft auto San Andreas]") Send("{CTRLDOWN}") Send("{ALTDOWN}") Send("{NUMPAD6 down}") Send("{CTRLUP}") Send("{ALTUP}") Wend Might be useful for people. Keys can be any obviously its just what I use currently
-
--client-side code addEventHandler ( "onClientVehicleEnter", root, function () iprint(setVehicleHandling(source, "modelFlags", 0x00002000), "client-side") end ) --server-side code addEventHandler ( "onPlayerVehicleEnter", root, function(theVehicle) iprint(setVehicleHandling(theVehicle, "modelFlags", 0x00002000), "server-side") end ) client side returns false for some reason, server side works great. Weird
-
You need this functions: https://wiki.multitheftauto.com/wiki/AddEvent and https://wiki.multitheftauto.com/wiki/TriggerEvent or https://wiki.multitheftauto.com/wiki/TriggerServerEvent or https://wiki.multitheftauto.com/wiki/TriggerClientEvent Example: function myFunction() --code here end addEvent("myCustomEvent", true) addEventHandler("myCustomEvent", root, myFunction) Then trigger this event using one of the trigger functions, for example: triggerServerEvent("myCustomEvent", root) "root" means it will be triggered for all elements and all resources, see wiki for more details https://wiki.multitheftauto.com/wiki/Element_tree That's it. P.S. not 100% sure thought, lazy to check P.P.S. also it can be something like that: myResource = getResourceFromName("myResourceName") myResourceRoot = getResourceRootElement(myResource) triggerServerEvent("myCustomEvent", myResourceRoot) So you call this event only for 1 resource, instead of telling all other resource about this event and creating additional load on CPU etc
-
Well, exact problem is resource not stopping sometimes for some reasons. And no one start it manually, it's all done only using include feauture, so I think it's a bug. Maybe really not a big problem. I will use some event (something like onMapStopping) to reset all the things in my coremarkers, then it should work I think. P.S. oh no. That's dumb. I am completely lost P.P.S. funny thing it's all already working great but bug happens sometimes and it's really annoying. So maybe in future projects better to not use include at all to avoid bugs
-
Hello. I have a problem, I think <include resource .. thingie possibly a bit bugged... And I need a help with it. I have made so called "coremarkers" resource. How it works: you create a race map, put objects (solid boxes model=3798). Open map meta.xml and add <include resource="coremarkers" />. Then when map starts, coremarkers resource starts too and it converts solid boxes into floating boxes without collisions (pickups). Usually it works great, so, map starts, coremarkers start, map stops, coremarkers stop. BUT sometimes coremarkers not stop and it cause problems. I think it's a bug and I don't know exactly how to reproduce it. At some point of testing,coremarkers simply not stop or not start when map starts. Perfectly coremarkers should start when map with coremarkers starts and restart if map played again or stop if map without coremakrers started. And it actually works like that but not always. Must be possible to fix it using Lua scripting but I feel like it's rather hardcoded problem with <include resource.. and honestly no idea how to fix it ezly. Need to write checker which will look into meta.xml and see what resource included and then start it when required and stop. I really don't like this solution Sounds like some annoying bug no one will look into but I hope someone can help me or at least confirm it. About include resource is bugged I know long time ago I think even some scripters confirmed it too. I hope it can be fixed as it's really important thing. coremarkers.zip and map for tests
-
https://community.multitheftauto.com/index.php?p=resources&s=details&id=6778 maybe this script will be useful for you
-
My solution for brightness
-
Aaaand I finally found a solution which I like and I want to share it with everyone. So basically now I am using "borderless keep res" mode in MTA. In the app Gamma Panel (link above) I set brightness profiles. One is "High" for MTA with a bit higher brightness and hotkey Num8, and one is normal, default, hotkey Num5. Of course it would be pain in the ass to click hotkeys everytime to change brightness, so there is a solution for this also! Install "AutoIt!", create a simple script and run it: While 1 WinWaitActive("[CLASS:Grand theft auto San Andreas]") Send("{NUMPAD8 down}") Send("{NUMPAD8 up}") WinWaitNotActive("[CLASS:Grand theft auto San Andreas]") Send("{NUMPAD5 down}") Send("{NUMPAD5 up}") Wend Now for me it works perfectly. I am personally happy with this tricky solution. Good if someone will use it too. P.S. never used AutoIt before, but hopefully did a correct script. It works then its correct I guess (CPU usage by script 0%)
-
https://gamma-panel.en.uptodown.com/windows/download that's currently the best what I found. Not automatic but at least with hotkeys
-
There is a solution, use borderless mode. But then there is trouble with brightness. I have an idea about this too, but need programming skills which I don't have. Need a small app which would increase brightness when MTA SA window is active and then return brightness to normal when minimized.
-
Ok sorry, it's KINDA not a problem directly with MTA, because I have just tried MTA SA version 1.4.1 and bug reproduces. Then as Haxardous guess on GitHub it's a problem with Windows 10 latest updates. That's really sad then as I don't want to downgrade my windows.
-
Also I asked players, they also experience this problem. So basically now we returned to 2006 year when minimizing basically didn't worked. Now it works but better to don't use it Borderless mode should be fixed or Fullscreen, it doesn't matter for me but something requires a fix https://github.com/multitheftauto/mtasa-blue/issues/1103
-
It's not a problem with my game or PC (problem isn't on my side so I can't fix it)
-
https://imgur.com/a/2ntmWvb CPU and everything is pretty relaxed, gta sa process are not in "do not respond" status
-
Topic name says everything. Happens really too often so I can't do scripting or play. I am using fullscreen mode because in borderless modes brightness too low and can't be changed (probably in borderless mode such bug not happens but I can't use it as it's too dark). Happens on any server. As far as I know this problem is pretty popular but I haven't found a topic about that. Sometimes game restores but it takes too much time. Sometimes crashes. PC is good, also never had this problem before in earlier MTA versions (though haven't really played last year or more).
-
@code123 maybe a dumb question, but remembering myself years and years before.. well, do you even have a function called "startomg_movement() " ? Also you can use for example outputChatBox to debug it and see where it fails, also check /debugscript We don't see your full code so it's hard to help. (I don't see). I have a feeling like instead of "startomg_movement()" there should be "omg_movement()" Oh, if its full code then ye, its obviously ur mistake
-
Great resource! Thanks! I think I have found a minor "bug". Create window with 1 or better 2 editboxes. Use only right mouse button or middle mouse button to select editboxes, you will see that caret appears, but if you will try to enter text - it won't enter.
-
I changed only fps, which isn't a big job *lol* Thanks to the devs and to the contributors! Cheers 1.5.3
- 64 replies
-
- awesomeness
- mtasa 1.5.3
-
(and 4 more)
Tagged with:
-
Is there any way to set unsupported (higher) resolution in MTA (windowed mode)? So I'll be able to test GUI on 4K resolution with my FullHD monitor. Would be nice to had such option for devs
- 1 reply
-
- 1
-
-
I've been searching for a MySQL tips and noticed there is no such topics on this forum. So let's fix this little problem. I want to know more about optimising MySQL queries and how to interract with MySQL correctly, I am newbie in that. I learned that putting queries in the loop it's too performance-expensive, wrong, and very big chance it'll freeze your server for uncertain time. So if I want to get information from DB for a many players, better to make it using only 1 query. Example: "SELECT * FROM race_stats WHERE playerID IN(??)" Where "??" = table with logged in players. But, what if I want to update information for a many players at the same time? How such query should look like? For 1 player it looks like this: "UPDATE race_stats SET id1 = id1 + ?, id2 = id2 + ?, id3 = id3 + ?, id4 = id4 + ?, id5 = id5 + ? WHERE playerID = ?" But how to make the same for all players? Put query in the loop will be too performance-expensive I guess and will create laggs. P.S. Maybe for such thing as player stats better to learn MySQL procuderes and create procedure for this, I am newbie, just asking. Don't even know what is procedures exactly, just heard about it.
-
function getSortedTable( tableToSort ) --this function will sort our unsorted table and return sorted table local sortedTable = {} for player, money in ipairs(tableToSort) do local playerName = getPlayerName(player) table.insert( sortedTable,{ ['name'] = playerName, ['value'] = money } ) end table.sort(sortedTable, function(a, b) return a.value > b.value end ) return sortedTable end function show10RichestPlayers() local sortedPlayers = getSortedTable(notSortedTable) --notSortedTable is our table with player element as a key and money number as value for i=1, 10 do outputChatBox(sortedPlayers[i].name.." - $"..sortedPlayers[i].value, root, 0, 255, 0) end end addCommandHandler('show10', show10RichestPlayers) This is how I did it. Here could be mistakes, I didn't tested this code. Maybe for somebody this info will be useful
