-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bd7baf
commit 14bbc9d
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: CounterStrikeSharp | ||
description: Write Counter-Strike 2 server plugins in C#. | ||
template: splash | ||
hero: | ||
tagline: <code class="csharp">CounterStrikeSharp</code> is a simpler way to write CS2 server plugins. | ||
actions: | ||
- text: Get started | ||
link: ./guides/getting-started/ | ||
icon: right-arrow | ||
variant: primary | ||
- text: Browse source | ||
link: https://github.com/roflmuffin/CounterStrikeSharp/ | ||
icon: github | ||
--- | ||
```csharp | ||
using CounterStrikeSharp.API.Core; | ||
|
||
namespace HelloWorldPlugin; | ||
public class HelloWorldPlugin : BasePlugin | ||
{ | ||
public override string ModuleName => "Hello World Plugin"; | ||
|
||
public override string ModuleVersion => "0.0.1"; | ||
|
||
public override void Load(bool hotReload) | ||
{ | ||
Console.WriteLine("Hello World!"); | ||
} | ||
|
||
[GameEventHandler] | ||
public void OnPlayerConnect(EventPlayerConnect @event) | ||
{ | ||
Log($"Player {@event.Name} has connected!"); | ||
} | ||
|
||
[ConsoleCommand("issue_warning", "Issue warning to player")] | ||
public void OnCommand(int client, CommandInfo command) | ||
{ | ||
Log("You shouldn't be doing that!"); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters