|
3 | 3 | using System.Text.Json; |
4 | 4 | using System.Text.Json.Nodes; |
5 | 5 | using System.Text.Json.Serialization; |
| 6 | +using CounterStrikeSharp.API.Core; |
6 | 7 |
|
7 | 8 | namespace CS2ScreenMenuAPI.Extensions |
8 | 9 | { |
@@ -38,6 +39,44 @@ public override void Write(Utf8JsonWriter writer, Color value, JsonSerializerOpt |
38 | 39 | : ColorTranslator.ToHtml(value); |
39 | 40 | writer.WriteStringValue(colorString); |
40 | 41 | } |
| 42 | + } |
| 43 | + public static class Helper |
| 44 | + { |
| 45 | + |
| 46 | + public static void SetBinds(CCSPlayerController player) |
| 47 | + { |
| 48 | + player.ExecuteClientCommand("echo test | bind 1 \"slot1;css_1\""); |
| 49 | + player.ExecuteClientCommand("echo test | bind 2 \"slot2;css_2\""); |
| 50 | + player.ExecuteClientCommand("echo test | bind 3 \"slot3;css_3\""); |
| 51 | + player.ExecuteClientCommand("echo test | bind 4 \"slot4;css_4\""); |
| 52 | + player.ExecuteClientCommand("echo test | bind 5 \"slot5;css_5\""); |
| 53 | + player.ExecuteClientCommand("echo test | bind 6 \"slot6;css_6\""); |
| 54 | + player.ExecuteClientCommand("echo test | bind 7 \"slot7;css_7\""); |
| 55 | + player.ExecuteClientCommand("echo test | bind 8 \"slot8;css_8\""); |
| 56 | + player.ExecuteClientCommand("echo test | bind 9 \"slot9;css_9\""); |
| 57 | + } |
| 58 | + public static void RemoveBinds(CCSPlayerController player) |
| 59 | + { |
41 | 60 |
|
| 61 | + player.ExecuteClientCommand("echo test | unbind 1 \"slot1;\""); |
| 62 | + player.ExecuteClientCommand("echo test | unbind 2 \"slot2;\""); |
| 63 | + player.ExecuteClientCommand("echo test | unbind 3 \"slot3;\""); |
| 64 | + player.ExecuteClientCommand("echo test | unbind 4 \"slot4;\""); |
| 65 | + player.ExecuteClientCommand("echo test | unbind 5 \"slot5;\""); |
| 66 | + player.ExecuteClientCommand("echo test | unbind 6 \"slot6;\""); |
| 67 | + player.ExecuteClientCommand("echo test | unbind 7 \"slot7;\""); |
| 68 | + player.ExecuteClientCommand("echo test | unbind 8 \"slot8;\""); |
| 69 | + player.ExecuteClientCommand("echo test | unbind 9 \"slot9;\""); |
| 70 | + |
| 71 | + player.ExecuteClientCommand("echo test | bind 1 \"css_1\""); |
| 72 | + player.ExecuteClientCommand("echo test | bind 2 \"css_2\""); |
| 73 | + player.ExecuteClientCommand("echo test | bind 3 \"css_3\""); |
| 74 | + player.ExecuteClientCommand("echo test | bind 4 \"css_4\""); |
| 75 | + player.ExecuteClientCommand("echo test | bind 5 \"css_5\""); |
| 76 | + player.ExecuteClientCommand("echo test | bind 6 \"css_6\""); |
| 77 | + player.ExecuteClientCommand("echo test | bind 7 \"css_7\""); |
| 78 | + player.ExecuteClientCommand("echo test | bind 8 \"css_8\""); |
| 79 | + player.ExecuteClientCommand("echo test | bind 9 \"css_9\""); |
| 80 | + } |
42 | 81 | } |
43 | 82 | } |
0 commit comments