IsTransferBoxVisible: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 14: Line 14:


==Examples==
==Examples==
{{Needs Example}}
<section name="Client" class="client" show="true">
This example defines a command to remove the player's transfer box.
<syntaxhighlight lang="lua">
function isVisible()
    if isTransferBoxVisible() then
        setTransferBoxVisible(false)
        outputChatBox("* "..getPlayerName(localPlayer).." you are downloading the server!", 255, 255, 255, true)
    else
        outputChatBox("* "..getPlayerName(localPlayer).." you are not downloading the server!", 255, 255, 255, true)       
    end
end
addCommandHandler("download2", isVisible)
</syntaxhighlight>
</section>


==Requirements==
==Requirements==

Revision as of 19:33, 1 July 2021

Determines if the transfer box should be visible.

Syntax

bool isTransferBoxVisible()

Returns

On server this returns a boolean, whether the transfer box should be visible during downloads or not.

On client this returns a boolean, whether the transfer box should be visible or not at the time of invocation.

Examples

Click to collapse [-]
Client

This example defines a command to remove the player's transfer box.

function isVisible()
    if isTransferBoxVisible() then 
        setTransferBoxVisible(false)
        outputChatBox("* "..getPlayerName(localPlayer).." you are downloading the server!", 255, 255, 255, true)
    else 
        outputChatBox("* "..getPlayerName(localPlayer).." you are not downloading the server!", 255, 255, 255, true)        
    end
end
addCommandHandler("download2", isVisible)

Requirements

Minimum server version 1.5.8-9.20788
Minimum client version 1.5.8-9.20788

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.5.8-9.20788" client="1.5.8-9.20788" />

See Also