DiSaMe Posted May 2, 2013 Posted May 2, 2013 First, event "onPlayerChat" only has 2 arguments, the message and its type. Second, your function theFormat does nothing. And third, using "id" as the name of the function is confusing, especially when there's a variable with the same name. This could lead to the situations in which you try to use a value without noticing that it's being overriden by another value.
Sasu Posted May 2, 2013 Posted May 2, 2013 Try this: function theFormat(player) local ID = getElementData(player, "ID") return ID end function id(text, msgtype) local ids = theFormat(player) local pName = getPlayerName(source) if (msgtype == 0) then cancelEvent() outputChatBox("#808080(ID: "..ids..") #FFFFFF"..pName..": #ebddb2"..text, getRootElement(), 255, 255, 255, true) end end addEventHandler("onPlayerChat", root, id)
Vision Posted May 2, 2013 Posted May 2, 2013 Change this local ids = theFormat(player) to this local ids = theFormat ( source )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now