Read very well and follow all the steps below. If you find any error or have any doubt open a ticket.
1. DOWNLOAD
The first step is to download the product we have just purchased. To do this we will go to our KEYMASTER account and search for "Buty-WaterActivities".
2. DEPENDENCIES AND INSTALLATION
To install it add the resource to your scripts folder and put the following in your SERVER.CFG:
This script brings with it two voluntary dependencies, as the dependencies are the vehicles/activities to be rented to the player. Actually you can set the vehicles/activities you want, easily editable in the CONFIG.
The following will explain all the settings, one of the most important things that I recommend you spend a few minutes to understand in order to offer your users the best possible experience.
To make it easier for you to configure, this script comes with several configuration files, each one for one thing. You can see it explained below:
Here you will only have to configure your framework, your database and some extra settings.
Buty = {}Configuration = { [1] = {framework ="esx", ESXtrigger ='es_extended', QBtrigger ='qb-core'}, -- esx or qbcore [2] = {UseFuel = false, UseKeys = false}, --Do you use a different system for Fuel? Activate it and put the export in function.lua
[3] = {BattlePass = false, XP = 100}, --Do you use a BattlePass and want this script to give points? Activate it and add the export in function.lua
}Activities = { {--Sets the coordinate where the NPC will appear with the UI NPC = {x =-1599.2, y =-1179.0, z =1.56, h =263.04},--Here the vehicle will spawn SpawnVehicle =vector3(-1737.08, -1146.64, 0.44),--This is where the vehicle driven by an NPC will go. VehicleGo =vector3(-1625.21, -1182.27, -0.23),--This is where you can eliminate the vehicle before the time is up. DeleteVehicle = {x =-1619.08, y =-1175.36, z =-0.24}, Returned = {x =-1616.75, y =-1187.27, z =-0.04}, ReturnedVehicle =vector3(-1628.04, -1167.28, -0.44), deleteped =vector3(-1620.0, -1088.28, 4.48), --The area where you can use the vehicle. If you leave this area, it will return you to the place you put in the coordinates above.
zone = {x =-1643.68, y =-1212.68, z =1.4}, SizeZone =200.0, },}--------------------------------------------------Buty.NameBlip ='Water Activities'Buty.NPCS = { ['home'] = { model ='s_m_y_baywatch_01', --npc model (https://docs.fivem.net/docs/game-references/ped-models/) anim ='WORLD_HUMAN_CLIPBOARD' --npc animation (https://wiki.rage.mp/index.php?title=Scenarios) }, ['driver'] = { model ='a_m_y_surfer_01', }}Buty.Vehicles = {--If you have all the dependencies correctly installed, leave it as it is. If you have changed any vehicle you will have to put its spawn id here.
[1] = { model ='seashark', -- vehicle price =1000, -- price rent time =1800, -- 30min }, [2] = { model ='seashark3', price =1000, time =1800, }, [3] = { model ='windsurf', price =1000, time =1800, }, [4] = { model ='suntrap', price =1000, time =1800, }}Buty.Translations = { ['language'] ="EN", --You can choose which language the notifications will be in. (EN, ES, FR) ['EN'] = { [1] ="Press ~b~E~w~ for rent", [2] ="Your time is up, the vehicle is being returned automatically.", [3] ="You don't have enough money.", [4] ="~g~[E]~s~ - Park your vehicle", [5] ="You already have a rented vehicle!", [6] ="You cannot use it inside a vehicle.", [7] ="You've wandered too far, we'll take you back to the area.", }, ['ES'] = { [1] ="Pulsa ~b~E~w~ para alquilar", [2] ="Tu tiempo se acabo, se esta devolviendo el vehiculo automaticamente.", [3] ="No tienes suficiente dinero.", [4] ="~g~[E]~s~ - Aparcar vehiculo", [5] ="ÂĄYa tienes un vehiculo alquilado!", [6] ="No puedes usar esto dentro de un vehiculo.", [7] ="Te has alejado demasido, te estamos llevando de nuevo a la zona.", }, ['FR'] = { [1] ="Appuyez sur ~b~E~w~ pour louer", [2] ="Votre temps est ÊcoulÊ, le vÊhicule est rendu automatiquement.", [3] ="Vous n'avez pas assez d'argent.", [4] ="~g~[E]~s~ - Stationnement du vÊhicule", [5] ="Vous avez dÊjà un vÊhicule louÊ!", [6] ="Vous ne pouvez pas utiliser ceci à l'intÊrieur d'un vÊhicule", [7] ="Vous vous ÃĒtes aventurÊ trop loin, nous allons vous ramener dans la zone.", },}
Here are the important functions open. You will be able to set your Key System, Fuel System, Blips...
For example if you don't use LegacyFuel and you use BitFuel, then replace exports["LegacyFuel"]:SetFuel(fuelvehicle, 100) with your BitFuel export.
if Configuration[2].UseKeys ==truethenfunctionkeys(vehicle)TriggerEvent('cd_garage:AddKeys', exports['cd_garage']:GetPlate(vehicle))endendif Configuration[2].UseFuel ==truethenfunctionfuel(vehicle) exports["LegacyFuel"]:SetFuel(vehicle, 100)endendfunctionBlipHome()for i, v inipairs(Activities) do v.blip =AddBlipForCoord(v.NPC.x, v.NPC.y, v.NPC.z)SetBlipSprite(v.blip, 471)SetBlipColour(v.blip, 3)SetBlipScale(v.blip, 0.7)SetBlipAsShortRange(v.blip, true)BeginTextCommandSetBlipName("STRING")AddTextComponentSubstringPlayerName(Buty.NameBlip)EndTextCommandSetBlipName(v.blip)endend-- Client notificationsfunctionSendClientNotification(type,text,time)-- time = 10000-- if type == 'success' then-- exports["Venice-Notification"]:Notify(text, time, "check", options)-- elseif type == 'error' then-- exports["Venice-Notification"]:Notify(text, time, "error", options)-- elseif type == 'info' then-- exports["Venice-Notification"]:Notify(text, time, "info", options)-- endif Configuration[1].framework =='esx' then ESX.ShowNotification(text)elseif Configuration[1].framework =='qbcore' then QBCore.Functions.Notify(text)endend-- Server side notificationsfunctionSendServerNotification(source,type,text,time)-- time = 10000-- if type == 'success' then-- TriggerClientEvent('codem-notification', source, text, time, 'check', options)-- elseif type == 'error' then-- TriggerClientEvent('codem-notification', source, text, time, 'error', options)-- elseif type == 'info' then-- TriggerClientEvent('codem-notification', source, text, time, 'info', options)-- endif Configuration[1].framework =='esx' thenTriggerClientEvent('esx:showNotification', source, text)elseif Configuration[1].framework =='qbcore' thenTriggerClientEvent('QBCore:Notify', source, text)endendfunctionhintToDisplay(text,coords)local dist =Vdist(coords.x,coords.y,coords.z,GetEntityCoords(PlayerPedId(-1)))if dist <1.5thenDrawText3Ds(coords.x,coords.y,coords.z +1.05,text, 0, 0.1, 0.1,255)elseDrawText3Ds(coords.x,coords.y,coords.z +1.05,text, 0, 0.1, 0.1,100)endendfunctionDrawText3Ds(x,y,z,text)SetTextScale(0.35, 0.35)SetTextFont(4)SetTextProportional(1)SetTextColour(255, 255, 255, 215)SetTextEntry("STRING")SetTextCentre(true)AddTextComponentString(text)SetDrawOrigin(x,y,z, 0)DrawText(0.0, 0.0)ClearDrawOrigin()end