Jump to content

Search the Community

Showing results for tags 'getdistancebetweenpoint3d'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. local LojinhaDsujo = math.random(1000, 3500) Caixas = { --LS [1] = {2080.4318847656,2057.5776367188,11.0546875}; [2] = {1106.7760009766,-1365.8386230469,13.973905563354}; } Marker = {} Roubando = { [1] = false; [2] = false; } function CriarMarkers() for i, MarkerTable in pairs(Caixas) do Marker[i] = createMarker(MarkerTable[1], MarkerTable[2], MarkerTable[3] -1, "cylinder", 1.2, 255,0, 0, 0) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), CriarMarkers) function roubarCaixa(source) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then for ii, vv in pairs(Marker) do if (isElementWithinMarker(source, vv)) then inn = ii end end for i, MarkerTable in pairs(Caixas) do if (i == inn) then if Roubando[i] then return triggerClientEvent(source, "serverNotifys2", root, "Essa loja já foi roubada recentemente !", "error") end local xp, yp, zp = getElementPosition(source) local x, y, z = getElementPosition(MarkerTable) local dist = getDistanceBetweenPoints3D(xp, yp, zp, x, y, z) if (dist >= 5) then return end Roubando[i] = true if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Policial")) then triggerClientEvent(source, "serverNotifys2", root, "Uma lojinha está sendo assaltada !", "error") end setPedAnimation(source, "SHOP", "SHP_Gun_Aim", 15000, true, false, false, false) setTimer(function() triggerClientEvent(source, "FB:TempoPainelAtivadoLojinha", getRootElement()) setPedAnimation(source) triggerClientEvent(source, "serverNotifys2", root, "Não vá para longe você esta assaltando uma lojinha", "error") setTimer(function() triggerClientEvent("serverNotifys2", root, "Uma lojinha foi assaltada !", "error") setTimer(function() if (isElement(source)) then local xp, yp, zp = getElementPosition(source) local dist = getDistanceBetweenPoints3D(xp, yp, zp, x, y, z) if (dist <= 25) then givePlayerMoney(source, LojinhaDsujo) end setTimer(function() setTimer(function() Roubando[i] = false end, 600000, 1) end, 600000, 1) end, 1000, 1) end, 180000, 1) end, 15000, 1) end end else triggerClientEvent(source, "serverNotifys2", root, "Você não tem permissão para assaltar essa loja", "error") end end addCommandHandler("assaltar", roubarCaixa)
×
×
  • Create New...