-Doc- Posted December 30, 2015 Share Posted December 30, 2015 Is it possible to add a new chat type? Link to comment
AMARANT Posted December 30, 2015 Share Posted December 30, 2015 It is possible to make your own. Adding 'new type' of the chat depends on what you mean by that. Link to comment
-Doc- Posted December 30, 2015 Author Share Posted December 30, 2015 A new chat type. Like the 0 is the default and 2 team chat to add a new one. Link to comment
Incama Posted December 30, 2015 Share Posted December 30, 2015 It is possible, yes but first you have to make a custom chat and then you can implement the multi-channel feature. Link to comment
Addlibs Posted December 30, 2015 Share Posted December 30, 2015 Those numbers aren't chat types, but rather the parameters sent by onPlayerChat. And yes, I suppose it is possible if you trigger that event yourself with your own parameters. Link to comment
Dazee Posted December 30, 2015 Share Posted December 30, 2015 There's a simpler way Make a script with for example a command /radio with a 3rd argument which will be our chat text in a string. I did this just for youu : function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end --isplayerinteam is from wiki mta function radioCommand(thePlayer,cmdname,arg3) local playerName = getPlayerName(thePlayer) if isPlayerInTeam(thePlayer, "Police") then -- 2nd argument is the string name of the team that is created on server for i, players in ipairs(getPlayersInTeam(getTeamFromName("Police"))) do outputChatBox(""..playerName..":" ..arg3.."",players,0,255,255) end else outputChatBox("You need to be in the Police team to use this command!",thePlayer,255,0,0) end end addCommandHandler("radio",radioCommand) Now after you have the radio thing for example in your server use bindKey to (bind key chatbox cmdname example bind u chatbox radio) You can use my lua example to make new chats if this is what you asked for u weren't very specific. Instead of using isPlayerInTeam you can use your script but this is good if you want to make specific chats for example the radio for the police team u can do almost anything u want with this example, except draw new chat if u meant that im not sure about that honestly. Link to comment
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