Jump to content

Is there such script?


Mossy

Recommended Posts

Posted

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!

Posted

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) 

Posted

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.

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

Posted

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

Posted
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).

Posted

@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 :P

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