CreateSWATRope: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Removed client section in the example because it is unnecesary)
(Remove obsolete Requirements section)
 
Line 25: Line 25:
addCommandHandler("createrope", SwatRope)
addCommandHandler("createrope", SwatRope)
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|n/a|1.1.1-9.03250|}}


==See Also==
==See Also==
{{client world functions}}
{{client world functions}}

Latest revision as of 15:33, 7 November 2024

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

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)  
    end
end
addCommandHandler("createrope", SwatRope)

See Also