-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Terms of Use | ||
|
||
(Below the term "product" is used to describe the script / modification) | ||
|
||
This product is freeware and is not to be exploited for personal, financial or commercial gain. This product is provided without any form of warranty. | ||
Therefore, responsibility for any damages caused by this product or its misuse rest solely with the user, as the author(s) will accept no liability. | ||
|
||
- This copy of terms must remain in its original state and must not be modified in anyway | ||
|
||
- These terms must be alongside the product at all times | ||
|
||
- Do not re-release with out permission (just ask for permission) | ||
|
||
- Do not redistribute to any other sites. This script is only to be published on verified sites by FAXES | ||
|
||
- Editing / abusing these terms will result in action | ||
|
||
### Summery | ||
So basically you can edit anything with the product (except the terms), but you can not release the product nor release the edited version without written permission from FAXES. | ||
|
||
Terms are also available at | ||
[www.faxes.zone/scripts/terms](http://faxes.zone/scripts/terms) | ||
|
||
|
||
![alt text](http://faxes.zone/TOSlogos/FAXES%20ToUSML.png "FAXES ToU Icon") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
----------------------------------- | ||
--- Boat Trailer, Made by FAXES --- | ||
----------------------------------- | ||
|
||
client_script "client.lua" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
----------------------------------- | ||
--- Boat Trailer, Made by FAXES --- | ||
----------------------------------- | ||
|
||
--- Config --- | ||
|
||
attachKey = 51 -- Index number for attach key - http://docs.fivem.net/game-references/controls/ | ||
attachKeyName = "~INPUT_CONTEXT~" -- Key name (center column) of above key. | ||
|
||
--- Code --- | ||
|
||
function GetVehicleInDirection(cFrom, cTo) | ||
local rayHandle = CastRayPointToPoint(cFrom.x, cFrom.y, cFrom.z, cTo.x, cTo.y, cTo.z, 10, GetPlayerPed(-1), 0) | ||
local _, _, _, _, vehicle = GetRaycastResult(rayHandle) | ||
return vehicle | ||
end | ||
|
||
Citizen.CreateThread(function() | ||
while true do | ||
Citizen.Wait(0) | ||
local ped = GetPlayerPed(-1) -- Made the whole thing forgot to add this line lol, maybe thats why it broke #4:32AMLife | ||
local veh = GetVehiclePedIsIn(ped) | ||
if veh ~= nil then | ||
if GetDisplayNameFromVehicleModel(GetEntityModel(veh)) == "DINGHY" then -- After a few hours here at 4am GetDisplayNameFromVehicleModel() got it working well :P | ||
local belowFaxMachine = GetOffsetFromEntityInWorldCoords(veh, 1.0, 0.0, -1.0) | ||
local boatCoordsInWorldLol = GetEntityCoords(veh) | ||
local trailerLoc = GetVehicleInDirection(boatCoordsInWorldLol, belowFaxMachine) | ||
|
||
if GetDisplayNameFromVehicleModel(GetEntityModel(trailerLoc)) == "BOATTRAILER" then -- Is there a trailer???? | ||
if IsEntityAttached(veh) then -- Is boat already attached? | ||
if IsControlJustReleased(1, attachKey) then -- detach | ||
DetachEntity(veh, false, true) | ||
end | ||
-- Start Prompt | ||
Citizen.InvokeNative(0x8509B634FBE7DA11, "STRING") -- BeginTextCommandDisplayHelp() | ||
Citizen.InvokeNative(0x5F68520888E69014, "Press " .. attachKeyName .. " to detach boat.") -- AddTextComponentScaleform() | ||
Citizen.InvokeNative(0x238FFE5C7B0498A6, 0, false, true, -1) -- EndTextCommandDisplayHelp() | ||
else | ||
if IsControlJustReleased(1, attachKey) then -- Attach | ||
AttachEntityToEntity(veh, trailerLoc, 20, 0.0, -1.0, 0.25, 0.0, 0.0, 0.0, false, false, true, false, 20, true) | ||
TaskLeaveVehicle(ped, veh, 64) | ||
end | ||
-- Start Prompt | ||
Citizen.InvokeNative(0x8509B634FBE7DA11, "STRING") -- BeginTextCommandDisplayHelp() | ||
Citizen.InvokeNative(0x5F68520888E69014, "Press " .. attachKeyName .. " to attach boat.") -- AddTextComponentScaleform() | ||
Citizen.InvokeNative(0x238FFE5C7B0498A6, 0, false, true, -1) -- EndTextCommandDisplayHelp() | ||
-- Made by Faxes with some help of the bois | ||
end | ||
end | ||
end | ||
end | ||
end | ||
-- Just a comment here. Why the fuck not? Its 6 am now | ||
end) | ||
-- All done, only lots of bullshit with code lol. Timestamp, its not 6:15AM. Why we still here? Just to suffer? |