<?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=Teteomar</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=Teteomar"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Teteomar"/>
	<updated>2026-05-23T03:25:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41029</id>
		<title>GetPlayerFromSerial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41029"/>
		<updated>2014-07-25T06:27:59Z</updated>

		<summary type="html">&lt;p&gt;Teteomar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets an '''online''' player from their [[serial]].&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player getPlayerFromSerial ( string serial )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''serial''': A string determining the serial of player you want to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[player]] element if the specified [[serial]] is owned by an existent player on the server, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerFromSerial ( serial )&lt;br /&gt;
    assert ( type ( serial ) == &amp;quot;string&amp;quot; and #serial == 32, &amp;quot;getPlayerFromSerial - invalid serial&amp;quot; )&lt;br /&gt;
    for index, player in ipairs ( getElementsByType ( &amp;quot;player&amp;quot; ) ) do&lt;br /&gt;
        if ( getPlayerSerial ( player ) == serial ) then&lt;br /&gt;
            return player&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets a player name from random serial and outputs it in chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox( getPlayerName ( getPlayerFromSerial( &amp;quot;AE9EP68QXKHW55LQIAL9C77Q9VJHA00M&amp;quot; ) ) )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
Hint: This function can be useful for building up a serial-based system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Teteomar</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41028</id>
		<title>GetPlayerFromSerial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41028"/>
		<updated>2014-07-25T06:27:17Z</updated>

		<summary type="html">&lt;p&gt;Teteomar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets an '''online''' player from their [[serial]].&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player getPlayerFromSerial ( string serial )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''serial''': A string determining the serial of player you want to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[player]] element if the specified [[serial]] is owned by an existent player on the server, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerFromSerial( serial )&lt;br /&gt;
    assert ( type ( serial ) == &amp;quot;string&amp;quot; and #serial == 32, &amp;quot;getPlayerFromSerial - invalid serial&amp;quot; )&lt;br /&gt;
    for index, player in ipairs ( getElementsByType ( &amp;quot;player&amp;quot; ) ) do&lt;br /&gt;
        if ( getPlayerSerial ( player ) == serial ) then&lt;br /&gt;
            return player&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets a player name from random serial and outputs it in chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox( getPlayerName ( getPlayerFromSerial( &amp;quot;AE9EP68QXKHW55LQIAL9C77Q9VJHA00M&amp;quot; ) ) )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
Hint: This function can be useful for building up a serial-based system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Teteomar</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41027</id>
		<title>GetPlayerFromSerial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41027"/>
		<updated>2014-07-25T06:18:48Z</updated>

		<summary type="html">&lt;p&gt;Teteomar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets an '''online''' player from their [[serial]].&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player getPlayerFromSerial ( string serial )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''serial''': A string determining the serial of player you want to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[player]] element if the specified [[serial]] is owned by an existent player on the server, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerFromSerial( serial )&lt;br /&gt;
    assert ( type ( serial ) == &amp;quot;string&amp;quot; and #serial == 32, &amp;quot;getPlayerFromSerial - invalid serial&amp;quot; )&lt;br /&gt;
    for index, player in ipairs ( getElementsByType ( &amp;quot;player&amp;quot; ) ) do&lt;br /&gt;
        if ( getPlayerSerial ( player ) == serial ) then&lt;br /&gt;
            return player&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets a player name from random serial and outputs it in chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox( getPlayerName ( getPlayerFromSerial( &amp;quot;AE9EP68QXKHW55LQIAL9C77Q9VJHA00M ) ) )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Teteomar</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41026</id>
		<title>GetPlayerFromSerial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41026"/>
		<updated>2014-07-25T06:15:09Z</updated>

		<summary type="html">&lt;p&gt;Teteomar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets an '''online''' player from their serial.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player getPlayerFromSerial ( string serial )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''serial''': A string determining the serial of player you want to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[player]] element if the specified serial is owned by an existent player on the server, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerFromSerial( serial )&lt;br /&gt;
    assert ( type ( serial ) == &amp;quot;string&amp;quot; and #serial == 32, &amp;quot;getPlayerFromSerial - invalid serial&amp;quot; )&lt;br /&gt;
    for index, player in ipairs ( getElementsByType ( &amp;quot;player&amp;quot; ) ) do&lt;br /&gt;
        if ( getPlayerSerial ( player ) == serial ) then&lt;br /&gt;
            return player&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets a player name from random serial and outputs it in chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox( getPlayerName ( getPlayerFromSerial( &amp;quot;AE9EP68QXKHW55LQIAL9C77Q9VJHA00M ) ) )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Teteomar</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41025</id>
		<title>GetPlayerFromSerial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41025"/>
		<updated>2014-07-25T06:14:12Z</updated>

		<summary type="html">&lt;p&gt;Teteomar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets an '''online''' player from their serial.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player getPlayerFromSerial ( string serial )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''serial''': A string determining the serial of player you want to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[player]] element if the specified serial is owned by an existent player on the server, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerFromSerial( serial )&lt;br /&gt;
    assert ( assert ( type ( serial ) == &amp;quot;string&amp;quot; and #serial == 32, &amp;quot;getPlayerFromSerial - invalid serial&amp;quot; )&lt;br /&gt;
    for index, player in ipairs ( getElementsByType ( &amp;quot;player&amp;quot; ) ) do&lt;br /&gt;
        if ( getPlayerSerial ( player ) == serial ) then&lt;br /&gt;
            return player&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets a player name from random serial and outputs it in chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox( getPlayerName ( getPlayerFromSerial( &amp;quot;AE9EP68QXKHW55LQIAL9C77Q9VJHA00M ) ) )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Teteomar</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41024</id>
		<title>GetPlayerFromSerial</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerFromSerial&amp;diff=41024"/>
		<updated>2014-07-25T06:05:01Z</updated>

		<summary type="html">&lt;p&gt;Teteomar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function gets an '''online''' player from their serial.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;player getPlayerFromSerial ( string serial )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''serial''': A string determining the serial of player you want to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[player]] element if the player who has the serial and this player must be online, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Function source&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getPlayerFromSerial( serial )&lt;br /&gt;
    assert ( type ( serial ) == &amp;quot;string&amp;quot;, &amp;quot;getPlayerFromSerial - serial is not a string&amp;quot; )&lt;br /&gt;
    assert ( #serial == 32, &amp;quot;getPlayerFromSerial - invalid serial&amp;quot; )&lt;br /&gt;
    for index, player in ipairs ( getElementsByType ( &amp;quot;player&amp;quot; ) ) do&lt;br /&gt;
        if ( getPlayerSerial ( player ) == serial ) then&lt;br /&gt;
            return player&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example gets a player name from random serial and outputs it in chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox(getPlayerName(getPlayerFromSerial(&amp;quot;05DWR04DQEFGBGN81DDMS12RF4S5QN&amp;quot;)))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tete&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Teteomar</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsWorldSoundEnabled&amp;diff=40366</id>
		<title>IsWorldSoundEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsWorldSoundEnabled&amp;diff=40366"/>
		<updated>2014-06-27T11:41:58Z</updated>

		<summary type="html">&lt;p&gt;Teteomar: Added an example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{New items|3.0140|1.3.1|&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows you to check if certain world sound effects have not been disabled by [[setWorldSoundEnabled]]&lt;br /&gt;
}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isWorldSoundEnabled( int group, [ int index = -1 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''group :''' An integer representing the world sound group&lt;br /&gt;
&lt;br /&gt;
===OptionalArguments=== &lt;br /&gt;
*'''index :''' An integer representing an individual sound within the group&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the world sounds are enabled, ''false'' if they are disabled or invalid values were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This is a simplified example that lets the client toggle their weapon sounds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function toggleWeaponSounds_f ( )&lt;br /&gt;
    local enabled = isWorldSoundEnabled ( 5 ) -- We place this variable here for checking.&lt;br /&gt;
    enabled       = not enabled -- And here we invert (toggle) the variable, so if it's false, it becomes true, if it's true, it becomes false.&lt;br /&gt;
    -- Used for the chat declaration:&lt;br /&gt;
    local state   = &amp;quot;enabled&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if ( not enabled ) then&lt;br /&gt;
        state = &amp;quot;disabled&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    --&lt;br /&gt;
&lt;br /&gt;
    setWorldSoundEnabled ( 5, enabled ) -- And here the toggling happens.&lt;br /&gt;
    outputChatBox ( &amp;quot;Weapon sounds &amp;quot; .. state )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;toggleweaponsounds&amp;quot;, toggleWeaponSounds_f )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04134|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Teteomar</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWorldSoundEnabled&amp;diff=40365</id>
		<title>SetWorldSoundEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWorldSoundEnabled&amp;diff=40365"/>
		<updated>2014-06-27T11:33:05Z</updated>

		<summary type="html">&lt;p&gt;Teteomar: Added a more accurate example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New items|3.0131|1.3.1|&lt;br /&gt;
This function allows you to disable world sounds. A world sound is a sound effect which has '''''not''''' been caused by [[playSound]] or [[playSound3D]].&lt;br /&gt;
&lt;br /&gt;
Note: The values for ''group'' and ''index'' can be determined by using the client command [[Client_Commands#showsound|showsound]] in conjunction with [[setDevelopmentMode]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note box|See Also: [[setAmbientSoundEnabled]]}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setWorldSoundEnabled( int group, [ int index = -1, ] bool enable )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''group :''' An integer representing the world sound group&lt;br /&gt;
*'''enable :''' Set ''false'' to disable, ''true'' to enable&lt;br /&gt;
&lt;br /&gt;
===OptionalArguments=== &lt;br /&gt;
*'''index :''' An integer representing an individual sound within the group&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the world sound was correctly enabled/disabled, ''false'' if invalid values were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This is a simplified example that lets the client toggle their weapon sounds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function toggleWeaponSounds_f ( )&lt;br /&gt;
    local enabled = isWorldSoundEnabled ( 5 ) -- We place this variable here for checking.&lt;br /&gt;
    enabled       = not enabled -- And here we invert (toggle) the variable, so if it's false, it becomes true, if it's true, it becomes false.&lt;br /&gt;
    -- Used for the chat declaration:&lt;br /&gt;
    local state   = &amp;quot;enabled&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if ( not enabled ) then&lt;br /&gt;
        state = &amp;quot;disabled&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    --&lt;br /&gt;
&lt;br /&gt;
    setWorldSoundEnabled ( 5, enabled ) -- And here the toggling happens.&lt;br /&gt;
    outputChatBox ( &amp;quot;Weapon sounds &amp;quot; .. state )&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;toggleweaponsounds&amp;quot;, toggleWeaponSounds_f )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04134|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Teteomar</name></author>
	</entry>
</feed>