Skip to content

Error Client in GameTick event - soundstreamer_c.lua > 188 #7

@WinTuba

Description

@WinTuba

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions