Jump to content

AleksCore

Members
  • Posts

    103
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by AleksCore

  1. 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

  2. --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

    • Like 1
  3. 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

  4. 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 :|

     

  5. 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

  6. 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%)

    • Like 1
    • Thanks 1
  7. 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.

  8. 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).

  9. @code123 maybe a dumb question, but remembering myself years and years before.. well, do you even have a function called "startomg_movement() " ? :D

    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

  10. Hello.. Well, I am stupid and short-sighted.. Mistakes were done and it's went really too far.. everything spun like a snowball down a mountain.. I just hanged out with wrong person(s) who obsessed with hate to MrGreenGaming. Maybe they have reasons to hate MrGreen, but I don't really have. My hate was groundless and based only on my mistakes that I've done previously but didn't wanted to accept them or to count this mistakes as something serious. I understand I deserve all punishments that I ever had and I shouldn't feel hate about it, I should just accept it, regret and move forward.

    I just really went to far with all that edgy talks and all like I am a "cool hacker" and "I don't care". Of course it's not true that I don't care and that I don't regret, I was just protecting myself and not thinking about consequences. Accepting that I really regret and asking for sorry would mean for me like a loss of war, shame and defeat like I am a little boy who got punished.

    But now I want to ask for condescension, forgivness.

    I am sorry for being such an asshole. First of all I apologize to greatly respected @Dutchman101 . I was showing absolute disregard to the situation, indifference and disrespect.

    I apologize to the players who was unable to enjoy playing Mr Green in their weekend. 

    I apologize to server owner @Cena

    I apologize to @flarpfunf who cares a lot about Mr Green and to other players for threats and saying that I won't stop doing ddos, and asking for money (more in a joke way it was but now I udnerstand it's all not a joke).

    I apologize to regular players/admins for disappointing them.

    If I forgot something or someone, please sorry. It's really hard to write this topic for me.. also english isn't my native language.

    I believe everyone deserves second chance. Please unban me. I don't expect it to be fast also I understand I'm too early with my unban appeal.

    Sorry guys..

    I don't ask for instant forgiveness and instant unban. I just hope I can return one day to MTA and to Mr. Green. I was a real f**king idiot for doing all that recent stuff.. and not thinking about consequences and future..

    ?

    After all that support I did for Mr Green by literally volunteering (absolutely for free) and all that time playing MTA and making maps it's actually really sad to being unable even to visit this places legally under my own nickname I used for years and using my own PC. I thought I don't need Mr. Green and MTA anymore. After caring too much about MTA maybe I burned out, tired, it's turned into apathy and hate, I simply went insane..

    I apologize for you who having to read so much of the odd text (of this mindflow).

    Have a nice day!

     

    Serials: CF0BF665ECDDDE5FF7AB2C445D7C1394 and (mod note) 874278BB22EE8480B62E2FDE9129C0E2

    P.S. Remember, you are reading this maybe a minute, but I was writing it more than a hour. ? Sadly I don't have proofs of this but you have to believe me

     

    ?

  11. 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.

    • Like 1
  12. 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

    • Like 1
  13. 18 minutes ago, NegativeIQ said:

    You can use same IN statement for update same way as you use it for select.

    
    UPDATE `race_stats` SET `Info`=2, `Info5`='SomeString' WHERE `playerID` IN(??)
    

    Since these topic is about tips, my tip is to always escape table and field names in mysql to avoid errors (see how i use tilde and single quotes in that code). Also escape any kind of user input.

    Oh, it actually works. Thank you! I like this way.

    @NegativeIQ oh, wait. But what to do if data different for all players? Same columns but different data

×
×
  • Create New...