Jump to content

Why show everyone the notification?


Turbe$Z

Recommended Posts

Posted
	exports["rangos_bejelentkezes"]:addNotification(player, "Megnyerted a reakció tesztet!", "success")

i added this line to a script, but the notification show everyone :S how to fix this?

|Sorry for my very bad English:c|

Posted

Check your script define player, maybe thePlayer or source try. in this.

exports["rangos_bejelentkezes"]:addNotification(thePlayerthePlayerT, "Megnyerted a reakció tesztet!", "success")

or

exports["rangos_bejelentkezes"]:addNotification(source, "Megnyerted a reakció tesztet!", "success")

Posted
7 minutes ago, HuskLV said:

Check your script define player, maybe thePlayer or source try. in this.

exports["rangos_bejelentkezes"]:addNotification(thePlayerthePlayerT, "Megnyerted a reakció tesztet!", "success")

or

exports["rangos_bejelentkezes"]:addNotification(source, "Megnyerted a reakció tesztet!", "success")

same problem :S 

 

 

Posted
1 minute ago, HuskLV said:

Put your script code please

function onPlayerWin(player)
	outputChatBox("#0088FF[Reakció teszt] #FFffFFTe #FFffFFírtad be leghamarabb a szót. Ezért megnyerted a #0088FF"..thePrize.."Ft-ot!",player,255,255,0,true)
	exports["rangos_bejelentkezes"]:addNotification(player, "Megnyerted a reakció tesztet!", "success")
	givePlayerMoney(player,thePrize)
	removeCode()
end

 

Posted

Are you sure that's the correct syntax for the rangos_bejelentkezes resource's addNotification function? Could you show us that function from that resource?

Posted
7 minutes ago, HuskLV said:

Maybe try function onPlayerWin(thePlayer)

and other line change player -> thePlayer

This does nothing. Just renaming a variable wouldn't do anything. Post your code about the addNotification function.

Posted
14 minutes ago, NeXuS™ said:

This does nothing. Just renaming a variable wouldn't do anything. Post your code about the addNotification function.

addEvent('addNotification', true);
function addNotification(text, type)
	if (text and type) then
		if (notificationData ~= nil) then
			table.remove(notificationData, #notificationData);
		end
		
		table.insert(notificationData,
			{
				StartX = (displayWidth / 2) - (25 / 2),
				EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2),
				Text = text,
				Width = dxGetTextWidth(text, 0.40, notificationFont) + 20,
				Alpha = 0,
				State = 'fadeIn',
				Tick = 0,
				AlphaTick = getTickCount(),
				CurrentX = (displayWidth / 2) - (25 / 2),
				CurrentWidth = 0,
				Type = type or 'info'
			}
		);
		
		playSoundFrontEnd(11);
	end
end
addEventHandler('addNotification', root, addNotification);

 

Posted
25 minutes ago, Turbo777 said:

function onPlayerWin(player)
	outputChatBox("#0088FF[Reakció teszt] #FFffFFTe #FFffFFírtad be leghamarabb a szót. Ezért megnyerted a #0088FF"..thePrize.."Ft-ot!",player,255,255,0,true)
	exports["rangos_bejelentkezes"]:addNotification(player, "Megnyerted a reakció tesztet!", "success")
	givePlayerMoney(player,thePrize)
	removeCode()
end

 

Is this client side or server side?

Posted

You could just you just use 

triggerClientEvent(thePlayer, "addNotification", thePlayer, theMessage, theType)

instead of an exported function.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...