MrTasty

Members
  • Content Count

    901
  • Joined

  • Last visited

  • Days Won

    1

MrTasty last won the day on August 24

MrTasty had the most liked content!

Community Reputation

123 Excellent

About MrTasty

  • Rank
    Hoodsta

Details

  • Location
    United Kingdom
  • Occupation
    Scripting Guru

Recent Profile Visitors

3,049 profile views
  1. 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.
  2. 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.
  3. 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)
  4. MrTasty

    /sp

    It is possible, but it would require editing the script that handles /sp
  5. 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
  6. <?php $file_name = "my_script"; // filename without .Lua extension $body = file_get_contents($file_name.".Lua"); // Create a stream $opts = array( 'http'=>array( 'method'=>"POST", 'content' => $body // send the Lua code as body of the request ) ); $context = stream_context_create($opts); $compiled = file_get_contents('https://luac.mtasa.com/?compile=1&debug=0&obfuscate=3', false, $context); file_put_contents($file_name.".luac", $compiled); // save to same name but .luac ?>
  7. With ipairs it will stop looping as soon as it encounters a non-existent index. I.e. for 1,2,8 will only execute for 1 and 2, and because 3 does not exist it will break out of the loop. You'll need to use an auto-indexed table with the layer priority as a part of the layer data table, and table.sort after every addition
  8. MrTasty

    [HELP]

    I don't understand what you mean, however, I'd like to point out your code will trigger on any marker instead of only on tp1, because of propagation of events. You need to add a false right aft er the function in the event handler to only bind it on the specified element and not its parents. In other words, you should be using addEventHandler("onMarkerHit", tp1, msg, false) Also, please, use a proper, more helpful, topic title next time. Just putting in [HELP] doesn't inform us what the problem is, and therefore people are unlikely to click your topic if they don't know the problem relates to their expertise.
  9. Depends on what game mode you're running. If you have no game mode (and player's don't spawn automatically at all), all you have to do is call spawnPlayer on onPlayerJoin If you're using a game mode that comes preinstalled on MTA servers (such as play, race, dm, etc.), you can get help here. If you're using a third party game mode, it would be best if you contact the author, or post a section of the code that deals with spawning (provided it is not a leaked game mode, we will help you modify the original spawn code, but only if you provide it to us)
  10. 👉 https://forum.mtasa.com/forum/97-portuguese-português/
  11. local IFP_FILE = "custom_ped_file.ifp" local CUSTOM_PED_BLOCK_NAME = "ped_custom" local pedAnims = {"abseil", "arrestgun", "atm", "bike_elbowl", "bike_elbowr", "bike_fallr", "bike_fall_off", "bike_pickupl", "bike_pickupr", "bike_pullupl", "bike_pullupr", "bomber", "car_alignhi_lhs", "car_alignhi_rhs", "car_align_lhs", "car_align_rhs", "car_closedoorl_lhs", "car_closedoorl_rhs", "car_closedoor_lhs", "car_closedoor_rhs", "car_close_lhs", "car_close_rhs", "car_crawloutrhs", "car_dead_lhs", "car_dead_rhs", "car_doorlocked_lhs", "car_doorlocked_rhs", "car_fallout_lhs", "car_fallout_rhs", "car_getinl_lhs", "car_getinl_rhs", "car_getin_lhs", "car_getin_rhs", "car_getoutl_lhs", "car_getoutl_rhs", "car_getout_lhs", "car_getout_rhs", "car_hookertalk", "car_jackedlhs", "car_jackedrhs", "car_jumpin_lhs", "car_lb", "car_lb_pro", "car_lb_weak", "car_ljackedlhs", "car_ljackedrhs", "car_lshuffle_rhs", "car_lsit", "car_open_lhs", "car_open_rhs", "car_pulloutl_lhs", "car_pulloutl_rhs", "car_pullout_lhs", "car_pullout_rhs", "car_qjacked", "car_rolldoor", "car_rolldoorlo", "car_rollout_lhs", "car_rollout_rhs", "car_shuffle_rhs", "car_sit", "car_sitp", "car_sitplo", "car_sit_pro", "car_sit_weak", "car_tune_radio", "climb_idle", "climb_jump", "climb_jump2fall", "climb_jump_b", "climb_pull", "climb_stand", "climb_stand_finish", "cower", "crouch_roll_l", "crouch_roll_r", "dam_arml_frmbk", "dam_arml_frmft", "dam_arml_frmlt", "dam_armr_frmbk", "dam_armr_frmft", "dam_armr_frmrt", "dam_legl_frmbk", "dam_legl_frmft", "dam_legl_frmlt", "dam_legr_frmbk", "dam_legr_frmft", "dam_legr_frmrt", "dam_stomach_frmbk", "dam_stomach_frmft", "dam_stomach_frmlt", "dam_stomach_frmrt", "door_lhinge_o", "door_rhinge_o", "drivebyl_l", "drivebyl_r", "driveby_l", "driveby_r", "drive_boat", "drive_boat_back", "drive_boat_l", "drive_boat_r", "drive_l", "drive_lo_l", "drive_lo_r", "drive_l_pro", "drive_l_pro_slow", "drive_l_slow", "drive_l_weak", "drive_l_weak_slow", "drive_r", "drive_r_pro", "drive_r_pro_slow", "drive_r_slow", "drive_r_weak", "drive_r_weak_slow", "drive_truck", "drive_truck_back", "drive_truck_l", "drive_truck_r", "drown", "duck_cower", "endchat_01", "endchat_02", "endchat_03", "ev_dive", "ev_step", "facanger", "facgum", "facsurp", "facsurpm", "factalk", "facurios", "fall_back", "fall_collapse", "fall_fall", "fall_front", "fall_glide", "fall_land", "fall_skydive", "fight2idle", "fighta_1", "fighta_2", "fighta_3", "fighta_block", "fighta_g", "fighta_m", "fightidle", "fightshb", "fightshf", "fightsh_bwd", "fightsh_fwd", "fightsh_left", "fightsh_right", "flee_lkaround_01", "floor_hit", "floor_hit_f", ":Ou", "gang_gunstand", "gas_cwr", "getup", "getup_front", "gum_eat", "guncrouchbwd", "guncrouchfwd", "gunmove_bwd", "gunmove_fwd", "gunmove_l", "gunmove_r", "gun_2_idle", "gun_butt", "gun_butt_crouch", "gun_stand", "handscower", "handsup", "hita_1", "hita_2", "hita_3", "hit_back", "hit_behind", "hit_front", "hit_gun_butt", "hit_l", "hit_r", "hit_walk", "hit_wall", "idlestance_fat", "idlestance_old", "idle_armed", "idle_chat", "idle_csaw", "idle_gang1", "idle_hbhb", "idle_rocket", "idle_stance", "idle_taxi", "idle_tired", "jetpack_idle", "jog_femalea", "jog_malea", "jump_glide", "jump_land", "jump_launch", "jump_launch_r", "kart_drive", "kart_l", "kart_lb", "kart_r", "kd_left", "kd_right", "ko_shot_face", "ko_shot_front", "ko_shot_stom", "ko_skid_back", "ko_skid_front", "ko_spin_l", "ko_spin_r", "pass_smoke_in_car", "phone_in", "phone_out", "phone_talk", "player_sneak", "player_sneak_walkstart", "roadcross", "roadcross_female", "roadcross_gang", "roadcross_old", "run_1armed", "run_armed", "run_civi", "run_csaw", "run_fat", "run_fatold", "run_gang1", "run_left", "run_old", "run_player", "run_right", "run_rocket", "run_stop", "run_stopr", "run_wuzi", "seat_down", "seat_idle", "seat_up", "shot_leftp", "shot_partial", "shot_partial_b", "shot_rightp", "shove_partial", "smoke_in_car", "sprint_civi", "sprint_panic", "sprint_wuzi", "swat_run", "swim_tread", "tap_hand", "tap_handp", "turn_180", "turn_l", "turn_r", "walk_armed", "walk_civi", "walk_csaw", "walk_doorpartial", "walk_drunk", "walk_fat", "walk_fatold", "walk_gang1", "walk_gang2", "walk_old", "walk_player", "walk_rocket", "walk_shuffle", "walk_start", "walk_start_armed", "walk_start_csaw", "walk_start_rocket", "walk_wuzi", "weapon_crouch", "woman_idlestance", "woman_run", "woman_runbusy", "woman_runfatold", "woman_runpanic", "woman_runsexy", "woman_walkbusy", "woman_walkfatold", "woman_walknorm", "woman_walkold", "woman_walkpro", "woman_walksexy", "woman_walkshop", "xpressscratch"} -- load the IFP file local IFP = engineLoadIFP(IFP_FILE, CUSTOM_PED_BLOCK_NAME) if not IFP then outputChatBox("Failed to load '" .. IFP_FILE .. "'") end function replacePedAnims(ped) for i, animName in pairs(pedAnims) do -- loop the anims table above engineReplaceAnimation(ped, "ped", animName, CUSTOM_PED_BLOCK_NAME, animName) -- and replace the original anim with the custom one end end addEventHandler("onClientElementStreamIn", root, function() -- on element stream in if getElementType(source) == "player" or getElementType(source) == "ped" then replacePedAnims(source) -- apply to the element if it's a player or a ped end end ) -- apply animations on script start for k, v in pairs(getElementsByType("player", root, true)) do replacePedAnims(source) -- apply on each streamed in player end for k, v in pairs(getElementsByType("ped", root, true)) do replacePedAnims(source) -- apply on each streamed in ped end -- (untested) However, I'd like to add that because partial animations (i.e. affecting only certain bones, not all) don't work too well (or at least they didn't last time I checked). For example, a running attack only animates the arm -- but the custom replacement will make the player move in near T-pose with only the arm moving, instead of blending the running animation with the arm movement.
  12. If playerZ < getWaterLevel(playerX, playerY, playerZ)
  13. Accounts and their related account data is stored in mods/deathmatch/internal.db, so if you just copy that file over to the new host and start up the server, you should be able to log in to accounts that were created on the old host, as well as all their data. All other internal SQL stuff that comes from executeSQLQuery is stored in mods/deathmatch/databases/global/registry.db so you might want to copy that one over too.
  14. MrTasty

    [HELP]No menu

    Can you clarify what you mean? What do you mean you "found" script, and what do you mean by "no menu" -- what menu are you expecting?
  15. Why do people keep posting topics in other languages when they can see everything else in the section is in English? Ugh. Try here https://forum.mtasa.com/forum/97-portuguese-português/