Hey!
After I got some help with my last resource, I'm now doing stuff with the carshop system>
My problem is, I want to let the custom carnames show in the hud, instead of the standard MTA Model, I've tried multiple functions, neither did any of them work.
Here's my code
localPlayer = getLocalPlayer()
function carshop_showInfo(carPrice, taxPrice)
local isOverlayDisabled = getElementData(localPlayer, "hud:isOverlayDisabled")
if isOverlayDisabled then
outputChatBox("")
outputChatBox("As you walk by the vehicle, you notice a card in the sidewindow. It reads the following:")
--outputChatBox(" --------------------------------------")
outputChatBox("| "..getVehicleNameFromModel( getElementModel( source ) ) )
outputChatBox("| Now available for $"..exports.global:formatMoney(carPrice).."!" )
outputChatBox("| Tax costs: $"..tostring(taxPrice) )
--outputChatBox(" --------------------------------------")
outputChatBox("Press F or Enter to buy this vehicle")
else
local content = {}
table.insert(content, {"Car Dealership - Paper Sheet", false, false, false, false, false, false, "title"} )
table.insert(content, {" " } )
table.insert(content, {" - MTA Model: "..getVehicleNameFromModel( getElementModel( source ) ) } )
table.insert(content, {" - Custom Model:"})
table.insert(content, {" - " ..getVehicleNameFromModel( getElementModel( source ) ) } ) -- Ment to be used for custom carnames, doesn't work yet.
table.insert(content, {" - Price: $"..exports.global:formatMoney(carPrice) } )
table.insert(content, {" - Tax: $"..exports.global:formatMoney(taxPrice) } )
table.insert(content, {"Press 'F' or 'Enter' to purchase!" } )
exports.hud:sendTopRightNotification( content, localPlayer, 240)
end
end
addEvent("carshop:showInfo", true)
addEventHandler("carshop:showInfo", getRootElement(), carshop_showInfo)