Reflex# Posted March 24, 2012 Share Posted March 24, 2012 On wiki i found only onPlayerWasted I want to do when player win round,play sound Link to comment
Kenix Posted March 24, 2012 Share Posted March 24, 2012 You need use event onClientPlayerWasted because you need play sound but playSound function is client side. Link to comment
X-SHADOW Posted March 24, 2012 Share Posted March 24, 2012 Kenix he want play sound when round is end not when player die Link to comment
Castillo Posted March 24, 2012 Share Posted March 24, 2012 What game mode are you using? race? if so: you can use 'onPlayerFinish' when a player finishes a race, but not when finish a DM map. Link to comment
X-SHADOW Posted March 24, 2012 Share Posted March 24, 2012 i got what he mean he want play sound when map finsh i think he can use onRaceMapStartChangeing then play sound Link to comment
GanJaRuleZ Posted March 24, 2012 Share Posted March 24, 2012 Tell us what gamemode ur using . Link to comment
Reflex# Posted March 25, 2012 Author Share Posted March 25, 2012 Tell us what gamemode ur using . I use Race gamemode. But play only on DM maps.I want when player win round,playing music Link to comment
GanJaRuleZ Posted March 25, 2012 Share Posted March 25, 2012 Use : onClientPlayerWasted playSound In case you want to use for all players instead of "playSound" use playSound3D Link to comment
Reflex# Posted March 25, 2012 Author Share Posted March 25, 2012 Use : onClientPlayerWasted playSound In case you want to use for all players instead of "playSound" use playSound3D Ok..so i must use only playSound3D or with playSound? Link to comment
GanJaRuleZ Posted March 25, 2012 Share Posted March 25, 2012 playSound - When you want that the sound will play just to the players who died playSound3D - Play the sound in a 3D Radius. Link to comment
myyusuf Posted March 25, 2012 Share Posted March 25, 2012 (edited) fail Edited March 25, 2012 by Guest Link to comment
drk Posted March 25, 2012 Share Posted March 25, 2012 Server-side: addEventHandler ( 'onPlayerWasted', root, function ( ammo, killer, weapon ) if ( killer and killer ~= source ) then if ( #getAlivePlayers() == 1 ) then triggerClientEvent ( 'play', source ) end end end ) Client-side: addEvent ( 'play', true ) addEventHandler ( 'play', root, function ( ) playSound ( 'sounds/win.mp3', false ) end ) Not tested. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now