pocko Posted February 4, 2011 Share Posted February 4, 2011 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 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
SDK Posted February 4, 2011 Share Posted February 4, 2011 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
pocko Posted February 4, 2011 Author Share Posted February 4, 2011 and what i must change ex:playSoundFrontEnd with sound ex:sfx/vehicle.wav? Link to comment
pocko Posted February 4, 2011 Author Share Posted February 4, 2011 I want to change Nitro sound And Repair sound Link to comment
SDK Posted February 4, 2011 Share Posted February 4, 2011 You should replace the playSoundFrontEnd For only nitro's and repairs, you could do if pickup.type == 'vehiclechange' then playSoundFrontEnd(46) else playSound("file.wav") Link to comment
pocko Posted February 4, 2011 Author Share Posted February 4, 2011 this PlaySoundFrontEnd (46) 46 is it a ID of this item ? Link to comment
proracer Posted February 4, 2011 Share Posted February 4, 2011 this PlaySoundFrontEnd (46) 46 is it a ID of this item ? Why can't you look at the Wiki for something...? https://wiki.multitheftauto.com/wiki/PlaySoundFrontEnd Link to comment
pocko Posted February 4, 2011 Author Share Posted February 4, 2011 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 Link to comment
SDK Posted February 4, 2011 Share Posted February 4, 2011 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
pocko Posted February 4, 2011 Author Share Posted February 4, 2011 yes now i understand anythink only must know the id's 46 if for repair i saw in wiki but i want repair and nitros to be difrent sounds.maybe only id's must change ?but from where i search there not found it do you know the ids ? Link to comment
proracer Posted February 4, 2011 Share Posted February 4, 2011 "46" is the ID for the sound not the pickup if you mean that. Link to comment
pocko Posted February 5, 2011 Author Share Posted February 5, 2011 ahm well i want to know the id s for sounds.I search https://wiki.multitheftauto.com/wiki/PlaySoundFrontEndBut i can t found the sounds well can you put diffrent sounds on repair and nitro ? 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