Jump to content

hitmarker playsound


BorderLine

Recommended Posts

Posted

Hi community

i have a question

well im trying to make a script, and is like this

serverside

  
  
marker1 = createMarker (815.5,-1107.5,24.7,"cylinder",1.1,255,255,225,255) 
  
function m1( ) 
  playSound ( "soundshop/hi.mp3", false ) 
end 
addEventHandler( "onMarkerHit", marker1, m1) 

when im hit the marker, play the sound. but dont work :/

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

thx a loot

now work with this code

clientside-

  
marker2 = createMarker (2797.5,-1465.6,19.218,"cylinder",1.1,255,255,225,255) 
  
  
function m2 (hitplayer)  
    local sound = playSound("soundshop/hi.mp3")  
end 
  
addEventHandler("onClientMarkerHit", marker2, m2) 
  
  

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

but how i can make only sound for player..

when i hit marker.. all players in server can hear sound

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

you need to check if the element that hit the marker is the local player:

marker2 = createMarker(2797.5, -1465.6, 19.218, "cylinder", 1.1, 255, 255, 225, 255) 
   
function m2(hitplayer) 
    if hitplayer == localPlayer then 
        playSound("soundshop/hi.mp3") 
    end 
end 
  
addEventHandler("onClientMarkerHit", marker2, m2) 

?

Posted

thx a lot again.. work perfect :D

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

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