Jump to content

Eu tenho um pequeno problema


Recommended Posts

Eu tenho um pequeno problema, na hora de entrar no veículo depois de pegar o personagem, o veículo começa a voar, eu preciso de ajuda e se eu sou novo nesse Scripting.

Preciso de sua ajuda.

 

 

 

 

function AgarrarSoltar(source, target)
    local ID = getElementData(target , config['serverInfo']['id']) or 0

    local rotpX = 90
    local rotpY = 0
    local rotpZ = getElementRotation(target) 

    local rotvX,rotvY,rotvZ = getElementRotation(source)

    local rotX = rotpX - rotvX
    local rotY = rotpY - rotvY
    local rotZ = rotpZ - rotvZ

    local Agarrado = getElementData(target, "SS:Agarrado") or false
    
    
    if Agarrado == false then
        attachElementToElement(target, source,  0, 0.4 , 0.3 , rotX, rotY, rotZ)
        setElementData(target,"SS:Agarrado",true)
        setPedAnimation(source, "CARRY", "crry_prtial", 0, false, false, false, false)
        setPedAnimation(target, "ped", "CAR_dead_LHS", false, false)
        exports["CzInventory"]:sendNotification(source, "info", "Agarraste "..removeHex(getPlayerName(target)).." ["..(getElementData(target, config['serverInfo']['id']) or 0).."].")
    else 
        detachElementFromElement(target, source,  0, 0.4 , 0.3 , rotX, rotY, rotZ)
        setElementData(target,"SS:Agarrado",false)
        setPedAnimation(target)
        exports["CzInventory"]:sendNotification(source, "info", "Soltaste"..removeHex(getPlayerName(target)).." ["..(getElementData(target, config['serverInfo']['id']) or 0).."].") 
    end 
end
addEvent ( "SS:Agarrar", true )
addEventHandler ( "SS:Agarrar", root, AgarrarSoltar)

Link to comment

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...