[Dev-Resource] Mythic Notifications

This isn’t supported anymore, stop using it or figure it out yourself

42 Likes

Pretty nice! Will try to see what i can do with this :slight_smile: :+1:

2 Likes

Oooooo exciting

1 Like

NoPixel? :wink:

Nice tho!

1 Like

Lmao, yeah originally was using styling from these but wanted something smaller and in a flexbox and … well that quickly turned into looking like NoPixel’s so just went full-on with it.

I see! No problem at all! I think many likes these ones! :slight_smile:

2 Likes

Oh you’re a legend. I love you.

1 Like

I added the notification to esx_carlock and managed to receive a single notification and then it stopped permanently even after a server + client restart. Didn’t change anything after it worked the single time.

There are also no errors in the consoles.

if #cars == 0 then
	exports['mythic_notify']:DoHudText('inform', 'No vehicles to lock nearby')
else

More likely your ‘if function’ isnt returning true, therefore put another notification after the ‘else’ to test that.

if #cars == 0 then
	exports['mythic_notify']:DoHudText('inform', 'No vehicles to lock nearby')
else
        exports['mythic_notify']:DoHudText('inform', '#cars is coming back 1')

It’s something within your script as there’s no checks or anything in this. It just clones a div and after X milliseconds deletes it.

Well there is another notification call for when there is a vehicle nearby, in which case it triggers the function of unlocking/locking the car.

Would I have to change the code a bit to work like you said?

He’s saying to add it as a test case to see if #cars has more than 0 elements in it so you can see if it’s an issue with the notify script or somewhere else in your code.

1 Like

This is literally this : [RELEASE] Notification System

without the chat notification :joy: but code is different

how is that the same? haha

the other one is plain af

Okay cool. That made it function a bit better.

So after putting that in the client.lua, whenever I am within range of one of my cars to lock it, it returns the test notification.

Here is a bit more code which I think should be all I need to make this work. This is lines 28-36.
Is there a way I could just make that else that I added apply to the #cars, 1?
Sorry, I am a noob but I promise I learn fast. ;p

		if #cars == 0 then
			exports['mythic_notify']:DoHudText('inform', 'No vehicles to lock nearby')
		else
		        exports['mythic_notify']:DoHudText('inform', 'This is the test notification.')
			for j=1, #cars, 1 do
				local coordscar = GetEntityCoords(cars[j])
				local distance = Vdist(coordscar.x, coordscar.y, coordscar.z, coords.x, coords.y, coords.z)
				table.insert(cars_dist, {cars[j], distance})
			end

mine is literally something i made in 5 min that i just threw together for debuggin purposes. This on the other hand has been made with love lol

2 Likes

Can I use the notifications as chat messages?

Can i use to get the alerts with Esx_outlawalert? i mean, with the function sex, street, car model and etc?

RegisterServerEvent('esx_outlawalert:gunshotInProgress')
AddEventHandler('esx_outlawalert:gunshotInProgress', function(targetCoords, streetName, playerGender)
	if playerGender == 0 then
		playerGender = _U('male')
	else
		playerGender = _U('female')
	end

	TriggerClientEvent('esx_outlawalert:outlawNotify', -1, _U('gunshot', playerGender, streetName))
	TriggerClientEvent('esx_outlawalert:gunshotInProgress', -1, targetCoords)
end)

I guess if you wanted to?

Can use it for anything. Just pass a string value to it (_U(‘gunshot’, playerGender, streetName) Should return a string so you can just pass that as the 2nd parameter)

1 Like