Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mods/deathmatch/resources/[vehicle]/carshop-system/s_shop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ function carshop_pickupUse(thePlayer)
local costTax = getElementData(parentCar, "carshop:taxcost")
if costCar and costTax then
triggerClientEvent(thePlayer, "carshop:showInfo", parentCar, costCar, costTax)
setElementData(thePlayer, "carshopfix", true)
end
cancelEvent()
end
Expand Down Expand Up @@ -202,7 +203,8 @@ addEventHandler( "onResourceStart", getResourceRootElement(), carshop_Initalize)

function carshop_blockEnterVehicle(thePlayer)
local isCarShop = getElementData(source, "carshop")
if (isCarShop) then
local isInCarShop = getElementData(thePlayer, "carshopfix")
if (isCarShop and isInCarShop) then
local costCar = getElementData(source, "carshop:cost")

local payByCash = true
Expand All @@ -216,7 +218,7 @@ function carshop_blockEnterVehicle(thePlayer)
if money < 0 or costCar == 0 then
payByBank = false
end

setElementFrozen(thePlayer, true)
triggerClientEvent(thePlayer, "carshop:buyCar", source, costCar, payByCash, payByBank)
end
cancelEvent()
Expand Down