SetBirdsEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 13: Line 13:
Returns ''true'' if the birds state was changed succesfully, ''false'' if an invalid argument was specified.
Returns ''true'' if the birds state was changed succesfully, ''false'' if an invalid argument was specified.


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


==Requirements==
==Requirements==

Revision as of 23:11, 28 January 2012

Accessories-text-editor.png Script Example Missing Function SetBirdsEnabled needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.

This function allows you to disable the flying birds.

Syntax

bool setBirdsEnabled ( bool enable )

Required Arguments

  • enabled: A boolean value determining if birds should be shown. Use true to show the birds and false to hide them.

Returns

Returns true if the birds state was changed succesfully, false if an invalid argument was specified.

Example

This example Enables or Disables the Birds.

Click to collapse [-]
Client
function setBirdsState()
	setBirdsEnabled(not getBirdsEnabled()) -- Disable the Birds if they're enabled, either Enable them.
	outputChatBox("The birds are now ".. (getBirdsEnabled() and "Enabled" or "Disabled") ..".") -- Output the new Birds state.
end
addCommandHandler("birds",setBirdsState) -- Add the command handler attached to the function "setBirdsState".

Requirements

This template will be deleted.

See Also