Added local chat (10m radius)

This commit is contained in:
hydrant
2018-10-30 21:43:17 +01:00
parent 8bdb21f503
commit e5be3783f6
2 changed files with 15 additions and 0 deletions

View File

@@ -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
View 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}"));
}
}
}