<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cokacola</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cokacola"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Cokacola"/>
	<updated>2026-05-19T08:27:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=21981</id>
		<title>SetSoundPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=21981"/>
		<updated>2009-11-28T13:03:41Z</updated>

		<summary type="html">&lt;p&gt;Cokacola: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the seek position of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPosition ( element theSound, int pos )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which seek position you want to modify.&lt;br /&gt;
*'''pos:''' An [[int]]eger value representing the new seek position of the sound in milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example allows the player to set how many milliseconds into the song he wants it to play from&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function setSongPos(cmd, ms)&lt;br /&gt;
    local ssp = setSoundPosition(theSound, ms)&lt;br /&gt;
    if(ssp == true) then&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(&amp;quot;Sound is now playing from: &amp;quot;..seconds..&amp;quot; Seconds!&amp;quot;, getLocalPlayer())&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;An error has occured. Please make shore there are atleast&amp;quot;, getLocalPlayer())&lt;br /&gt;
        local seconds = ms / 1000 --this will get the amount of seconds from milliseconds&lt;br /&gt;
        outputChatBox(seconds..&amp;quot; Seconds in this song!&amp;quot;, getLocalPlayer())&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;skipsong&amp;quot;, setSongPos)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Cokacola</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsSoundPaused&amp;diff=21979</id>
		<title>IsSoundPaused</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsSoundPaused&amp;diff=21979"/>
		<updated>2009-11-28T12:41:46Z</updated>

		<summary type="html">&lt;p&gt;Cokacola: Added Example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to return the current pause state of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isSoundPaused ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which pause state you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element is paused, ''false'' if unpaused or invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will check and see if the sound is paused or not, and tell the player.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function checkSongPause()&lt;br /&gt;
    local pause = isSoundPaused(theSound)&lt;br /&gt;
    if(pause == true) then&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is paused!&amp;quot;, getLocalPlayer())&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;The sound is not paused!&amp;quot;, getLocalPlayer())&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;checkpause&amp;quot;, checkSongPause)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Cokacola</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundPaused&amp;diff=21978</id>
		<title>SetSoundPaused</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundPaused&amp;diff=21978"/>
		<updated>2009-11-28T12:37:08Z</updated>

		<summary type="html">&lt;p&gt;Cokacola: Added Example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to either pause or unpause the playback of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPaused ( element theSound, bool paused )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which you want to pause/unpause.&lt;br /&gt;
*'''paused:''' A [[boolean]] value representing whether the sound should be paused or not. To pause the sound, use ''true''.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element was successfully paused, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example will allow the user to toggle sounds from paused to playing, and from playing to paused&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;, true)&lt;br /&gt;
function togglePausedSound()&lt;br /&gt;
    if(isSoundPaused(theSound)) then --sound is paused, un-pause it&lt;br /&gt;
        setSoundPaused(theSound, false)&lt;br /&gt;
    else --sound is not paused, pause it&lt;br /&gt;
        setSoundPaused(theSound, true)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;pausesound&amp;quot;, togglePausedSound)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;/div&gt;</summary>
		<author><name>Cokacola</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnTrailerAttach&amp;diff=21367</id>
		<title>OnTrailerAttach</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnTrailerAttach&amp;diff=21367"/>
		<updated>2009-08-30T02:54:11Z</updated>

		<summary type="html">&lt;p&gt;Cokacola: added example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a trailer is attached to a truck.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
vehicle theTruck&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''theTruck''': The truck vehicle that got attached to this trailer&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the trailer [[vehicle]] that the truck got attached to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Only include this section below if cancelling the event has any effect. If you don't know if it does, ask a dev! --&amp;gt;&lt;br /&gt;
==Cancel effect==&lt;br /&gt;
If this event is [[Event system#Canceling|canceled]], the trailer will detach from the truck again.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This example removes a trailer from the truck it is attached to. Good if you do not want people attaching trailers to vehicles&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function detachTrailer(theTruck)&lt;br /&gt;
    detachTrailerFromVehicle(theTruck, source) --detach the newly attached trailer&lt;br /&gt;
 end&lt;br /&gt;
addEventHandler(&amp;quot;onTrailerDetach&amp;quot;, getRootElement(), detachTrailer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Vehicle events}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Cokacola</name></author>
	</entry>
</feed>