1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Other Overriding

Discussion in 'Development' started by 8bitMafia, Dec 11, 2016.

  1. Hello, I have done my fair share of simple scripting, however I'm not exactly sure how I would override this specific function. I just wanted to organize my framework edits into a plugin so it wouldn't be such a cluster-fuck. I want to simply override a chatbox class, pm that is, to play a different sound than the fvox bell.
    I want to override this
    Code:
    Clockwork.chatBox:RegisterDefaultClass("pm", "ooc", function(info)
        Clockwork.chatBox:Add(info.filtered, nil, "[PM] ", Color(125, 150, 75, 255), info.name..": "..info.text);
        surface.PlaySound("hl1/fvox/bell.wav");
    end);
    I simply put this same exact code into a plugin at libraries/client/cl_chatbox.lua with a different sound in the surface.PlaySound string, and it did nothing. Thanks for your time!
     
  2. duck

    duck Phant0m Legend

    First you should check if your file is actually running, so do a print at the top of the file and see if it pops up in the console.
     
  3. Ok, so I put two prints one on sh_plugin.lua and that one works, and the other on cl_chatbox.lua that one doesn't run.
     
  4. duck

    duck Phant0m Legend

    Try just putting it in cl_plugin
     

Previous Readers (Total: 0)