[Release] AnchorBoat V1.3

AnchorBoat

A little anchor script for your boat. Very simple :rp: release :see_no_evil:
Press “.” to use it.

Requirements

Instal
/Like any other resourse

  • Download the latest version from here.
  • Extract into it’s own folder (i.e. resources/AnchorBoat, can be wherever you like) Case sensitive btw.
  • Configure the server.cfg file
  • Start the server
Video

https://youtu.be/QTEgVzwq9yA

Version
  • 1.0 Everything works as intended
  • 1.1 Can’t throw anchor when you are in a submarine or on jetski
  • 1.2 Changed the plan. Now you don’t freeze the entity but using another more relastic native. Big Thanks to @Jager_Bom
  • 1.3 Added animation for when anchoring your boat
To do
  • Can’t throw anchor when more than 10 units away from veh
  • Play an anchor look a like animation

Credits

15 Likes

the button would be nice to know

Oh well. Press U to throw the anchor, and press Y to pull it up again

This could be a use full release…(some might say)


Just a thought, you could try tossing in something like…

GetEntityHeightAboveGround(entity)

Then use something like…

if GetEntityHeightAboveGround(veh) > 10 then
pNotifyThing("You can't anchor mid air.")
end```

Yeah but the problem with that one is. The “aboveground” is the seabottom, which is different from all around the ocean in GTA V. So sadly that does not work

Alright so swap over and use GetEntityHeight, then just try to figure out what the trigger point could be during testing.

Updated to version 1.01

  • Can’t throw anchor when you are in a submarine or on jetski

What do you mean by that?

mate please use correct natives instead of freezing an entity, here is the correct native:

SET_BOAT_ANCHOR #
// 0x75DBEC174AEEAD10 0xA3906284
// SetBoatAnchor
void SET_BOAT_ANCHOR(Vehicle vehicle, BOOL toggle);

and

IS_PED_IN_ANY_BOAT #
// 0x2E0E1C2B4F6CB339 0x1118A947
// IsPedInAnyBoat
BOOL IS_PED_IN_ANY_BOAT(Ped ped);

and

_GET_BOAT_ANCHOR #
// 0x26C10ECBDA5D043B 
// GetBoatAnchor
BOOL _GET_BOAT_ANCHOR(Vehicle vehicle);
1 Like

Are you sure those anchor natives work? They’ve never worked for me whenever i tried to keep a boat from moving…

“Mate” I tried with these natives. If you can improve the script, feel free to do that instead :slight_smile: mate

if you ask it nicely, i can do that here you go :stuck_out_tongue:

local anchored = false
Citizen.CreateThread(function()
	while true do

		Wait(0)
		local ped = GetPlayerPed(-1)
		if IsControlJustPressed(1, 182) and not IsPedInAnyVehicle(ped)  then
			local boat  = GetVehiclePedIsIn(ped, true)
			if not anchored then
				SetBoatAnchor(boat, true)
			else
				SetBoatAnchor(boat, false)
			end
			anchored = not anchored
		end
	end
end)

EDIT: 182 is “L” key

ofc they do :slight_smile: see my code above :hugs:

tha anchor only works if you’re out of the boat / motor not running

1 Like

Just tested it. Does not seem to work at all.

for me it does work, i did put it close to the boat for more then 15 min and did not move an inch lol (well did move but did not get away :stuck_out_tongue:

Try to “park” it out in the open. Then it just fly away. It’s a weak anchor with this native i think. Thats why i choose to freeze the entity instead

you got discord ? i can show you live version :slight_smile:
i did try middle in the sea does stay on its place

here i made little video, here you can see clearly when not anchored boat moves alot, when anchored not anymore, i did put text so you can see when i puch the L button
proof video anchor :slight_smile:

Looks like an awesome resource, I love that you have 2 jobs, i want that in my server so bad