---
title: "Event System - s&box library"
description: "About Event System\n\npublic partial class MyClass\n{\n public MyClass(){\n EventSystem.EventCommand.RegisterServerEvent<int, string>( \"server:test_event\", this.EventTest2 );\n EventSystem.EventCommand.RegisterGameEvent<int, string>( \"game:test_event\", this.EventTest );\n }\n\n public void EventTest(IClient client,int arg1, string arg2)\n {\n Log.Info( \"eventExecuted\" );\n Log.Info( arg1 );\n Log.Info( arg2 );\n //Call Server event with TriggerServerEvent\n EventSystem.EventCommand.TriggerServerEvent( \"server:test_event\", 1, \"uno\" );\n }\n\n public void EventTest2( IClient client, int arg1, string arg2 )\n {\n Log.Info( \"eventExecuted\" );\n Log.Info( arg1 );\n Log.Info( arg2 );\n }\n\n}\n\n//call Client Event with TriggerClientEvent\nEventSystem.EventCommand.TriggerClientEvent( client, \"game:test_event\", 1,\"uno\");\n\nYou can put up to 6 arguments, I'm working on a version with websockets not necessarily useful but can be good for certain things.\n\nYou can declare your event on methods that are not static."
canonical: "https://sbox.watch/zh-cn/libraries/dicta/event_system/"
generated_at: "2026-11-27T15:21:25.421Z"
---

# Event System

暂无简介。

- 类型: 库
- 标识符: dicta.event_system
- 创作者: dicta
- 规范地址: https://sbox.watch/zh-cn/libraries/dicta/event_system/
- Markdown: https://sbox.watch/zh-cn/libraries/dicta/event_system/index.md
- sbox.game: https://sbox.game/dicta/event_system/
- 生成时间: 2026-11-27T15:21:25.421Z

## 统计

- 24小时热度: +0
- Terry 评分: --
- 收藏: 0
- 好评: 0
- 差评: 0
- 更新时间: 2023年11月9日
- 创建时间: 2023年7月29日
- 大小: 45.2 KB
- 文件: 3


## 描述

About Event System

public partial class MyClass
{
 public MyClass(){
 EventSystem.EventCommand.RegisterServerEvent<int, string>( "server:test\_event", this.EventTest2 );
 EventSystem.EventCommand.RegisterGameEvent<int, string>( "game:test\_event", this.EventTest );
 }

 public void EventTest(IClient client,int arg1, string arg2)
 {
 Log.Info( "eventExecuted" );
 Log.Info( arg1 );
 Log.Info( arg2 );
 //Call Server event with TriggerServerEvent
 EventSystem.EventCommand.TriggerServerEvent( "server:test\_event", 1, "uno" );
 }

 public void EventTest2( IClient client, int arg1, string arg2 )
 {
 Log.Info( "eventExecuted" );
 Log.Info( arg1 );
 Log.Info( arg2 );
 }

}

//call Client Event with TriggerClientEvent
EventSystem.EventCommand.TriggerClientEvent( client, "game:test\_event", 1,"uno");

You can put up to 6 arguments, I'm working on a version with websockets not necessarily useful but can be good for certain things.

You can declare your event on methods that are not static.



## More by dicta

| Package | 标识符 | 玩家 | 收藏 | 好评 | 评分 | Markdown |
| --- | --- | --- | --- | --- | --- | --- |
| PanelRenderTarget | dicta.panelrendertarget | 0 | 0 | 0 | -- | https://sbox.watch/zh-cn/libraries/dicta/panelrendertarget/index.md |
