From 8285a11a26d78784f26b76e6bcdfa479f6c1a345 Mon Sep 17 00:00:00 2001 From: faketruth Date: Tue, 8 Nov 2011 01:25:01 +0000 Subject: It's a Squirrel!! In SquirrelBindings.h use #define USE_SQUIRREL 1 to enable squirrel git-svn-id: http://mc-server.googlecode.com/svn/trunk@76 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- Plugins/SquirrelChatLog.nut | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Plugins/SquirrelChatLog.nut (limited to 'Plugins') diff --git a/Plugins/SquirrelChatLog.nut b/Plugins/SquirrelChatLog.nut new file mode 100644 index 000000000..586e8d6e2 --- /dev/null +++ b/Plugins/SquirrelChatLog.nut @@ -0,0 +1,26 @@ +class SquirrelChatLog extends cPlugin__Squirrel +{ + constructor() + { + base.constructor(); + } + + function Initialize() + { + ::print("SquirrelChatLog initialize()"); + this.SetName("SquirrelChatLog"); + + local PluginManager = cRoot.Get().GetPluginManager(); + PluginManager.AddHook( this, PluginManager.E_PLUGIN_CHAT ); + return true; + } + + function OnChat( Message, Player ) + { + ::print(Player.GetName() + ": " + Message); + } +} + + +Plugin <- SquirrelChatLog(); +cRoot.Get().GetPluginManager().AddPlugin( Plugin ); -- cgit v1.2.3