GetBirdsEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Remove obsolete Requirements section)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
{{Client function}}
This function will tell you if the birds are enabled or disabled.  
This function will tell you if the birds are enabled or disabled.  


Line 10: Line 12:


==Example==  
==Example==  
This example Enables or Disables the Birds.
This example outputs the Birds state.
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function setBirdsState()
function areBirdsEnabled()
setBirdsEnabled(not getBirdsEnabled()) -- Disable the Birds if they're enabled, either Enable them.
outputChatBox("The birds are currently ".. (getBirdsEnabled() and "Enabled" or "Disabled") ..".") -- Output the birds state.
outputChatBox("The birds are now ".. (getBirdsEnabled() and "Enabled" or "Disabled") ..".") -- Output the new Birds state.
end
end
addCommandHandler("birds",setBirdsState) -- Add the command handler attached to the function "setBirdsState".
addCommandHandler("birds", areBirdsEnabled) -- Add the command handler attached to the function "areBirdsEnabled".
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
==Requirements==
{{Requirements|1.3|1.3|}}


==See Also==
==See Also==
{{Client_world_functions}}
{{Client_world_functions}}

Latest revision as of 15:41, 7 November 2024

This function will tell you if the birds are enabled or disabled.

Syntax

bool getBirdsEnabled ()

Returns

Returns true if the birds are enabled or false if the birds are disabled.

Example

This example outputs the Birds state.

Click to collapse [-]
Client
function areBirdsEnabled()
	outputChatBox("The birds are currently ".. (getBirdsEnabled() and "Enabled" or "Disabled") ..".") -- Output the birds state.
end
addCommandHandler("birds", areBirdsEnabled) -- Add the command handler attached to the function "areBirdsEnabled".

See Also