Addlibs Posted December 15, 2015 Share Posted December 15, 2015 function localMessage(thePlayer, cmd, ...) local message = table.concat({ ... }, " ") local name = getPlayerName(thePlayer) local r, g, b = getPlayerNametagColor(thePlayer) local hex = string.format("#%.2X%.2X%.2X", r, g, b) -- converts R, G, B to HEX value outputChatBox("(Local) "..hex..name..": #ffffff"..message, getRootElement(), 255, 255, 0, true) -- this is actually sent to everyone, so it's not actually local chat - I will leave it to you to adapt it to your needs. end addCommandHandler("Local", localMessage) Link to comment
//_Dragon Posted December 15, 2015 Author Share Posted December 15, 2015 Thanks Dude it's working perfect Link to comment
//_Dragon Posted December 15, 2015 Author Share Posted December 15, 2015 But i have a little problem this local chat i made it in place chatbox i mean bindkey T but when i do some command's mta doesnt work like /reconnect when i do it it be righting in chatbox (local) how i can fixe this problem ? Check this pic http://imgur.com/3V4CqvK Link to comment
1LoL1 Posted December 15, 2015 Share Posted December 15, 2015 But i have a little problem this local chat i made it in place chatbox i mean bindkey T but when i do some command's mta doesnt work like /reconnect when i do it it be righting in chatbox (local) how i can fixe this problem ? Check this pic http://imgur.com/3V4CqvK I think you can use /reconnect only in "T". In local chat you can use kickPlayer. If i'am wrong so sorry. Link to comment
//_Dragon Posted December 15, 2015 Author Share Posted December 15, 2015 I think you can use /reconnect only in "T". In local chat you can use kickPlayer. If i'am wrong so sorry. i Dont think so one server has same script but all commands worke perfect like /nick & /reconnect & /disconnect ... Link to comment
Captain Cody Posted December 15, 2015 Share Posted December 15, 2015 That's because that server reroutes the commands to "T" chat. Link to comment
//_Dragon Posted December 15, 2015 Author Share Posted December 15, 2015 That's because that server reroutes the commands to "T" chat. But he has same script ._. Link to comment
Rockyz Posted December 16, 2015 Share Posted December 16, 2015 idont understand what are you trying to do Link to comment
-Doc- Posted December 16, 2015 Share Posted December 16, 2015 Dont help this guy. He trying only to copy. Proof there. http://i.imgur.com/JBZx0Wa.jpg Link to comment
//_Dragon Posted December 16, 2015 Author Share Posted December 16, 2015 Dont help this guy. He trying only to copy. Proof there. http://i.imgur.com/JBZx0Wa.jpg Shutup u clone other server + this it's not ur script just u still it from .... I want creat my own script so get out of my topic Link to comment
-Doc- Posted December 16, 2015 Share Posted December 16, 2015 Nice scripter. Asking on forums all things he need and sais better than me pfff. Youre saying this because i banned you. Proof: http://imgur.com/asq6Fxa Link to comment
//_Dragon Posted December 16, 2015 Author Share Posted December 16, 2015 Nice scripter. Asking on forums all things he need and sais better than me pfff. Youre saying this because i banned you. Proof: http://imgur.com/asq6Fxa Get out i dont care Link to comment
Syntrax# Posted December 18, 2015 Share Posted December 18, 2015 function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end local Pr, Pg, Pb = 255, 255, 255 function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) local r,g,b = getPlayerNametagColor ( thePlayer ) -- add if r and g and b then outputChatBox(RGBToHex(r,g,b) .." [Local] ".. RGBToHex(Pr,Pg,Pb) ..""..name..": #ffffff"..message, getRootElement(), r, g, b, true) end end addCommandHandler("Local", globalMessage) Link to comment
Syntrax# Posted December 18, 2015 Share Posted December 18, 2015 function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end local Pr, Pg, Pb = 255, 255, 255 function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) local r,g,b = getPlayerNametagColor ( thePlayer ) -- add if r and g and b then outputChatBox(RGBToHex(r,g,b) .." [Local] ".. RGBToHex(Pr,Pg,Pb) ..""..name..": "..message, getRootElement(), r, g, b, true) end end addCommandHandler("Local", globalMessage) Link to comment
//_Dragon Posted December 18, 2015 Author Share Posted December 18, 2015 function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end local Pr, Pg, Pb = 255, 255, 255 function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) local r,g,b = getPlayerNametagColor ( thePlayer ) -- add if r and g and b then outputChatBox(RGBToHex(r,g,b) .." [Local] ".. RGBToHex(Pr,Pg,Pb) ..""..name..": "..message, getRootElement(), r, g, b, true) end end addCommandHandler("Local", globalMessage) You didn't saw my problem !! The problem is But i have a little problem this local chat i made it in place chatbox i mean bindkey T but when i do some command's mta doesnt work like /reconnect when i do it it be righting in chatbox (local) how i can fixe this problem ? Check this pic http://imgur.com/3V4CqvK Link to comment
//_Dragon Posted December 18, 2015 Author Share Posted December 18, 2015 When i do some command's mta in localchat , doesnt work Like /reconnect or /nick Anyone help ? Here is my script function localMessage(thePlayer, cmd, ...) local message = table.concat({ ... }, " ") local name = getPlayerName(thePlayer) local r, g, b = getPlayerNametagColor(thePlayer) local hex = string.format("#%.2X%.2X%.2X", r, g, b) -- converts R, G, B to HEX value outputChatBox("(Local) "..hex..name..": #ffffff"..message, getRootElement(), 255, 255, 0, true) end addCommandHandler("Local", localMessage) Link to comment
#RooTs Posted January 4, 2016 Share Posted January 4, 2016 Anyone ? @Droam|Oussez. please, not create other topic with the same subject Link to comment
Addlibs Posted January 4, 2016 Share Posted January 4, 2016 if message:sub(1,1) == "/" then -- if message proceeds a forward slash (i.e. message is a command) local command = message:sub(2) local command = split(command, " ") local cmd = table.remove(command, 1) -- returns and removes the value on key 1 executeCommandHandler(cmd, thePlayer, unpack(command)) -- this won't work for commands like /login, /logout, /quit, /reconnect, /name etc return 0; --stop function here end executeCommandHandler […] NOTE: You can only execute commands created by Lua. You cannot execute MTA harcoded commands due to security reasons. — executeCommandHandler Link to comment
Captain Cody Posted January 4, 2016 Share Posted January 4, 2016 There's a way to make it so it out puts in the regular chat instead of local. I just forgot what it is. 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