DetonateSatchels: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by 6 users not shown)
Line 2: Line 2:
__NOTOC__
__NOTOC__
This function can be used to detonate a players satchels.
This function can be used to detonate a players satchels.
This function is available from version 1.1 onwards.
==Syntax==
==Syntax==
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool detonateSatchels ( )
bool detonateSatchels()
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
Line 14: Line 11:
<section name="Server" class="server" show="true">
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool detonateSatchels ( element Player )
bool detonateSatchels(player Player)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>


==Returns==
==Returns==
Returns true if successful, false otherwise.
Returns ''true'' if successful, ''false'' otherwise.


==Example==
==Example==
The below example allows a player to detonate any of their placed satchels via the command /blowsatchels
The below example allows a player to detonate any of their placed satchels via the command /blowsatchels (Client-side)
<section name="Client" class="client" show="true">
<section name="Client-side" class="client" show="true">
<syntaxhighlight lang="lua">
addCommandHandler("blowsatchels",
    function()
        detonateSatchels()
    end
)
</syntaxhighlight>
</section>
 
The below example allows a player to detonate any of their placed satchels via the command /blowsatchels (Server-side)
<section name="Server-side" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function blowMySatchels()
addCommandHandler("blowsatchels",
    detonateSatchels()
    function(sourcePlayer, commandName)
     outputChatBox("Satchels blown!", 0, 255, 0)
        detonateSatchels(sourcePlayer)
end
     end
addCommandHandler("blowsatchels", blowMySatchels)
)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
Line 35: Line 43:
==See also==
==See also==
{{Client projectile functions}}
{{Client projectile functions}}
[[it:detonateSatchels]]
[[pl:detonateSatchels]]

Latest revision as of 21:02, 18 November 2022

This function can be used to detonate a players satchels.

Syntax

Click to collapse [-]
Client
bool detonateSatchels()
Click to collapse [-]
Server
bool detonateSatchels(player Player)

Returns

Returns true if successful, false otherwise.

Example

The below example allows a player to detonate any of their placed satchels via the command /blowsatchels (Client-side)

Click to collapse [-]
Client-side
addCommandHandler("blowsatchels",
    function()
        detonateSatchels()
    end
)

The below example allows a player to detonate any of their placed satchels via the command /blowsatchels (Server-side)

Click to collapse [-]
Server-side
addCommandHandler("blowsatchels",
    function(sourcePlayer, commandName)
        detonateSatchels(sourcePlayer)
    end
)

See also