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!

Need a script that automatically prints to chatbox every x seconds.

Discussion in 'Development' started by Sheeplie, May 21, 2015.

  1. Sheeplie

    Sheeplie Hi.

    So basically, yeah. I need a timer that does this, I get that it'll probably use CurTime(), but I'm unsure of the actual function to print to the chatbox, I'd like it to look similar to how the text for /event looks. Also, could I make it play a sound to everyone? I could probably just use surface.PlaySound..
     
  2. _HappyGoLucky

    _HappyGoLucky Clockwork Customer

    What do you want it to say?
     
  3. Don't know if I'm doing it the most efficient way in utilizing Clockwork's built in functions, but this should work:

    cl_hooks:
    Code:
    function PLUGIN:Initialize()
    timer.Create( "Sound_Text_timer", numofseconds, 0, function() CallSoundTextTimer () end )
    end;
    
    function CallSoundTextTimer ()
    surface.PlaySound("nuts/godeym.wav");
    Clockwork.player:Notify(player, "Deez Nuts Godeym");
    end;
    
    Replace numofseconds with the amount of seconds you want.

    You can mess around with the text notification. Take a gander at the /event command.

    Something like:
    Code:
    Clockwork.chatBox:Add(nil, player, "event",  table.concat("ur message is crap", " "));
     
    Last edited: May 21, 2015

Previous Readers (Total: 0)