CreateSWATRope: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (needs example)
Line 12: Line 12:
*'''fx, fy, fz:''' the world coordinates where the effect originates.
*'''fx, fy, fz:''' the world coordinates where the effect originates.
*'''duration:''' the amount in miliseconds the rope will be there before falling to the ground.
*'''duration:''' the amount in miliseconds the rope will be there before falling to the ground.
<!--
 
==Example==
==Example==
No example here yet.
This example creates a Swat rope in police maverick when you use the command /createrope
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">


<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function SwatRope()
    local myVehicle = getPedOccupiedVehicle(localPlayer)
    if myVehicle and getVehicleName(myVehicle) == "Police Maverick" then
        local x,y,z = getElementPosition(myVehicle)
        createSWATRope(x, y, z, 11111)
    else
        outputChatBox("Enter Police Maverick!", 255, 0, 0)
    end
end
addCommandHandler("createrope", SwatRope)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
-->


==Requirements==
==Requirements==

Revision as of 11:33, 13 April 2015

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

Before submitting check out Editing Guidelines Script Examples.

Creates a SWAT rope like that of the rope in single player used by SWAT Teams abseiling from the Police Maverick.

Syntax

bool createSWATRope ( float fx, float fy, float fZ, int duration )

Required Arguments

  • fx, fy, fz: the world coordinates where the effect originates.
  • duration: the amount in miliseconds the rope will be there before falling to the ground.

Example

This example creates a Swat rope in police maverick when you use the command /createrope

Click to collapse [-]
Client
function SwatRope()
    local myVehicle = getPedOccupiedVehicle(localPlayer)
    if myVehicle and getVehicleName(myVehicle) == "Police Maverick" then
        local x,y,z = getElementPosition(myVehicle)
        createSWATRope(x, y, z, 11111)
    else
        outputChatBox("Enter Police Maverick!", 255, 0, 0)
    end
end
addCommandHandler("createrope", SwatRope)

Requirements

This template will be deleted.

See Also