Jump to content

Race mod sounds


pocko

Recommended Posts

I m trying to make somethink maybe someone know how.The problem is when i get pickups "nitro,vehicle change,repair" I want to change the sounds.Here what i tryed but not work :x Look on line 5 what i tryed.

    if pickup.type == 'repair' then 
            fixVehicle(vehicle) 
        elseif pickup.type == 'nitro' then 
            addVehicleUpgrade(vehicle, 1010) 
            local sound = playSound("sfx/nitro.wav") 
        elseif pickup.type == 'vehiclechange' then 
            if getElementModel(vehicle) ~= tonumber(pickup.vehicle) then 
                clientCall(source, 'alignVehicleWithUp') 
                setVehicleID(vehicle, pickup.vehicle) 
                setVehiclePaintjobAndUpgrades(vehicle, pickup.paintjob, pickup.upgrades) 
                clientCall(source, 'vehicleChanging', g_MapOptions.classicchangez, tonumber(pickup.vehicle)) 
            end 
        end) 

and here the meta

<file src="sfx/nitro.wav" /> 

Link to comment

look for this function in race_client.lua (line ~447)

function handleHitPickup(pickup) 
    if pickup.type == 'vehiclechange' then 
        if pickup.vehicle == getElementModel(g_Vehicle) then 
            return 
        end 
        g_PrevVehicleHeight = getElementDistanceFromCentreOfMassToBaseOfModel(g_Vehicle) 
    end 
    triggerServerEvent('onPlayerPickUpRacePickupInternal', g_Me, pickup.id, pickup.respawn) 
    playSoundFrontEnd(46) 
end 

You should replace the playSoundFrontEnd

Link to comment
function handleHitPickup(pickup) 
   if pickup.type == 'vehiclechange' then 
        playSoundFrontEnd(46) 
    else 
        playSound("sfx/repair.wav") 
    if pickup.vehicle == getElementModel(g_Vehicle) then 
            return 
        end 
        g_PrevVehicleHeight = getElementDistanceFromCentreOfMassToBaseOfModel(g_Vehicle) 
    end 
    triggerServerEvent('onPlayerPickUpRacePickupInternal', g_Me, pickup.id, pickup.respawn) 
  
end 

The sound work but the problem is all pickups is this sound :x

Link to comment

You're messing up, don't try modifying code that doesnt have to do with the sounds, only replace the sounds code.

This should work for nitro's and repairs.

function handleHitPickup(pickup) 
    if pickup.type == 'vehiclechange' then 
        if pickup.vehicle == getElementModel(g_Vehicle) then 
            return 
        end 
        g_PrevVehicleHeight = getElementDistanceFromCentreOfMassToBaseOfModel(g_Vehicle) 
    end 
    triggerServerEvent('onPlayerPickUpRacePickupInternal', g_Me, pickup.id, pickup.respawn) 
    -- new sounds 
    if pickup.type == 'vehiclechange' then 
        playSoundFrontEnd(46) 
    else 
        playSound("sfx/repair.wav") 
    end 
end 
  

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