Minor changes

This commit is contained in:
ElPumpo
2018-07-29 15:07:38 +02:00
parent 60222d0a3c
commit c4d4a46ce0
8 changed files with 42 additions and 53 deletions
+21 -27
View File
@@ -14,18 +14,16 @@ TriggerEvent('instance:registerType', 'garage')
RegisterNetEvent('instance:onCreate')
AddEventHandler('instance:onCreate', function(instance)
if instance.type == 'garage' then
TriggerEvent('instance:enter', instance)
end
end)
AddEventHandler('esx_property:hasEnteredMarker', function(name, part, parking)
if part == 'ExteriorEntryPoint' then
local playerPed = GetPlayerPed(-1)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
local garage = Config.Garages[name]
@@ -37,7 +35,7 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part, parking)
local healthPercent = (health / maxHealth) * 100
if healthPercent < Config.MinimumHealthPercent then
ESX.ShowNotification('Vous devez d\'abord réparer votre véhicule')
ESX.ShowNotification(_U('veh_health'))
else
if GetPedInVehicleSeat(vehicle, -1) == playerPed then
@@ -199,7 +197,7 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part, parking)
if part == 'InteriorExitPoint' then
local playerPed = GetPlayerPed(-1)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
local garage = Config.Garages[name]
@@ -221,7 +219,7 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part, parking)
TriggerEvent('instance:close')
ESX.Game.SpawnVehicle(vehicleProps.model, spawnCoords, garage.ExteriorSpawnPoint.Heading, function(vehicle)
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
end)
@@ -230,11 +228,7 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part, parking)
else
ESX.Game.Teleport(playerPed, {
x = garage.ExteriorSpawnPoint.Pos.x,
y = garage.ExteriorSpawnPoint.Pos.y,
z = garage.ExteriorSpawnPoint.Pos.z
}, function()
ESX.Game.Teleport(playerPed,garage.ExteriorSpawnPoint.Pos.x, function()
TriggerEvent('instance:close')
end)
@@ -254,13 +248,13 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part, parking)
if part == 'Parking' then
local playerPed = GetPlayerPed(-1)
local playerPed = PlayerPedId()
local garage = Config.Garages[name]
local parkingPos = garage.Parkings[parking].Pos
if IsPedInAnyVehicle(playerPed, false) and not IsAnyVehicleNearPoint(parkingPos.x, parkingPos.y, parkingPos.z, 1.0) then
local vehicle = GetVehiclePedIsIn(playerPed, false)
local vehicle = GetVehiclePedIsIn(playerPed, false)
local vehicleProps = ESX.Game.GetVehicleProperties(vehicle)
TriggerServerEvent('esx_garage:setParking', name, parking, vehicleProps)
@@ -279,11 +273,11 @@ AddEventHandler('esx_property:hasExitedMarker', function(name, part, parking)
if part == 'Parking' then
local playerPed = GetPlayerPed(-1)
local playerPed = PlayerPedId()
local garage = Config.Garages[name]
local parkingPos = garage.Parkings[parking].Pos
if IsPedInAnyVehicle(playerPed, false) and not IsAnyVehicleNearPoint(parkingPos.x, parkingPos.y, parkingPos.z, 1.0) then
if IsPedInAnyVehicle(playerPed, false) and not IsAnyVehicleNearPoint(parkingPos.x, parkingPos.y, parkingPos.z, 1.0) then
TriggerServerEvent('esx_garage:setParking', name, parking, false)
end
@@ -300,15 +294,15 @@ Citizen.CreateThread(function()
local blip = AddBlipForCoord(v.ExteriorEntryPoint.Pos.x, v.ExteriorEntryPoint.Pos.y, v.ExteriorEntryPoint.Pos.z)
SetBlipSprite (blip, 357)
SetBlipDisplay(blip, 4)
SetBlipScale (blip, 1.2)
SetBlipColour (blip, 3)
SetBlipAsShortRange(blip, true)
SetBlipSprite (blip, 357)
SetBlipDisplay(blip, 4)
SetBlipScale (blip, 1.2)
SetBlipColour (blip, 3)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString("Garage")
EndTextCommandSetBlipName(blip)
AddTextComponentString("Garage")
EndTextCommandSetBlipName(blip)
end
@@ -320,9 +314,9 @@ end)
Citizen.CreateThread(function()
while true do
Wait(0)
Citizen.Wait(0)
local playerPed = GetPlayerPed(-1)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
for k,v in pairs(Config.Garages) do
@@ -339,7 +333,7 @@ Citizen.CreateThread(function()
end
if IsPedInAnyVehicle(playerPed, false) then
if IsPedInAnyVehicle(playerPed, false) then
for i=1, #v.Parkings, 1 do
@@ -365,7 +359,7 @@ Citizen.CreateThread(function()
Wait(0)
local playerPed = GetPlayerPed(-1)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
local isInMarker = false
local currentGarage = nil
+9 -9
View File
@@ -42,39 +42,39 @@ Config.Garages = {
Pos = {x = 224.500, y = -998.695, z = -100.000},
Heading = 225.0
},
{
{
Pos = {x = 224.500, y = -994.630, z = -100.000},
Heading = 225.0
},
{
{
Pos = {x = 224.500, y = -990.255, z = -100.000},
Heading = 225.0
},
{
{
Pos = {x = 224.500, y = -986.628, z = -100.000},
Heading = 225.0
},
{
{
Pos = {x = 224.500, y = -982.496, z = -100.000},
Heading = 225.0
},
{
{
Pos = {x = 232.500, y = -982.496, z = -100.000},
Heading = 135.0
},
{
{
Pos = {x = 232.500, y = -986.628, z = -100.000},
Heading = 135.0
},
{
{
Pos = {x = 232.500, y = -990.255, z = -100.000},
Heading = 135.0
},
{
{
Pos = {x = 232.500, y = -994.630, z = -100.000},
Heading = 135.0
},
{
{
Pos = {x = 232.500, y = -998.695, z = -100.000},
Heading = 135.0
},
+3 -4
View File
@@ -1,6 +1,5 @@
Locales['br'] = {
['veh_released'] = 'Veículo ~g~já está disponivel',
['veh_stored'] = 'Veículo ~g~guardado',
['veh_released'] = 'veículo ~g~já está disponivel',
['veh_stored'] = 'veículo ~g~guardado',
['veh_health'] = 'you\'ll have to repair the vehicle before storing it.',
}
+1 -2
View File
@@ -1,6 +1,5 @@
Locales['de'] = {
['veh_released'] = 'Fahrzeug ~g~genommen',
['veh_stored'] = 'vehicle ~g~geparkt',
['veh_health'] = 'you\'ll have to repair the vehicle before storing it.',
}
+3 -4
View File
@@ -1,6 +1,5 @@
Locales['en'] = {
['veh_released'] = 'vehicle ~g~released',
['veh_stored'] = 'vehicle ~g~stored',
['veh_released'] = 'the vehicle has been ~g~released',
['veh_stored'] = 'the vehicle has been ~g~stored',
['veh_health'] = 'you\'ll have to repair the vehicle before storing it.',
}
+1 -1
View File
@@ -2,5 +2,5 @@ Locales['fr'] = {
['veh_released'] = 'véhicule ~g~sorti',
['veh_stored'] = 'véhicule ~g~rangé',
['veh_health'] = 'vous devez d\'abord réparer votre véhicule!',
}
+3 -4
View File
@@ -1,6 +1,5 @@
Locales['sv'] = {
['veh_released'] = 'fordon ~g~uthämtat',
['veh_stored'] = 'fordon ~g~förvarats',
['veh_released'] = 'fordonet har ~y~släppts~s~ från ditt garage',
['veh_stored'] = 'fordonet har ~g~lagrats~s~ i ditt garage',
['veh_health'] = 'fordonet är i ett dåligt skick för att lämnas i garage.',
}
+1 -2
View File
@@ -39,8 +39,7 @@ AddEventHandler('esx_garage:updateOwnedVehicle', function(vehicleProps)
end)
ESX.RegisterServerCallback('esx_vehicleshop:getVehiclesInGarage', function(source, cb, garage)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local xPlayer = ESX.GetPlayerFromId(source)
MySQL.Async.fetchAll('SELECT * FROM `user_parkings` WHERE `identifier` = @identifier AND garage = @garage',
{