Try Posted July 17, 2011 Share Posted July 17, 2011 Hello Guys! Im scripting for BadWolf Server Clan! I need a little help The server have a Tags Script and when i put cancelEvent() at the censorship it don't cancel cuz the script What i can do? Link to comment
Slothman Posted July 17, 2011 Share Posted July 17, 2011 you need to show some of the script thats giving you the trouble, and maybe describe what your trying to censor. Link to comment
Try Posted July 17, 2011 Author Share Posted July 17, 2011 The Script im making trouble add tag for the players like [Admin] [Mod] ... and my censorship i made don't cancel the world cuz its a output from other script Link to comment
Castillo Posted July 18, 2011 Share Posted July 18, 2011 I would suggest you to combine both scripts, chat + censor. Link to comment
Twisted Posted July 18, 2011 Share Posted July 18, 2011 as a badwolf scripter i have already explained that badwolf has a chat in a script so it will still output the word Link to comment
[DemoN] Posted July 18, 2011 Share Posted July 18, 2011 Change line 415 in freeroam/fr_server.lua addEventHandler('onPlayerChat', g_Root, function(msg, type) if type == 0 then cancelEvent() local account = getPlayerAccount(source) local r, g, b = getPlayerNametagColor(source) local name = getPlayerName(source) local msg = msg:gsub('#%x%x%x%x%x%x', '') if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then outputChatBox( "#FF0000[Admin]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Moderator' ) ) then outputChatBox( "#FF8000[Moderator]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Member' ) ) then outputChatBox( "#00FF00[Member]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) else outputChatBox( "#FFFF00[Guest]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) end end end ) Link to comment
Twisted Posted July 18, 2011 Share Posted July 18, 2011 Change line 415 in freeroam/fr_server.lua addEventHandler('onPlayerChat', g_Root, function(msg, type) if type == 0 then cancelEvent() local account = getPlayerAccount(source) local r, g, b = getPlayerNametagColor(source) local name = getPlayerName(source) local msg = msg:gsub('#%x%x%x%x%x%x', '') if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Admin' ) ) then outputChatBox( "#FF0000[Admin]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Moderator' ) ) then outputChatBox( "#FF8000[Moderator]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) elseif isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup( 'Member' ) ) then outputChatBox( "#00FF00[Member]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) else outputChatBox( "#FFFF00[Guest]" .. name .. '#FFFFFF: #FFFFFF' .. msg, g_Root, r, g, b, true) end end end ) did you actually read my post? i said we have a chat script made not in freeroam Link to comment
Try Posted July 18, 2011 Author Share Posted July 18, 2011 If i stop and start the script realy fast this will work? Link to comment
Twisted Posted July 18, 2011 Share Posted July 18, 2011 no as it still outputs the badword Link to comment
Uisaqin Posted July 18, 2011 Share Posted July 18, 2011 function onPlayerChatCensor(Text, Type) ChatCensored = false if Text == 'fuk' then ChatCensored = true end end addEventHandler('onPlayerChat', root, onPlayerChatCensor) function onPlayerChatCustom(Text, Type) cancelEvent() if ChatCensored then return end outputChatBox(Text) end addEventHandler('onPlayerChat', root, onPlayerChatCustom) onPlayerChatCensor must be called before onPlayerChatCustom, so load censor script first, or if both are in same script call onPlayerChatCensor's addEventHandler first Link to comment
qaisjp Posted July 18, 2011 Share Posted July 18, 2011 Uisaqin, that is still a(n) (epic) fail. It's impossible if you don't use EXPORTS. Also you can use "return". Try - I don't think The_GTA gave you the player controller to release it on the community to claim ownership, The_GTA made it all and I recommend you add him as an owner too. Link to comment
Twisted Posted July 18, 2011 Share Posted July 18, 2011 Uhm sorry dont worry, also can admin close this topic please? Problem solved! Link to comment
Uisaqin Posted July 18, 2011 Share Posted July 18, 2011 Uisaqin, that is still a(n) (epic) fail. It's impossible if you don't use EXPORTS. Also you can use "return". epic fail. ok. No one mentioned anything about separate resources or exports, just separate scripts. Dunno what your saying about using return, i was demonstrating how to stop an event's execution from another, as im guessing cancelEvent() will not stop the next event functions being called. Not that it should, of course. 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