showNotification SCRIPT ERROR

Title says it, I have a script error at esx_vehicleshop about showNotification. I have the latest version of esx_vehicleshop.

I have noticed that this error always comes when someone buys a car.
image

Line 201 up to and including 212:

MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (@owner, @plate, @vehicle)', {
			['@owner']   = xPlayer.identifier,
			['@plate']   = plate,
			['@vehicle'] = json.encode({model = GetHashKey(model), plate = plate})
		}, function(rowsChanged)
			xPlayer.showNotification(_U('vehicle_belongs', plate))
			cb(true)
		end)
	else
		cb(false)
	end
end)

Tell me if you need to see more.

1 Like

What you are trying to do is use client function in server side.

Replace xPlayer.showNotification(_U('vehicle_belongs', plate)) with

TriggerClientEvent(‘esx:showNotification’, xPlayer.source, _U (‘vehicle_belongs’, plate))

3 Likes

Yes, thanks. It works!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.