Jump to content

Is there such script?


Mossy

Recommended Posts

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

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
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

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...