MrTasty

Members
  • Content Count

    911
  • Joined

  • Last visited

  • Days Won

    3

MrTasty last won the day on December 3

MrTasty had the most liked content!

Community Reputation

129 Excellent

About MrTasty

  • Rank
    Hoodsta

Details

  • Location
    United Kingdom
  • Occupation
    Scripting Guru

Recent Profile Visitors

3,092 profile views
  1. addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",root, function (new) if (new == "Running") then startomg_movement() end end) This is my best guess on how to do that, and you already have that in your code. The state "GridCountdown" is apparently the countdown state. The very next state is "Running". Thus, state change from "GridCountdown", or any state tbh, to "Running" should only occur once the countdown is finished. Hence, onRaceStateChanging with new state being "Running" should be triggered just after the countdown ends. Are you sure the code you tested was the one you posted? Perhaps it didn't save and you kept testing some old code?
  2. MrTasty

    fetchRemote Help

    All you have to do is send an event to all clients telling them which texture to use for the shader. See if you can figure out how to do that on your own.
  3. I think you need to read https://wiki.multitheftauto.com/wiki/Scripting_Introduction first, before you can get around trying to "stick" objects to player.
  4. Coroutines are used to pause execution of a routine (a section of the code) whilst waiting for a callback, for example. They aren't a replacement for timers, but rather an addition. If you want to pause and then resume coroutines after some time elapses, you'd be using setTimer as well. If you want temporary vips and bans you'd be best using traditional data storage (XML files, JSON files, SQL, etc. -- preferably SQL) with timestamps to mark end-time and setTimer to trigger the function that removes the vip status or ban. That way you can restart timers when your resource restarts for any reason, since you know the current timestamp and end-timestamp, you can calculate how long setTimer you need.
  5. If you want to get a listing of existing tables, you need to query the hidden sqlite_master table: SELECT name FROM sqlite_master WHERE type='table' If you want to know if a specific table exists: SELECT name FROM sqlite_master WHERE type='table' AND name=? LIMIT 1 sending the table name as a parameter. The no. of returned rows will be 1 if the table exists.
  6. It's HLSL (High Level Shading Language), used for DirectX shaders. https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl There are only a handful of people on MTA who know how to write shaders, which is why its difficult to find any tutorials.
  7. The if checks are unnecessarily complicated. All you need to test for is z position. if (gZ >= 14.39999961853) then -- if it's up at or above Z=14.4 moveObject(gate, 5000, 1588.6999511719, -1638.5, 10, 0, 0, 0) -- move it down to z=10 elseif (gZ <= 10) then -- if it's down at or below Z=10 moveObject(gate, 5000, 1588.6999511719, -1638.5, 14.39999961853, 0, 0, 0) -- move it to Z=14.4 end
  8. Please also post the code that caused this error to occur. The error message includes resource name, file name and line number. Post other relevant lines as well, such as variable definitions and scopes (if, while, do blocks, etc.) that surround the line.
  9. Please. Format the code correctly (code tags--they add line numbers and are much more readable) and give more information. Just saying "giving interference" and posting a :~load of code isn't helping anyone find the issue. Tell us what you intended, what you got, why that is an issue and what have you tried already.
  10. defaults.luac = get 'luac', defaults.prep = get 'prep', defaults.prepa = get 'prepa', defaults.prepcache = get 'prepcache', defaults.luaccache = get 'luaccache', defaults.suffix = get 'suffix', defaults.extension = get 'extension', defaults.naming = get 'naming',--order is important, e=strip extension, s=add suffix, t=replace with target if target exists defaults.tgt = '', There shouldn't be commas at the end of each line, as each line here is a separate statement (optionally, you can end it with a semicolon though). For a code this advanced it's kinda suspicious that you can't read error messages. Presumably this isn't your code?
  11. MrTasty

    Animate

    Most animations are driven by an easing function - the simplest of which is Linear, but you could write your own easing equation - for example, y = x+math.sin(6.29x) if you want to, but most likely you won't need it. If you want something to appear smoothinly, use the return of an easing function as the alpha parameter; if you want it to slide onto the screen, use it for x or y position.
  12. Inspecting the source code, the server event onPlayerDamage only checks for a difference in last known health value and new health value from sync packets, and calculates a loss from that. Perhaps the client version, onClientPlayerDamage provides a more accurate damage HP but I haven't tested that, and the client side source is a little too complicated for me to trace what is exactly happening.
  13. The resource which calls addAccount needs to have the correct permissions set up in ACL. Perhaps the easiest but also the most dangerous way to fix this issue is to add resource.[your resource name] object in the admin ACL group (but this grants way more permissions than just addAccount, so make sure you trust the code)
  14. MrTasty

    /sp

    It is possible, but it would require editing the script that handles /sp
  15. It appears your login panel spawns players in skin 0 (CJ) which is what DayZ uses to detect if an account is glitched. You should let DayZ handle the spawning while your login panel only logs the player in and sets his element data "logedin" (sic) to true