IIYAMA

Members
  • Content count

    3,979
  • Joined

  • Last visited

  • Days Won

    20

IIYAMA last won the day on January 29

IIYAMA had the most liked content!

Community Reputation

317 Superstar

About IIYAMA

Details

  • Gang
    [HB]
  • Location
    Netherlands

Recent Profile Visitors

3,328 profile views
  1. local getDistanceBetweenPointAndSegment3D = function (pointX, pointY, pointZ, x1, y1, z1, x2, y2, z2) local A = pointX - x1 local B = pointY - y1 local C = pointZ - z1 -- local D = x2 - x1 local E = y2 - y1 local F = z2 - z1 -- local point = A * D + B * E + C * F local lenSquare = D * D + E * E + F * F local parameter = point / lenSquare local shortestX local shortestY local shortestZ if parameter < 0 then shortestX = x1 shortestY = y1 shortestZ = z1 elseif parameter > 1 then shortestX = x2 shortestY = y2 shortestZ = z2 else shortestX = x1 + parameter * D shortestY = y1 + parameter * E shortestZ = z1 + parameter * F end local distance = getDistanceBetweenPoints3D(pointX, pointY,pointZ, shortestX, shortestY,shortestZ) -- return distance end 3D version of this one: https://wiki.multitheftauto.com/wiki/GetDistanceBetweenPointAndSegment2D Useful for detecting if something is between 2 points.
  2. [Help]Kill zombies within certain distance of you

    local peds = getElementsByType("ped", root, true) for i=1, #peds do local ped = peds[i] end getDistanceBetweenPoints3D() local x, y, z = getElementPosition(ped) local x2, y2, z2 = getElementPosition(localPlayer) killPed(ped) etc. https://wiki.multitheftauto.com/wiki/Scripting_Introduction
  3. On the brick of annihilation: bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] ) Put it to FALSE setElementData ( theElement, key, value, false )
  4. [Help] Give Item on Spawn

    function GiveItemOnSpawn () setElementData(source, "M4A1 CCO", 1) outputChatBox("Test!", source, 255, 255, 255, true) end addEvent ("LEVEL1",true) addEventHandler ("LEVEL1",getRootElement(),GiveItemOnSpawn ) addEventHandler("onPlayerSpawn",getRootElement(), GiveItemOnSpawn) https://wiki.multitheftauto.com/wiki/OnPlayerSpawn Source The source of this event is the player that just spawned. https://wiki.multitheftauto.com/wiki/AddEventHandler addEventHandler This function will add an event handler. An event handler is a function that will be called when the event it's attached to is triggered. See event system for more information on how the event system works. Event handlers are functions that are called when a particular event happens. Each event specifies a specific set of variables that are passed to the event handler and can be read by your function. The following global variables are available for use in handler functions: source: the element that triggered the event
  5. Isn't your network getting :Oed up? You might want to do: /shownetstat while running this with multiple players. Which is also possible for causing the frame/cpu lagg.
  6. If not A-sync, then: function testFunction () return math.random(1000) % 2 == 0 end function start () for i=1, 1000 do local value = testFunction() if value then print(value) else break end end end start() If A-sync, use: https://www.lua.org/pil/9.1.html
  7. [Help] Decrypt

    No other encrypted format is supported to be decrypt by then server except for luac. Which means that if a custom de-crypter isn't included (but still working) then it is compiled AND encrypt with luac. https://luac.mtasa.com/ Uploading/downloading = compiled Extra obfuscation = encryption
  8. stop driveby

    toggleControl(player, "vehicle_fire",false) * as it is server-side.
  9. stop driveby

    Use this event instead: https://wiki.multitheftauto.com/wiki/OnVehicleEnter Also: (not sure what this was about) toggleControl ( "vehicle_fire", false ) (true, "blockedvehicle")
  10. [Help]Moving camera

    Debug your code manually. Easiest way for us to help you and to help yourself. I assume you have already seen this topic, but fortunately it is exactly what you need to do in this situation. Locate bugs... and annihilate them.
  11. stop driveby

    Only ADD, with the code you already used. This code will replace the original setPedDoingGangDriveby function clientside and use it serverside instead. It will fix your de-synchronization. Remember, you still need to use setPedDoingGangDriveby in your original code. clientside function setPedDoingGangDriveby (ped, state ) triggerServerEvent("setPedDoingGangDriveby", resourceRoot, ped, state ) end serverside addEvent("setPedDoingGangDriveby", true) addEventHandler("setPedDoingGangDriveby", resourceRoot, function (ped, state ) if isElement(ped) then setPedDoingGangDriveby(ped, state ) end end, false)
  12. compare car colors

    I do not agree with that. Colour 1: 255, 100, 50 Colour 2: 255, 70, 50 <-
  13. Restarting Script every 24h(HELP)

    Don't forget to give the resource admin rights.