-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Delete functions.lua * Delete controllers.lua * Delete functions.lua * Update version * Update README.md * Update fxmanifest.lua - updated folder structure * Update config.lua - add blip settings * Update usableItems.lua - add user check - housekeeping * Update main.lua - fixed plant count when client connects - add inventory item checks - fixed if missing water bucket it doesn't play anim or set as watered - housekeeping * Update main.lua - update bucket scenario to smooth out the finish - housekeeping * Update planting.lua - add native prompts - housekeeping * Update planted.lua - add native prompts - fix plant blips not showing - add native plant blips - add native plant object creation - add water bucket item check before running anim and setting plant as watered - moved seed removal to end of planting process - housekeeping
- Loading branch information
Showing
12 changed files
with
478 additions
and
361 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,46 @@ | ||
VORPcore = exports.vorp_core:GetCore() | ||
|
||
RegisterNetEvent('vorp:SelectedCharacter', function() | ||
TriggerServerEvent('bcc-farming:NewClientConnected') | ||
end) | ||
end) | ||
|
||
function ScenarioInPlace(hash, time) | ||
local playerPed = PlayerPedId() | ||
FreezeEntityPosition(playerPed, true) | ||
TaskStartScenarioInPlace(playerPed, joaat(hash), time, true, false, false, false) | ||
Wait(time) | ||
ClearPedTasks(playerPed) | ||
Wait(4000) | ||
HidePedWeapons(playerPed, 2, true) | ||
FreezeEntityPosition(playerPed, false) | ||
end | ||
|
||
function PlayAnim(animDict, animName, time, raking, loopUntilTimeOver) --function to play an animation | ||
local animTime = time | ||
RequestAnimDict(animDict) | ||
while not HasAnimDictLoaded(animDict) do | ||
Wait(10) | ||
end | ||
|
||
local flag = 16 | ||
-- if time is -1 then play the animation in an infinite loop which is not possible with flag 16 but with 1 | ||
-- if time is -1 the caller has to deal with ending the animation by themselve | ||
if loopUntilTimeOver then | ||
flag = 1 | ||
animTime = -1 | ||
end | ||
|
||
local playerPed = PlayerPedId() | ||
TaskPlayAnim(playerPed, animDict, animName, 1.0, 1.0, animTime, flag, 0, true, 0, false, 0, false) | ||
if raking then | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local rakeObj = CreateObject('p_rake02x', playerCoords.x, playerCoords.y, playerCoords.z, true, true, false) | ||
AttachEntityToEntity(rakeObj, playerPed, GetEntityBoneIndexByName(playerPed, 'PH_R_Hand'), 0.0, 0.0, 0.19, | ||
0.0, 0.0, 0.0, false, false, true, false, 0, true, false, false) | ||
Wait(time) | ||
DeleteObject(rakeObj) | ||
else | ||
Wait(time) | ||
end | ||
ClearPedTasks(playerPed) | ||
end |
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
Oops, something went wrong.