Jump to content

Help me please with this code


denny199

Recommended Posts

Posted

Hi there,

I've got last a few questions on my server - NL server they asked to me to make a new police horn like the netherlands and then this:I've got attached the playsound on the vehicle - 3D but now you hear it only who has entered the police car help me code:

Client:

-- client 
function policeEnterr (player) 
 local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) 
politiet = playSound3D("hooh1.mp3", 0, 0, 0, true)  
attachElements ( politiet, vehicle ) 
        setSoundMaxDistance(politiet, 45) 
        setSoundVolume(politiet, 30.0) 
end 
addEvent( "police", true ) 
addEventHandler( "police", getRootElement(), policeEnterr ) 

-=-=-=Server-=-=-=-==-=-=-

-- server 
function policeEnter ( theVehicle, seat, jacked )  
    local id = getElementModel ( theVehicle )  
    if id == 546 or id == 568 or id == 537 then  
        local vehicleName = getVehicleName ( theVehicle )  
    triggerClientEvent ( "police", getRootElement() ) 
    end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), policeEnter ) 

please help!

Sometimes I dream about cheese

Posted

yes bk playSound3D is clients side = only that client (player) hear it

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

bandi, as you can see he's triggering the event to getRootElement().

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.

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