Jump to content

[QUESTION] Why not working Timed Out msg?


Tokio

Recommended Posts

Posted (edited)

I have this:

addEventHandler('onPlayerQuit', root,
	function(reason)
Reasons = { 
	["Unknown"] = "Nem tudni", 
	["Quit"] = "kilépett.", 
	["Kicked"] = "kirúgva a szerverről.", 
	["Banned"] = "kibanolva a szerverről.", 
	["Timed Out"] = "kifagyott.", 
	["Bad Connection"] = "rossz internetkapcsolat" 
}
    	local name = getPlayerName(source)
		triggerClientEvent(root, "createNotification", root, "#FFffFF"..Reasons[reason], "simple", name)
	end
)

and the "Quit", "Kicked", and "Banned" msg working fine, but the "Timed Out" no.. does not show the timed out notification, but why?

yeah, and i got this error: S.lua:12: attempt to concatenate field '?' (a nil value) 

thanks the help!

Edited by 50cent
the error code

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted

That is because the exact message is "Timed out" (lowercase 'o') and the string is case-sensitive.

Reasons = { 
	["Unknown"] = "Nem tudni", 
	["Quit"] = "kilépett.", 
	["Kicked"] = "kirúgva a szerverről.", 
	["Banned"] = "kibanolva a szerverről.", 
	["Timed out"] = "kifagyott.", 
	["Bad Connection"] = "rossz internetkapcsolat" 
}

addEventHandler('onPlayerQuit', root,
	function(reason)
    	local name = getPlayerName(source)
		triggerClientEvent(root, "createNotification", root, "#FFffFF"..Reasons[reason], "simple", name)
	end
)

 

  • Like 1
Posted
11 minutes ago, pa3ck said:

That is because the exact message is "Timed out" (lowercase 'o') and the string is case-sensitive.


Reasons = { 
	["Unknown"] = "Nem tudni", 
	["Quit"] = "kilépett.", 
	["Kicked"] = "kirúgva a szerverről.", 
	["Banned"] = "kibanolva a szerverről.", 
	["Timed out"] = "kifagyott.", 
	["Bad Connection"] = "rossz internetkapcsolat" 
}

addEventHandler('onPlayerQuit', root,
	function(reason)
    	local name = getPlayerName(source)
		triggerClientEvent(root, "createNotification", root, "#FFffFF"..Reasons[reason], "simple", name)
	end
)

 

Thank you! :D

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

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...