Jump to content

لو سمحتم مساعده


Recommended Posts

السلام عليكم كيفكم اخباركم

الهمم

سويت مود بس باقي شي والله مو عارف اسويه

ابي يطلع صوت بعد الاقفال يعني اذا جا

PLAYER يفتح الموتر

يحي

onPlaySound

واسم الصوت مثلا انا اجيبه يكون mp3

  
-- local player 
localPlayer = getLocalPlayer ( ) 
  
-- playSoundNearElement 
addEvent ( "onPlaySoundNearElement", true ) 
function playSoundNearElement ( theElement, sound ) 
--  local sound = 5 
    local maxdist = 15.0 
    -- valid element 
    if ( theElement ) then 
        local x,y,z = getElementPosition ( theElement ) 
        local x2,y2,z2 = getElementPosition ( localPlayer ) 
        local dist = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 )  
        -- distance is less than parameter maxdist 
        if ( dist < maxdist ) then 
            -- play parameter sound  
            playSoundFrontEnd ( 5 ) 
        --  outputChatBox ( "sound should play" ) 
        else 
        --  outputChatBox ( "not in range" ) 
        end 
    else 
        -- outputChatBox ( "invalid element" ) 
    end 
end 
addEventHandler ( "onPlaySoundNearElement", getRootElement(), playSoundNearElement ) 
  

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