Jump to content

[QUESTION] Why not working Timed Out msg?


Tokio

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

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

Link to comment

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