Jump to content

koragg

Members
  • Posts

    729
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by koragg

  1. In single player they're located in the audio/SFX/FEET file according to this mod which you can open with SAAT to see which sounds are in which bank as there are different feet sounds for grass and asphalt for example. Then you can see if it's possible to disable the default feet sounds using setWorldSoundEnabled and you can play your own sounds using playSound or playSound3D functions when holding the forwards or sprint key or something (idea taken from here). 

  2. Hey everyone,

     

    Been a while but I'm planning to come back to the MTA scripting scene after a few years of being busy with finishing my studies and with work. The release of 1.6 couldn't have been more perfect in its timing :)

    I have setup a few web resources which I can access the following way: http://192.168.56.1:22005/webtoptimes/

    Problem is that if I have my website / forum hosted on a HTTPS provider including that HTTP link from above in an iframe causes an error of the sort "Cannot use http on https domain" or something similar (haven't set up the site yet so can't paste the exact error but this was what I remember from years ago when I tried the same).

    So I guess my question is more related towards the web part of things but is there a way to allow HTTP links in iframes to work fine on an HTTPS host ? Or if there is a way to make those web resource links use HTTPS instead of HTTP.

  3. I've spent the last 10 years playing MTA and have only good things to say. I've met very nice people throughout the years and had a lot of fun playing after high school every day, sometimes until 4 AM at night. I used to have Team Viewer on my phone so that I could see what's happening in the game or press some keys when needed to get away from AFK mode on MrGreen racing server in order to earn 100 coins for being online each hour instead of the 50 which AFK players earned :D

    Back in the summer of 2015 I started developing my own local racing server just for fun (huge thanks to MrGreen for making theirs open source on which I based my own) and slowly but surely got into programming and found it very interesting. Then a year later when the time came to go to university I didn't hesitate one bit to choose Informatics as my specialty. I am now finishing up my master's degree thesis (project already done) and am hopefully graduating (again) this year :)

    Thanks to making my own server I also got to know and understand web development as I used Simple Machines Forums (SMF) to create a, well, "simple" website for my players. I learned how to create MTA web resources which in turn helped me learn JavaScript and how to embed them in my PHP site so that everything looked as seamless as possible. 

    I am now working as a web developer since late 2019 (first job was intern for 3 months, second am a junior for an year and a half already).

    I still have all of the files for my server and forum so maybe some day I'll get an actual host and put everything online ;)

    Thank you to everyone who I've spent a decade of my life with for all the great memories. You can see some of them on my YouTube channel here ❤️

  4. 2 hours ago, SpecT said:

    Is this about race gamemode?
    If so I remember (time ago) this happening. Parts of the maps were missing out of nowhere.
    The only working solution we found was to set auto-restart every midnight with cron jobs in the hosting.

    I'm a race player and some very old maps tend to flicker some objects and/or make them invisible for some time. No clue why this happens but it does happen rarely. 

    On 26/12/2020 at 11:07, Hydra said:

    To be honest the map editor is bugged af, many errors/warnings in debugscript and sometimes it bugs when saving the map. Instead of adding new functions and resources, the current ones should be fixed

    Hate it when i save my map and it bugs the :~ out of it. Had to start all over again a few times. 

  5. 20 hours ago, RAF3345 said:

    you can do for me ? I do not know how to do this :(

    If the accept id is always the same just write it inside the function like local acceptID = value.

    And use bindKey to bind function to key. If the acceptid isn't the same every time then it can't be done with bindKey and command handler is ok 

    • Like 1
  6. Hello,

    Today I tried to upload an uncompiled resource to the community site and it said that the upload was successful but when I clicked on the "View resource" link it gave me a link which ended with "id=0".

    When I went to My View to check the resource was not there but there is an empty space right where the resource should have been at the top.1KxMSSi.png

    I did "Inspect Element" on it and it can be seen that there is no value assigned to the "id" attribute of the highlighted link. The empty space can be seen as well.

    Tyau7yZ.png

    When I tried to upload the same resource again without changing its version it again said that it was successful but it didn't show up in My View and was again with "id=0".

    • Like 1
  7. The only thing stopping me from using this amazing tool is the NodeJS dependency. Right now I'm hosting my server from my local PC so it will work perfectly. But if I change to a real host they don't give access to the Linux console but only to the MTA server console which means I can't install NodeJS there and can't use it then. Ideal thing would be for it to be usable just like the IRC resource, only depending on websockets.dll (or .so).

  8. Thanks for clearing some things up @IIYAMA, I know how to use OOP in Java/C#/C++/etc but it's a bit weird in Lua for some reason :D

    Fixed my problem with the below code put inside toptimes_server.Lua thanks to @Mihoje :)

    function onNickChange()
    	setTimer(function()
    		for id, player in ipairs(getElementsByType("player")) do
    			g_SToptimesManager:queueUpdate(player)
    			g_SToptimesManager:updateTopText()
    			local playerPosition = g_SToptimesManager.mapTimes:getIndexForPlayer(player)
    			clientCall(player, 'onServerSentToptimes', g_SToptimesManager.toptimesDataForMap, g_SToptimesManager.serverRevision, playerPosition)
    		end
    	end, 1500, 1) -- This delay has to be bigger than the one which sets the current player name in the maptimes_server.Lua file!
    end
    addEventHandler("onPlayerChangeNick", root, onNickChange)

     

    • Like 1
  9. 1 hour ago, IIYAMA said:

    It is possible, but what is the real problem?

    - The synchronisation concept for the data?

    Or

    - How to use OOP?

     

     

    How to use it I guess. I tried the below and nothing happened.

    function onNickChange()
    	self:updateTopText()
    end
    addEventHandler("onPlayerChangeNick", root, onNickChange)

    also tried this:

    function onNickChange()
    	if g_SToptimesManager and g_SToptimesManager.mapTimes then
    		g_SToptimesManager:updateTopText()
    	end
    end
    addEventHandler("onPlayerChangeNick", root, onNickChange)

    as well as this:
     

    function onNickChange()
    	if g_SToptimesManager then
    		local map = exports.cr_mapmanager:getRunningGamemodeMap()
    		local mapName = getResourceInfo(map, "name") or getResourceName(map)
    		g_SToptimesManager:setModeAndMap("Sprint", mapName)
    	end
    end
    addEventHandler("onPlayerChangeNick", root, onNickChange)

    Problem is I don't know how to work with OOP in Lua at all! Imo those things or at least one should've worked, but none do and I get no errors in /debugscript 3.

    Tried the above in the toptimes_server.Lua file^

  10. Hey guys,

    Is it possible to update the toptimes window forcefully for all players whenever a player changes their nickname? I tried using some of the functions in the resource but since it's all in OOP - Idk nothing.

    Basically I've made the toptimes script to record account names into the database and to show account data as top name for all players in the F5 window. Every time a player changes their nickname that account data also changes so I want to forcefully update the F5 toptimes window for all playes online in order for it to be exactly up to date with the top names.

×
×
  • Create New...