AnchorBoat
A little anchor script for your boat. Very simple release
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)
hallux
June 12, 2018, 8:55pm
5
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
hallux
June 12, 2018, 9:12pm
7
Alright so swap over and use GetEntityHeight, then just try to figure out what the trigger point could be during testing.
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
Jager_Bom:
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);
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 mate
if you ask it nicely, i can do that here you go
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 see my code above
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
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
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
Looks like an awesome resource, I love that you have 2 jobs, i want that in my server so bad