-
Notifications
You must be signed in to change notification settings - Fork 12
Description
sr.CreateAttachedSound3D(ATTACH_PLAYER, player, "sound_path", 800.0)
Sound attached to the player and when the player enters a vehicle:
soundstreamer_c:175 - Function IsValidPlayer will return false;
soundstreamer_c:188 - SetSound3DLocation (v.sound, x, y, z) with x as nil value;
Sugestion:
if v.attach == ATTACH_VEHICLE then
if IsValidVehicle(v.id) then
x, y, z = GetVehicleLocation(v.id)
end
elseif v.attach == ATTACH_PLAYER then
x, y, z = GetPlayerLocation(v.id)
elseif v.attach == ATTACH_OBJECT then
if IsValidObject(v.id) then
x, y, z = GetObjectLocation(v.id)
end
elseif v.attach == ATTACH_NPC then
if IsValidNPC(v.id) then
x, y, z = GetNPCLocation(v.id)
end
end
if x ~= nil and y ~= nil and z ~= nil then
SetSound3DLocation(v.sound, x, y, z)
end