Mossy Posted June 4, 2013 Share Posted June 4, 2013 Is there a script available where you can disable outputChatBox functions in map resources and to disable custom vehicle DFF's and TXD's? If you don't understand what I mean, I would like to disable the chatbox messages of the map's scripts when it loads. Or which functions can I use to create such script? Thanks! Link to comment
Cadu12 Posted June 4, 2013 Share Posted June 4, 2013 You can make your own map-manager to disable TXD, DFF and outputChatBox. Link to comment
Sora Posted June 4, 2013 Share Posted June 4, 2013 i'm not sure if this will block messages from maps but you can try it addEventHandler("onChatMessage", root, function (msg,element) if getElementType(element) == "resource" then if getResourceInfo(element, "type" ) == "map" then cancelEvent() end end end) Link to comment
PaiN^ Posted June 4, 2013 Share Posted June 4, 2013 You can't cancel the onChatMessage event, use onClientChatMessage . Link to comment
Quited Posted June 4, 2013 Share Posted June 4, 2013 disable custom vehicle DFF's and TXD's? do you mean everybody has custom vehicle DFF and TXD will be kicked ? This is Possbile with Event "OnPlayerModInfo" Link to comment
Mossy Posted June 4, 2013 Author Share Posted June 4, 2013 No. What I mean is of how some maps use modded cars. I want to disable them so the player uses the default cars. And I'll try out that script Sora. Link to comment
Spajk Posted June 4, 2013 Share Posted June 4, 2013 Cant you just remove those parts from the script file? Link to comment
Mossy Posted June 4, 2013 Author Share Posted June 4, 2013 Cant you just remove those parts from the script file? I'm not gonna go through about 500 maps. Edit: Sora, your script does not work. if getElementType(element) == "resource" then Debug says that this line's argument only got resource-data. Link to comment
Sora Posted June 5, 2013 Share Posted June 5, 2013 Well i just found that what pain said was right , so here is the new script Client side function cancel(msg,r,g,b) cancelEvent() end addEventHandler("onClientResourceStart",root, function () outputChatBox("* Messages are blocked for 3 seconds",255,0,0) addEventHandler("onClientChatMessage",root,cancel) setTimer(function () removeEventHandler("onClientChatMessage",root,cancel) outputChatBox("* Messages are allowed now",0,255,0) end,3000,1) end) this script will block every chat message when a resource starts for 3 seconds then will allow it again Link to comment
Sex* Posted June 5, 2013 Share Posted June 5, 2013 i'm not sure if this will block messages from maps but you can try it addEventHandler("onChatMessage", root, function (msg,element) if getElementType(element) == "resource" then if getResourceInfo(element, "type" ) == "map" then cancelEvent() end end end) I tried something like this, it's canceling the map start...not outputChatBox(it seems like). Link to comment
Mossy Posted June 5, 2013 Author Share Posted June 5, 2013 @Sora You kind of understood what I meant, but I want them to be disabled completely, not for 3 seconds. Also I don't want it to say messages allowed and blocked, as that will get annoying eventually 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