|
| 1 | +--- |
| 2 | +ns: TASK |
| 3 | +--- |
| 4 | +## TASK_SHARK_CIRCLE_COORD |
| 5 | + |
| 6 | +```c |
| 7 | +// 0x60A19CF85FF4CEFA |
| 8 | +void TASK_SHARK_CIRCLE_COORD(Ped ped, float x, float y, float z, float moveBlendRatio, float radius); |
| 9 | +``` |
| 10 | +
|
| 11 | +Makes a shark ped circle around specified coordinates. |
| 12 | +
|
| 13 | +``` |
| 14 | +NativeDB Introduced: v3407 |
| 15 | +``` |
| 16 | +
|
| 17 | +## Parameters |
| 18 | +* **ped**: The shark ped. |
| 19 | +* **x**: X coordinate to circle around |
| 20 | +* **y**: Y coordinate to circle around |
| 21 | +* **z**: Z coordinate to circle around |
| 22 | +* **moveBlendRatio**: Animation blend ratio from 0.0 to 1.0 |
| 23 | +* **radius**: Radius of the circular path in meters |
| 24 | +
|
| 25 | +## Examples |
| 26 | +```lua |
| 27 | +local function CreateShark(coords) |
| 28 | + RequestModel(sharkModel) |
| 29 | + while not HasModelLoaded(sharkModel) do |
| 30 | + Wait(0) |
| 31 | + end |
| 32 | + |
| 33 | + shark = CreatePed(28, sharkModel, coords.x, coords.y, coords.z, 0.0, true, true) |
| 34 | + SetModelAsNoLongerNeeded(sharkModel) |
| 35 | + return shark |
| 36 | +end |
| 37 | +
|
| 38 | +local function SharkCircle(sharkHandle, coords) |
| 39 | + if (DoesEntityExist(shark)) then |
| 40 | + TaskSharkCircleCoord(sharkHandle, coords.x, coords.y, coords.z - 5.0, 1.0, 10.0) |
| 41 | + Wait(10000) -- We're letting the shark doing circles movement for 10 seconds |
| 42 | + ClearPedTasks(shark) -- Going to shop the task |
| 43 | + end |
| 44 | +end |
| 45 | +
|
| 46 | +local coords = GetEntityCoords(PlayerPedId()) |
| 47 | +local shark = CreateShark(coords) |
| 48 | +SharkCircle(shark, coords) |
| 49 | +``` |
| 50 | + |
0 commit comments