Turbe$Z

Why show everyone the notification?

Recommended Posts

	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|

Share this post


Link to post

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")

Share this post


Link to post

post your login code here Which is showing this

Edited by TheMOG

Share this post


Link to post
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 

 

 

Share this post


Link to post
1 minute ago, Turbo777 said:

same problem :S 

 

 

Put your script code please

Share this post


Link to post
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

 

Share this post


Link to post

Maybe try function onPlayerWin(thePlayer)

and other line change player -> thePlayer

Share this post


Link to post
2 minutes ago, HuskLV said:

Maybe try function onPlayerWin(thePlayer)

and other line change player -> thePlayer

same problem :S 

Share this post


Link to post

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?

Share this post


Link to post
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.

Share this post


Link to post
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);

 

Share this post


Link to post
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?

Share this post


Link to post

Then copy the addNotification's server side too.

Share this post


Link to post

You could just you just use 

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

instead of an exported function.

Share this post


Link to post

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.