xeon17 Posted January 30, 2014 Share Posted January 30, 2014 The scripts work without problems , but when the scripts are on at 1 time then they don't work. please help addCommandHandler("gang", function(player, command, subcommand, ...) local args = {...} local team = getPlayerTeam(player) if(subcommand == "tag") then if(not isElement(team)) then return outputChatBox("#F4A460[GANG]#F08080 Você não possui uma gang...", player, 0, 0, 0, true) end local tag = args[1] if(tag) then setElementData(team, "tag", tag) return outputChatBox("#F4A460[GANG]#F08080 Tag setada com sucesso = " .. tag , player, 0, 0, 0, true) else setElementData(team, "tag", nil) return outputChatBox("#F4A460[GANG]#F08080 Tag removida.", player, 0, 0, 0, true) end end end) addEventHandler("onPlayerChat", root, function(message, messageType) local team = getPlayerTeam(source) if team then local tag = getElementData(team, "tag") if tag then if messageType == 0 then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox(string.format("[%s]%s: #FFFFFF %s", tag, getPlayerName(source), message), root, r, g, b, true) elseif messageType == 2 then cancelEvent() local r, g, b = getPlayerNametagColor(source) for _, member in ipairs( getPlayersInTeam(team) ) do outputChatBox(string.format("[%s]%s: #FFFFFF %s", tag, getPlayerName(source), message), member, r, g, b, true) end end end end end) Script 2 : local aTable = { -- ['Word'] = { 'Out put of it' }, ['bitch'] = { 'I Love You' }, } addEventHandler('onPlayerChat',root, function ( Massege ) local r,g,b = getPlayerNametagColor ( source ) or 255,255,255 for v in pairs ( aTable ) do if string.find ( Massege,v ) then cancelEvent ( ) outputChatBox ( ' '..getPlayerName ( source )..' : '..aTable [ v ] [ 1 ]..' ',root,r,g,b ) end end end ) Script 3 function blockChatMessage() cancelEvent() end addEventHandler( "onPlayerChat", getRootElement(), blockChatMessage) function sayMessageNear(message, messageType) local x,y,z = getElementPosition(source) if x ~= 0 and y ~= 0 and z ~= 0 then if messageType == 0 then r,g,b = getTeamColor(getPlayerTeam(source)) thePlayerName = getPlayerName(source) thePlayerID = getElementData(source,"id") outputChatBox(thePlayerName.."["..tostring(thePlayerID).."]: #ffffff"..message, getRootElement(), r,g,b, true) end end end addEventHandler("onPlayerChat", getRootElement(), sayMessageNear) function sayMessageTeam(message, messageType) if messageType == 2 then r,g,b = getTeamColor(getPlayerTeam(source)) thePlayerName = getPlayerName(source) for i,v in ipairs(getElementsByType("player")) do if getPlayerTeam(source) == getPlayerTeam(v) then thePlayerID = getElementData(source,"id") outputChatBox("(TEAM) "..thePlayerName.."["..tostring(thePlayerID).."]: "..message, v, r,g,b, true) end end end end addEventHandler("onPlayerChat", getRootElement(), sayMessageTeam) 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