diff --git a/Main.cs b/Main.cs index e2cc3b08..b6cb9f26 100644 --- a/Main.cs +++ b/Main.cs @@ -22,6 +22,8 @@ namespace reallife_gamemode [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { + NAPI.Server.SetGlobalServerChat(false); + NAPI.Server.SetCommandErrorMessage("~r~[FEHLER]~s~ Dieser Command existiert nicht."); NAPI.Server.SetDefaultSpawnLocation(DEFAULT_SPAWN_POSITION, DEFAULT_SPAWN_HEADING); NAPI.Server.SetAutoSpawnOnConnect(false); diff --git a/Server/Events/Chat.cs b/Server/Events/Chat.cs new file mode 100644 index 00000000..42cfe262 --- /dev/null +++ b/Server/Events/Chat.cs @@ -0,0 +1,13 @@ +using GTANetworkAPI; + +namespace reallife_gamemode.Server.Events +{ + public class Chat : Script + { + [ServerEvent(Event.ChatMessage)] + public void ChatEvent(Client player, string message) + { + NAPI.Player.GetPlayersInRadiusOfPlayer(10, player).ForEach(p => p.SendChatMessage($"{player.Name} sagt: {message}")); + } + } +} \ No newline at end of file