HU/setSoundPosition: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function hu}} This function is used to change the seek position of the specified sound element. Use a player element to control a players voice with th...")
 
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function hu}}
{{Client function hu}}
This function is used to change the seek position of the specified [[sound]] element.
Ez a funkció a meghatározott hangelem keresési pozíciójának megváltoztatására használható.
Use a player element to control a players voice with this function.
Használja a játékos elemet, hogy szabályozza a játékosok hangját ezzel a funkcióval..


==Syntax==  
==Szintaxis==  
<syntaxhighlight lang="lua">bool setSoundPosition ( element theSound, float pos )</syntaxhighlight>  
<syntaxhighlight lang="lua">bool setSoundPosition ( element theSound, float pos )</syntaxhighlight>  
{{OOP||[[sound]]:setPlaybackPosition|playbackPosition|getSoundPosition}}
{{OOP||[[sound]]:setPlaybackPosition|playbackPosition|getSoundPosition}}
===Required Arguments===  
===Kötelező argumentumok===  
*'''theSound:''' the [[sound]] element which seek position you want to modify.
*'''theSound:''' the [[sound]] element which seek position you want to modify.
*'''pos:''' an float value representing the new seek position of the sound. Integer part of this value - seconds, fractional part - milliseconds.
*'''pos:''' an float value representing the new seek position of the sound. Integer part of this value - seconds, fractional part - milliseconds.


===Returns===
===Visszaadott érték===
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.


==Example==  
==Példa==  
This example allows the player to set how many milliseconds into the song he wants it to play from
This example allows the player to set how many milliseconds into the song he wants it to play from
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 34: Line 34:
{{ChangelogItem|1.3.2|Added player element for voice control}}
{{ChangelogItem|1.3.2|Added player element for voice control}}


==See Also==
==Lásd még==
{{Client_audio_functions hu}}
{{Client_audio_functions hu}}


[[en:setSoundPosition]]
[[en:setSoundPosition]]
[[ar:setSoundPosition]]
[[ar:setSoundPosition]]
==Fordította==
Surge

Revision as of 10:58, 22 July 2018

Ez a funkció a meghatározott hangelem keresési pozíciójának megváltoztatására használható. Használja a játékos elemet, hogy szabályozza a játékosok hangját ezzel a funkcióval..

Szintaxis

bool setSoundPosition ( element theSound, float pos )

OOP Syntax Help! I don't understand this!

Method: sound:setPlaybackPosition(...)
Variable: .playbackPosition
Counterpart: getSoundPosition


Kötelező argumentumok

  • theSound: the sound element which seek position you want to modify.
  • pos: an float value representing the new seek position of the sound. Integer part of this value - seconds, fractional part - milliseconds.

Visszaadott érték

Returns true if the sound element's seek position was successfully changed, false otherwise.

Példa

This example allows the player to set how many milliseconds into the song he wants it to play from

theSound = playSound("music/song.mp3")
function setSongPos(cmd, tm)
    tm = tonumber(tm)
    local ssp = setSoundPosition(theSound,tm)
    if ssp then
        outputChatBox("Sound is now playing from: "..tostring(tm))
    else
        outputChatBox("An error has occured.")
    end
end
addCommandHandler("skipsong", setSongPos)

Changelog

Version Description
1.3.2 Added player element for voice control

Lásd még

Fordította

Surge