Jump to content

Limite de distância


Recommended Posts

Posted (edited)

Olá, queria saber qual a função para que eu possa colocar meu script em uma função de limites de distâncias. ( Distância do ID. )

 

Script: 

Quote

addCommandHandler("colete",
    function(playerSource,commandName,id)
    if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup ("Sicilia")) then
    if(id) then
        takePlayerMoney(playerSource, 12000)
        local playerID = tonumber(id)
        if(playerID) then
                local targetPlayer, targetPlayerName = getPlayerID(playerID)
                if targetPlayer then
                     setPedArmor ( targetPlayer, 100 ) 
                    else
                   
                    end
                end
            end
    end
    end
)

 

Edited by Pacheco465
Posted

função :

getDistanceBetweenPoints3D () --/ https://wiki.multitheftauto.com/wiki/GetDistanceBetweenPoints3D

exemplo :

local x1,y1,z1 = getElementPosition(source)
local x2,y2,z2 = getElementPosition(elemento)
if ( getDistanceBetweenPoints3D ( x1,y1,z1,x2,y2,z2 ) <= 10 ) then
   print("dentro")
else
   print("fora")
end

 

  • Thanks 1

" Se eu te ajudei, deixe sua avaliação, obrigado ! "

Joinha!

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...