Tokio

[QUESTION] Why not working Timed Out msg?

Recommended Posts

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

Share this post


Link to post

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

Share this post


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

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.