ola, estou desenvolvendo um sistema de garagem ligado com a concessionaria, porem, estou tendo problema na parte de vender os carros, junto ao inventario de carros.
ultilizei o debugscript 3 e o seguinte erro aparece: ERROR: [DevMods]\Eagle-Concessionaria\Inventario_C.Lua:188:attempt to call global 'triggerClientEvent' (a nill value).
gostaria que me ajuda-sem, pois ja fiz de tudo e nao resolveu.
aqui esta o codigo.
function Vender_Carro ( _,state )
local id = DGS:dgsGridListGetSelectedItem(Invetario_Car)
local NickPlayer = getElementData(Nick_Jogador, "text")
local PrecoVeh = tonumber(getElementData(Preco_Car, "text"))
if isEventHandlerAdded("onClientRender", getRootElement(), Dx_Vender) then
if state == "down" then
if isCursorOnElement ( x*693, y*418, x*149, y*40 ) then
showCursor(false)
removeEventHandler("onClientRender", root, Dx_Vender)
end
if (id ~= -1) then
if isCursorOnElement ( x*525, y*418, x*149, y*40 ) then
if (NickPlayer ~= "") then
if type(PrecoVeh) == "number" then
if PrecoVeh >= 500 then
VeiculoName = DGS:dgsGridListGetItemText(Invetario_Car, id, 1)
VeiculoID = DGS:dgsGridListGetItemData(Invetario_Car, id, 1)
playSoundFrontEnd ( 4 )
showCursor(false)
triggerServerEvent("EGL:Vender_Veh", root, localPlayer, NickPlayer, PrecoVeh, VeiculoName, VeiculoID )
removeEventHandler("onClientRender", root, Dx_Vender)
else
playSoundFrontEnd ( 6 )
triggerClientEvent(localPlayer, "addNotification", root, "[Concessionaria] Valor Minimo e De 2500 Reais!", "info")
end
else
playSoundFrontEnd ( 6 )
triggerClientEvent(localPlayer, "addNotification", root, "[Concessionaria] O Comprador Não Possui Dinheiro Suficiente!", "info")
end
else
playSoundFrontEnd ( 6 )
triggerClientEvent(localPlayer, "addNotification", root, "[Concessionaria] Coloque o Nick da Pessoa que Deseja Você Queira Vender o Veiculo!", "info")
end
end
else
triggerClientEvent(localPlayer, "addNotification", root, "[Concessionaria] Nenhum Veiculo Selecionado!", "info")
end
end
end
end
addEventHandler ( "onClientClick", root, Vender_Carro )