Added local chat (10m radius)
This commit is contained in:
2
Main.cs
2
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);
|
||||
|
||||
13
Server/Events/Chat.cs
Normal file
13
Server/Events/Chat.cs
Normal file
@@ -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}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user