Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request #54 from FiveM-Scripts/hotfix
Browse files Browse the repository at this point in the history
v1.3.5
  • Loading branch information
ghermans authored Apr 5, 2018
2 parents 5e228cd + bbab150 commit b5c483d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## v1.3.5
- Server administrators can now configure the control key for the **vehicle inventory**.
- Fixed a issue with vehicle network registration.

## v1.3.4
- Added Doomsday heists weapons to the Ammu-Nation stores.
- Fixed missing translations.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# fs_freemode
[![Version](https://img.shields.io/badge/Version-v1.3.3-brightgreen.svg)]()
[![License](https://img.shields.io/badge/License-AGPLv3-blue.svg)](LICENSE)
<a href="https://discord.gg/Cgr5FU6" title="Chat on Discord"><img alt="Discord Status" src="https://discordapp.com/api/guilds/285462938691567627/widget.png"></a>
[![Version](https://img.shields.io/badge/Version-v1.3.5-brightgreen.svg)]()
[![GitHub license](https://img.shields.io/github/license/FiveM-Scripts/fs_freemode.svg)](https://github.com/FiveM-Scripts/fs_freemode/blob/master/LICENSE)
<a href="https://discord.gg/qnAqCEd" title="Chat on Discord"><img alt="Discord Status" src="https://discordapp.com/api/guilds/285462938691567627/widget.png"></a>

## Requirements
- [FXServer](https://wiki.fivem.net/wiki/Running_FXServer)
Expand Down
2 changes: 1 addition & 1 deletion __resource.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9'
resource_repository 'https://github.com/FiveM-Scripts/fs_freemode'
resource_type 'gametype' { name = 'fs_freemode'}
resource_version 'v1.3.4'
resource_version 'v1.3.5'

dependency 'essentialmode'

Expand Down
2 changes: 1 addition & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ AddEventHandler("playerSpawned", function(spawn)
if firstJoin then
StartPlayerSwitch(PlayerPedId(), PlayerPedId(), 2050, 1)
end

AddTextEntry('FE_THDR_GTAO', Setup.ServerName)

if Setup.SetTextChatEnabled then
Expand Down
2 changes: 2 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Setup.TrainsEnabled = true
Setup.debug = false
Setup.EMS = false

Setup.InventoryKey = 56

-- Cinema settings
Setup.CinemaPrice = 10
Setup.CinemaOpen = 10
Expand Down
29 changes: 14 additions & 15 deletions int/vehicles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ end)

local function SpawnFakeCar(vehicle, price)
local playerCoords = GetEntityCoords(playerPed)
local hash = GetHashKey(vehicle)

if fakecar.model ~= vehicle then
if DoesEntityExist(fakecar.car) then
Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(fakecar.car))
end

local hash = GetHashKey(vehicle)

RequestModel(hash)
while not HasModelLoaded(hash) do
Citizen.Wait(0)
Expand Down Expand Up @@ -291,12 +290,7 @@ AddEventHandler('FinishMoneyCheckForVeh', function(moneyCheck)

FreezeEntityPosition(PlayerPedId(), false)
local personal = CreateVehicle(model, -19.521, -1117.096, 26.765, 175.394, true, true)
local id = NetworkGetNetworkIdFromEntity(personal)

SetNetworkIdCanMigrate(id, true)
SetVehicleOnGroundProperly(personal)

-- SetEntityAsMissionEntity(personal, true, true)
SetEntityVisible(playerPed, true)

SetVehRadioStation(personal, "OFF")
Expand All @@ -306,7 +300,9 @@ AddEventHandler('FinishMoneyCheckForVeh', function(moneyCheck)
SetVehicleExtraColours(personal, extra_colors[1],extra_colors[2])
TaskWarpPedIntoVehicle(PlayerPedId(), personal, -1)


local netid = NetworkGetNetworkIdFromEntity(personal)
SetNetworkIdCanMigrate(netid, true)
NetworkRegisterEntityAsNetworked(VehToNet(personal))
else
if DoesEntityExist(fakecar.car) then
Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(fakecar.car))
Expand Down Expand Up @@ -379,8 +375,10 @@ Citizen.CreateThread(function()
end

WarMenu.Display()
elseif IsControlJustReleased(0, 56) then
WarMenu.OpenMenu('inventory')
elseif not IsPlayerSwitchInProgress() then
if IsControlJustReleased(0, Setup.InventoryKey) then
WarMenu.OpenMenu('inventory')
end
end

if engineoff then
Expand Down Expand Up @@ -409,15 +407,16 @@ AddEventHandler('vehshop:spawnVehicle', function(v)
end

local veh = CreateVehicle(car, playerCoords, true, false)
local id = NetworkGetNetworkIdFromEntity(veh)
SetNetworkIdCanMigrate(id, true)

TaskWarpPedIntoVehicle(playerPed, veh, -1)
--SetEntityAsMissionEntity(veh, true, true)
SetVehicleHasBeenOwnedByPlayer(veh, true)
SetVehRadioStation(veh, "OFF")

FreezeEntityPosition(PlayerPedId(), false)
SetEntityVisible(PlayerPedId(), true)

TaskWarpPedIntoVehicle(playerPed, veh, -1)

local netid = NetworkGetNetworkIdFromEntity(veh)
SetNetworkIdCanMigrate(netid, true)
NetworkRegisterEntityAsNetworked(VehToNet(veh))
end
end)

0 comments on commit b5c483d

Please sign in to comment.