Jump to content

Win sound!


Reflex#

Recommended Posts

Posted

You need use event onClientPlayerWasted because you need play sound but playSound function is client side.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i got what he mean he want play sound when map finsh

i think he can use onRaceMapStartChangeing then play sound

My ingame nickname : Ops!

-DeathMatch GameMode By Ops! : 5%

Posted
Tell us what gamemode ur using .

I use Race gamemode.

But play only on DM maps.I want when player win round,playing music

Scripting in lua

Posted
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?

Scripting in lua

Posted

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.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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