HU/setSoundMaxDistance: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 7: Line 7:
{{OOP||[[sound]]:setMaxDistance|maxDistance|getSoundMaxDistance}}
{{OOP||[[sound]]:setMaxDistance|maxDistance|getSoundMaxDistance}}
===Required Arguments===  
===Required Arguments===  
*'''sound:''' a [[sound]] element.
*'''sound:''' egy [[sound|hang]] elem.
*'''distance:''' the default value for this is 20
*'''distance:''' az alapértelmezett érték 20
 
===Returns===
===Returns===
Returns a ''true'' if the max distance was set, ''false'' otherwise.
Returns a ''true'' if the max distance was set, ''false'' otherwise.

Revision as of 19:50, 21 July 2018

Beállítja az egyéni hang maximális távolságát, ahol a hang megáll.

Syntax

bool setSoundMaxDistance ( element sound, int distance )

OOP Syntax Help! I don't understand this!

Method: sound:setMaxDistance(...)
Variable: .maxDistance
Counterpart: getSoundMaxDistance


Required Arguments

  • sound: egy hang elem.
  • distance: az alapértelmezett érték 20

Returns

Returns a true if the max distance was set, false otherwise.

Example

Click to collapse [-]
Client
local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, true)

function maxdistanceFunc(command, param)
  setSoundMaxDistance(sound, tonumber(param))
end
addCommandHandler("setmaxdistance", maxdistanceFunc)

See Also