Jump to content

طلب تصصحيحح كووودد


EH10

Recommended Posts

الرجاء تصحيح الكود من الاخطاء الكود هو اذا سياره قريبة منك يجيك صوت او اوبجكت قريد منك يجيك صوت

addEventHandler("onClientRender", root, 
function getElementSpeed(element,unit) 
    if getElementType ( source ) == "vehicle" and isPedInVehicle ( source ) then 
        if isElement ( source ) then destroyElement ( source ) end 
            if ( getVehicleController ( source ) ) then 
                getPedOccupiedVehicle ( localPlayer ) 
                    if (unit == nil) then unit = 0 end 
                        if (isElement(element)) then 
                            local x,y,z = getElementVelocity(element) 
                                if (unit=="mph" or unit==1 or unit =='1') then 
                                    return (x^2 + y^2 + z^2) ^ 0.5 * 100 
                                        else 
                                        return (x^2 + y^2 + z^2) ^ 0.5 * 1.8 * 100 
                                    end 
                                            else 
                            outputDebugString("Not an element. Can't get speed") 
                        xVeh1, yVeh2, zVeh3 = getElementPosition( Vehicles ) 
                    xVeh4, yVeh, zVeh6 = getElementPosition( Vehicle ) 
                getDistanceBetweenPoints3D( xVeh1, yVeh2, zVeh3, xVeh4, yVeh5, zVeh6 ) 
                    Sounds = playSound(".....") 
            return false 
                    end 
                end 
            end 
        end 
    end 
) 
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...