Park Posted August 29, 2013 Share Posted August 29, 2013 i dont know why this not work i am new scripter and i want to learn and i am not good and i dont know many things and my friend didnt want to help me and he make fun of me function(message) themessage == message if themessage then themessage = message outputchatbox( string themessage) : follow this > x = 5 y = 10 -- Displays the message outputChatBox ( "I have " .. x .. " apples and " .. y .. " oranges." ) function colouredChat ( message, theType ) if theType == 0 then --if its normal chat (not /me or teamchat) then cancelEvent() --prevent MTA from outputting chat message = string.gsub(message, "#%x%x%x%x%x%x", "") --remove any hex tags in a player's chat to prevent custom colours by using lua's string.gsub local r,g,b = getPlayerNametagColor ( source ) --get the player's nametag colour local chatterName = getPlayerName ( source ) --get his name --output a message with the name as his nametag colour, and the rest in white. outputChatBox ( chatterName..":#FFFFFF "..message, getRootElement(), r, g, b, true ) end end addEventHandler("onPlayerChat", getRootElement(), colouredChat) end; else outputchatbox(string error) : local msg_red,msg_green,msg_blue = 255,255,0 function servertalkprivate(message, sendto) --Talk to one client only outputChatBox(tostring(message), sendto, msg_red, msg_green, msg_blue, true) end function servertalk(message) --Talk to everyone servertalkprivate(message, getRootElement()) end function onJoin() servertalkprivate("error", source) end addEventHandler("onPlayerJoin",getRootElement(),onJoin) end; outputchatbox(string true) end. function "test" (message) Link to comment
EstrategiaGTA Posted August 29, 2013 Share Posted August 29, 2013 Many functions haven't 'end'. function(message) themessage == message if themessage then themessage = message outputchatbox( string themessage) : follow this > x = 5 y = 10 -- Displays the message outputChatBox ( "I have " .. x .. " apples and " .. y .. " oranges." ) end end function colouredChat ( message, theType ) if theType == 0 then --if its normal chat (not /me or teamchat) then cancelEvent() --prevent MTA from outputting chat message = string.gsub(message, "#%x%x%x%x%x%x", "") --remove any hex tags in a player's chat to prevent custom colours by using lua's string.gsub local r,g,b = getPlayerNametagColor ( source ) --get the player's nametag colour local chatterName = getPlayerName ( source ) --get his name --output a message with the name as his nametag colour, and the rest in white. outputChatBox ( chatterName..":#FFFFFF "..message, getRootElement(), r, g, b, true ) end end addEventHandler("onPlayerChat", getRootElement(), colouredChat) function servertalkprivate(message, sendto) --Talk to one client only outputChatBox(tostring(message), sendto, msg_red, msg_green, msg_blue, true) end function servertalk(message) --Talk to everyone servertalkprivate(message, getRootElement()) end function onJoin() servertalkprivate("error", source) end addEventHandler("onPlayerJoin",getRootElement(),onJoin) The code is a really mess... Link to comment
Mork Posted August 29, 2013 Share Posted August 29, 2013 addEventFunction(message) themessage == themessage if not message then message= message outputchatbox( string themessage) : follow this > x = nill y = nill -- Displays the message outputChatBox ( "I have " .. x .. " apples and " .. y .. " oranges." ) function colouredChat ( message, theType ) if theType == 0 then --if its normal chat (not /me or teamchat) then cancelEvent() --prevent MTA from outputting chat message = string.gsub(message, "#%x%x%x%x%x%x", "") --remove any hex tags in a player's chat to prevent custom colours by using lua's string.gsub local r,g,b = getPlayerNametagColor ( source ) --get the player's nametag colour local chatterName = getPlayerName ( source ) --get his name --output a message with the name as his nametag colour, and the rest in white. outputChatBox ( chatterName..":#FFFFFF "..message, getRootElement(), r, g, b, true ) end end addEventHandler("onPlayerChat", get addEventCommand("onPlayerJoin",getRootElement(),onQuit) end; outputchatbox(string true) end. function "test" (message) addEventFunction(nill) Link to comment
EstrategiaGTA Posted August 29, 2013 Share Posted August 29, 2013 addEventFunction doesn't even exist... addEventCommand too... And this (see below), isn't needed. themessage == themessage 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